18 #include "fastdeploy/vision/common/processors/transform.h" 19 #include "fastdeploy/fastdeploy_model.h" 20 #include "fastdeploy/vision/common/result.h" 21 #include "fastdeploy/vision/tracking/pptracking/tracker.h" 27 std::map<int, std::vector<std::array<int, 2>>> records;
28 void Add(
int id,
const std::array<int, 2>& record);
31 inline void TrailRecorder::Add(
int id,
const std::array<int, 2>& record) {
32 auto iter = records.find(
id);
33 if (iter != records.end()) {
34 auto trail = records[id];
35 trail.push_back(record);
38 records[id] = {record};
42 class FASTDEPLOY_DECL PPTracking:
public FastDeployModel {
52 PPTracking(
const std::string& model_file,
53 const std::string& params_file,
54 const std::string& config_file,
55 const RuntimeOption& custom_option = RuntimeOption(),
59 std::string ModelName()
const override {
return "pptracking"; }
67 virtual bool Predict(cv::Mat* img, MOTResult* result);
72 void BindRecorder(TrailRecorder* recorder);
75 void UnbindRecorder();
78 bool BuildPreprocessPipelineFromConfig();
82 bool Preprocess(Mat* img, std::vector<FDTensor>* outputs);
84 bool Postprocess(std::vector<FDTensor>& infer_result, MOTResult *result);
86 std::vector<std::shared_ptr<Processor>> processors_;
87 std::string config_file_;
88 float draw_threshold_;
90 float tracked_thresh_;
92 bool is_record_trail_ =
false;
93 std::unique_ptr<JDETracker> jdeTracker_;
94 TrailRecorder *recorder_ =
nullptr;
void Add(const FDTensor &x, const FDTensor &y, FDTensor *out)
Definition: elementwise.cc:30
ModelFormat
Definition: enum_variables.h:67
Model with paddlepaddle format.
Definition: enum_variables.h:69
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16