"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "10aca5f405f7ecee172cdd1590fe94fefc5e4a87"
Commit 347e79c1 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Pass by value to suppress_by_iou()

Make copies here since we're doing this calc in parallel
parent 8cced061
...@@ -187,7 +187,7 @@ struct nonmaxsuppression ...@@ -187,7 +187,7 @@ struct nonmaxsuppression
return result; return result;
} }
inline bool suppress_by_iou(box& b1, box& b2, double iou_threshold) const inline bool suppress_by_iou(box b1, box b2, double iou_threshold) const
{ {
b1.sort(); b1.sort();
b2.sort(); b2.sort();
...@@ -302,17 +302,15 @@ struct nonmaxsuppression ...@@ -302,17 +302,15 @@ struct nonmaxsuppression
std::vector<std::pair<double, int64_t>> remainder_boxes(boxes_heap.size()); std::vector<std::pair<double, int64_t>> remainder_boxes(boxes_heap.size());
auto it = auto it = std::copy_if(
std::copy_if(std::execution::par, std::execution::par,
boxes_heap.begin(), boxes_heap.begin(),
boxes_heap.end(), boxes_heap.end(),
remainder_boxes.begin(), remainder_boxes.begin(),
[&](auto iou_candidate_box) { [&](auto iou_candidate_box) {
auto iou_box = auto iou_box = batch_box(batch_boxes_start, iou_candidate_box.second);
batch_box(batch_boxes_start, iou_candidate_box.second); return not this->suppress_by_iou(iou_box, next_box, iou_threshold);
return not this->suppress_by_iou( });
std::ref(iou_box), std::ref(next_box), iou_threshold);
});
remainder_boxes.resize(it - remainder_boxes.begin()); remainder_boxes.resize(it - remainder_boxes.begin());
boxes_heap = remainder_boxes; boxes_heap = remainder_boxes;
......
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