Skip to content

Commit a1f9bff

Browse files
committed
fix
1 parent f1cf9f0 commit a1f9bff

File tree

1 file changed

+6
-5
lines changed
  • yolox_ros_cpp/yolox_cpp/include/yolox_cpp

1 file changed

+6
-5
lines changed

yolox_ros_cpp/yolox_cpp/include/yolox_cpp/core.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ namespace yolox_cpp
1515
cv::Rect_<float> rect;
1616
int label;
1717
float prob;
18-
bool operator<(const Object &right) const {
19-
return prob < right.prob;
20-
}
2118
};
2219

2320
struct GridAndStride
@@ -246,8 +243,12 @@ namespace yolox_cpp
246243
std::vector<Object> proposals;
247244
generate_yolox_proposals(grid_strides, prob, bbox_conf_thresh, proposals);
248245

249-
// descent
250-
std::sort(std::rbegin(proposals), std::rend(proposals));
246+
std::sort(
247+
proposals.begin(), proposals.end(),
248+
[](const Object &a, const Object &b)
249+
{
250+
return a.prob > b.prob; // descent
251+
});
251252

252253
std::vector<int> picked;
253254
nms_sorted_bboxes(proposals, picked, nms_thresh_);

0 commit comments

Comments
 (0)