This commit is contained in:
Glenn Jocher 2019-02-18 19:17:48 +01:00
parent a80b2d1611
commit adea337545
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,8 @@ gsutil cp gs://ultralytics/yolov3.pt yolov3/weights
python3 detect.py python3 detect.py
# Test # Test
python3 test.py --img_size 416 --weights weights/latest.pt sudo rm -rf yolov3 && git clone https://github.com/ultralytics/yolov3 && cd yolov3
python3 test.py --weights weights/yolov3.weights
# Test Darknet # Test Darknet
python3 test.py --img_size 416 --weights ../darknet/backup/yolov3.backup python3 test.py --img_size 416 --weights ../darknet/backup/yolov3.backup

View File

@ -392,6 +392,7 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.4):
# 64 5000 0.619 0.579 0.568 # 64 5000 0.619 0.579 0.568
# 96 5000 0.652 0.622 0.613 # 96 5000 0.652 0.622 0.613
# 128 5000 0.651 0.625 0.617 # 128 5000 0.651 0.625 0.617
# 5000 5000 0.627 0.593 0.584
elif nms_style == 'AND': # requires overlap, single boxes erased elif nms_style == 'AND': # requires overlap, single boxes erased
while len(dc) > 1: while len(dc) > 1:
@ -405,7 +406,7 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.4):
iou = bbox_iou(dc[:1], dc[0:]) # iou with other boxes iou = bbox_iou(dc[:1], dc[0:]) # iou with other boxes
i = iou > nms_thres i = iou > nms_thres
weights = dc[i, 4:5] * dc[i, 5:6] weights = (dc[i, 4:5] * dc[i, 5:6]) ** 0.5
dc[0, :4] = (weights * dc[i, :4]).sum(0) / weights.sum() dc[0, :4] = (weights * dc[i, :4]).sum(0) / weights.sum()
det_max.append(dc[:1]) det_max.append(dc[:1])
dc = dc[iou < nms_thres] dc = dc[iou < nms_thres]