"configs/models/llama2_7b.py" did not exist on "eea8b04417e5ec00f13898fbc5ab008837dc5d02"
Commit 7b42f05c authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Add early return for suppress function based on box area

Just quickly return if either boxes have zero area. Searching for intersection
and union is irrelevant here logically.
parent 42685803
...@@ -191,6 +191,14 @@ struct nonmaxsuppression ...@@ -191,6 +191,14 @@ struct nonmaxsuppression
b1.sort(); b1.sort();
b2.sort(); b2.sort();
const double area1 = b1.area();
const double area2 = b2.area();
if(area1 <= .0f or area2 <= .0f)
{
return false;
}
box intersection{}; box intersection{};
for(auto i : range(2)) for(auto i : range(2))
{ {
...@@ -202,12 +210,10 @@ struct nonmaxsuppression ...@@ -202,12 +210,10 @@ struct nonmaxsuppression
} }
} }
const double area1 = b1.area();
const double area2 = b2.area();
const double intersection_area = intersection.area(); const double intersection_area = intersection.area();
const double union_area = area1 + area2 - intersection_area; const double union_area = area1 + area2 - intersection_area;
if(area1 <= .0f or area2 <= .0f or union_area <= .0f) if(union_area <= .0f)
{ {
return false; return false;
} }
......
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