17 #include "fastdeploy/vision/common/processors/transform.h" 18 #include "fastdeploy/vision/common/result.h" 19 #include "fastdeploy/vision/detection/contrib/rknpu2/utils.h" 39 bool Run(
const std::vector<FDTensor>& tensors,
40 std::vector<DetectionResult>* results);
44 nms_threshold_ = nms_threshold;
49 conf_threshold_ = conf_threshold;
66 pad_hw_values_ = pad_hw_values;
70 void SetScale(
const std::vector<float>& scale) { scale_ = scale; }
73 void SetAnchor(
const std::vector<int>& anchors,
int anchor_per_branch) {
75 anchor_per_branch_ = anchor_per_branch;
81 prob_box_size_ = obj_class_num_ + 5;
85 return obj_class_num_;
89 std::vector<int> anchors_ = {10, 13, 16, 30, 33, 23, 30, 61, 62,
90 45, 59, 119, 116, 90, 156, 198, 373, 326};
91 int strides_[3] = {8, 16, 32};
94 int anchor_per_branch_ = 0;
96 int ProcessFP16(
float* input,
int* anchor,
int grid_h,
int grid_w,
int stride,
97 std::vector<float>& boxes, std::vector<float>& boxScores,
98 std::vector<int>& classId,
float threshold);
100 int QuickSortIndiceInverse(std::vector<float>& input,
int left,
int right,
101 std::vector<int>& indices);
104 std::vector<std::vector<int>> pad_hw_values_;
105 std::vector<float> scale_;
106 float nms_threshold_ = 0.45;
107 float conf_threshold_ = 0.25;
108 int prob_box_size_ = 85;
109 int obj_class_num_ = 80;
110 int obj_num_bbox_max_size = 200;
Postprocessor object for YOLOv5 serials model.
Definition: postprocessor.h:26
void SetAnchor(const std::vector< int > &anchors, int anchor_per_branch)
Set Anchor.
Definition: postprocessor.h:73
void SetClassNum(int num)
Set the number of class.
Definition: postprocessor.h:79
void SetConfThreshold(float conf_threshold)
Set conf_threshold, default 0.25.
Definition: postprocessor.h:48
void SetPadHWValues(const std::vector< std::vector< int >> &pad_hw_values)
Set pad_hw_values.
Definition: postprocessor.h:65
void SetNMSThreshold(float nms_threshold)
Set nms_threshold, default 0.45.
Definition: postprocessor.h:43
void SetScale(const std::vector< float > &scale)
Set scale.
Definition: postprocessor.h:70
float GetNMSThreshold() const
Get nms_threshold, default 0.45.
Definition: postprocessor.h:56
float GetConfThreshold() const
Get conf_threshold, default 0.25.
Definition: postprocessor.h:53
int GetClassNum()
Get the number of class.
Definition: postprocessor.h:84
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16
void SetHeightAndWeight(int height, int width)
Set height and weight.
Definition: postprocessor.h:59