Function mindspore::dataset::ApplyNms
Defined in File image_process.h
Function Documentation
-
std::vector<int> mindspore::dataset::ApplyNms(const std::vector<std::vector<float>> &all_boxes, std::vector<float> &all_scores, float thres, int max_boxes)
Apply Non-Maximum Suppression.
- Parameters
all_boxes – [in] All input boxes.
all_scores – [in] Score after all boxes are executed through the network.
thres – [in] Pre-value of IOU.
max_boxes – [in] Maximum value of output box.
- Returns
Remaining bounding boxes.
Example/* Apply NMS on bboxes */ std::vector<std::vector<float>> all_boxes = {{1, 1, 2, 2}, {3, 3, 4, 4}, {5, 5, 6, 6}, {5, 5, 6, 6}}; std::vector<float> all_scores = {0.6, 0.5, 0.4, 0.9}; std::vector<int> keep = ApplyNms(all_boxes, all_scores, 0.5, 10);