Browse Source

Add NMS threshold checks (#3020)

* Add NMS threshold checks

* fix
modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
41cc7caee6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      utils/general.py

+ 4
- 0
utils/general.py View File

nc = prediction.shape[2] - 5 # number of classes nc = prediction.shape[2] - 5 # number of classes
xc = prediction[..., 4] > conf_thres # candidates xc = prediction[..., 4] > conf_thres # candidates


# Checks
assert 0 <= conf_thres <= 1, f'Invalid Confidence threshold {conf_thres}, valid values are between 0.0 and 1.0'
assert 0 <= iou_thres <= 1, f'Invalid IoU {iou_thres}, valid values are between 0.0 and 1.0'

# Settings # Settings
min_wh, max_wh = 2, 4096 # (pixels) minimum and maximum box width and height min_wh, max_wh = 2, 4096 # (pixels) minimum and maximum box width and height
max_det = 300 # maximum number of detections per image max_det = 300 # maximum number of detections per image

Loading…
Cancel
Save