@@ -55,26 +55,30 @@ class FASTDEPLOY_DECL RKYOLOPostprocessor {
55
55
// / Get nms_threshold, default 0.45
56
56
float GetNMSThreshold () const { return nms_threshold_; }
57
57
58
- // Set height and weight
58
+ // / Set height and weight
59
59
void SetHeightAndWeight (int & height, int & width) {
60
60
height_ = height;
61
61
width_ = width;
62
62
}
63
63
64
- // Set pad_hw_values
64
+ // / Set pad_hw_values
65
65
void SetPadHWValues (std::vector<std::vector<int >> pad_hw_values) {
66
66
pad_hw_values_ = pad_hw_values;
67
67
}
68
68
69
- // Set scale
70
- void SetScale (std::vector<float > scale) {
71
- scale_ = scale;
72
- }
69
+ // / Set scale
70
+ void SetScale (std::vector<float > scale) { scale_ = scale; }
73
71
74
- // Set Anchor
72
+ // / Set Anchor
75
73
void SetAnchor (std::vector<int > anchors, int anchor_per_branch) {
76
- anchors_ = anchors;
77
- anchor_per_branch_ = anchor_per_branch;
74
+ anchors_ = anchors;
75
+ anchor_per_branch_ = anchor_per_branch;
76
+ }
77
+
78
+ // / Set the number of class
79
+ void SetClassNum (int num) {
80
+ obj_class_num_ = num;
81
+ prob_box_size_ = obj_class_num_ + 5 ;
78
82
}
79
83
80
84
private:
@@ -85,12 +89,9 @@ class FASTDEPLOY_DECL RKYOLOPostprocessor {
85
89
int width_ = 0 ;
86
90
int anchor_per_branch_ = 0 ;
87
91
88
- int ProcessFP16 (float *input, int *anchor, int grid_h,
89
- int grid_w, int stride,
90
- std::vector<float > &boxes,
91
- std::vector<float > &boxScores,
92
- std::vector<int > &classId,
93
- float threshold);
92
+ int ProcessFP16 (float * input, int * anchor, int grid_h, int grid_w, int stride,
93
+ std::vector<float >& boxes, std::vector<float >& boxScores,
94
+ std::vector<int >& classId, float threshold);
94
95
// Model
95
96
int QuickSortIndiceInverse (std::vector<float >& input, int left, int right,
96
97
std::vector<int >& indices);
0 commit comments