#include namespace migraphxSamples { bool CompareConfidence(const ResultOfDetection &L,const ResultOfDetection &R) { return L.confidence > R.confidence; } bool CompareArea(const ResultOfDetection &L,const ResultOfDetection &R) { return L.boundingBox.area() > R.boundingBox.area(); } void NMS(std::vector &detections, float IOUThreshold) { // sort std::sort(detections.begin(), detections.end(), CompareConfidence); for (int i = 0; iIOUThreshold) { detections[j].exist = false; } } } } } } }