Files
FastDeploy/fastdeploy/vision/ppdet/ppyoloe.h
T
Jason 17e4dc6b5e Support remove multiclass_nms to enable ppyoloe to tensorrt (#40)
* Add custom operator for onnxruntime ans fix paddle backend

* Polish cmake files and runtime apis

* Remove copy libraries

* fix some issue

* fix bug

* fix bug

* Support remove multiclass_nms to enable paddledetection run tensorrt

* Support remove multiclass_nms to enable paddledetection run tensorrt

* Support remove multiclass_nms to enable paddledetection run tensorrt

* Support remove multiclass_nms to enable paddledetection run tensorrt

* add common operator multiclassnms

* fix compile problem

Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com>
2022-07-26 11:16:01 +08:00

49 lines
1.4 KiB
C++

#pragma once
#include "fastdeploy/fastdeploy_model.h"
#include "fastdeploy/vision/common/processors/transform.h"
#include "fastdeploy/vision/common/result.h"
#include "fastdeploy/vision/utils/utils.h"
namespace fastdeploy {
namespace vision {
namespace ppdet {
class FASTDEPLOY_DECL PPYOLOE : public FastDeployModel {
public:
PPYOLOE(const std::string& model_file, const std::string& params_file,
const std::string& config_file,
const RuntimeOption& custom_option = RuntimeOption(),
const Frontend& model_format = Frontend::PADDLE);
std::string ModelName() const { return "PaddleDetection/PPYOLOE"; }
virtual bool Initialize();
virtual bool BuildPreprocessPipelineFromConfig();
virtual bool Preprocess(Mat* mat, std::vector<FDTensor>* outputs);
virtual bool Postprocess(std::vector<FDTensor>& infer_result,
DetectionResult* result);
virtual bool Predict(cv::Mat* im, DetectionResult* result,
float conf_threshold = 0.5, float nms_threshold = 0.7);
private:
std::vector<std::shared_ptr<Processor>> processors_;
std::string config_file_;
// configuration for nms
int64_t background_label = -1;
int64_t keep_top_k = 300;
float nms_eta = 1.0;
float nms_threshold = 0.7;
float score_threshold = 0.01;
int64_t nms_top_k = 10000;
bool normalized = true;
bool has_nms_ = false;
};
} // namespace ppdet
} // namespace vision
} // namespace fastdeploy