Unverified Commit 2e8bda4e authored by Double-Z's avatar Double-Z Committed by GitHub
Browse files

[Fix] Fix a potential overflow bug when post_max_size is set too large in the circle_nms (#1225)



* [Fix] overflow bug

* [Fix] typo
Co-authored-by: default avatarzeyuzeng <zeyuzeng@autox.ai>
Co-authored-by: default avatarzeyu-hello <zeyuzeng@hotmail.com>
parent 91925016
...@@ -219,4 +219,8 @@ def circle_nms(dets, thresh, post_max_size=83): ...@@ -219,4 +219,8 @@ def circle_nms(dets, thresh, post_max_size=83):
# ovr = inter / areas[j] # ovr = inter / areas[j]
if dist <= thresh: if dist <= thresh:
suppressed[j] = 1 suppressed[j] = 1
if post_max_size < len(keep):
return keep[:post_max_size] return keep[:post_max_size]
return keep
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