Parameterize max_det + inference default at 1000 (#3215)

* Added max_det parameters in various places

* 120 character line

* PEP8

* 120 character line

* Update inference default to 1000 instances

* Update inference default to 1000 instances

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Adrian HolovatyandGlenn Jocher authored and GitHub committed 2021-05-17 22:47:44 +02:00
1 parent 13a1c72699
commit 3f74cd9ed1
3 files changed
+8 -5

No files matched your search

+1 -2
View File
@@ -482,7 +482,7 @@ def wh_iou(wh1, wh2):
def non_max_suppression(prediction, conf_thres=0.25, iou_thres=0.45, classes=None, agnostic=False, multi_label=False,
labels=()):
labels=(), max_det=300):
"""Runs Non-Maximum Suppression (NMS) on inference results
Returns:
@@ -498,7 +498,6 @@ def non_max_suppression(prediction, conf_thres=0.25, iou_thres=0.45, classes=Non
# Settings
min_wh, max_wh = 2, 4096 # (pixels) minimum and maximum box width and height
max_det = 300 # maximum number of detections per image
max_nms = 30000 # maximum number of boxes into torchvision.ops.nms()
time_limit = 10.0 # seconds to quit after
redundant = True # require redundant detections