Unverified Commit ac0d8398 authored by shlrao's avatar shlrao Committed by GitHub
Browse files

fix nms implentation of cpu (#1244)

parent 9c58d9e7
......@@ -88,7 +88,7 @@ void NmsKernel::Compute(OrtKernelContext *context) {
auto h = std::max(0.f, yy2 - yy1 + offset);
auto inter = w * h;
auto ovr = inter / (iarea + areas[j] - inter);
if (ovr >= iou_threshold) select[_j] = false;
if (ovr > iou_threshold) select[_j] = false;
}
}
std::vector<int64_t> res_order;
......
......@@ -55,7 +55,7 @@ Tensor nms_cpu(Tensor boxes, Tensor scores, float iou_threshold, int offset) {
auto h = std::max(0.f, yy2 - yy1 + offset);
auto inter = w * h;
auto ovr = inter / (iarea + areas[j] - inter);
if (ovr >= iou_threshold) select[_j] = false;
if (ovr > iou_threshold) select[_j] = false;
}
}
return order_t.masked_select(select_t);
......
......@@ -55,7 +55,7 @@ Tensor nms_cpu(Tensor boxes, Tensor scores, float iou_threshold, int offset) {
auto h = std::max(0.f, yy2 - yy1 + offset);
auto inter = w * h;
auto ovr = inter / (iarea + areas[j] - inter);
if (ovr >= iou_threshold) select[_j] = false;
if (ovr > iou_threshold) select[_j] = false;
}
}
return order_t.masked_select(select_t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment