From 7709e8aa721fa2286bcadc30e945a66500c279bb Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 9 Apr 2019 16:28:14 +0200 Subject: [PATCH] updates --- utils/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index e501442b..f98917a4 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -319,13 +319,14 @@ def build_targets(model, targets): # Class tcls.append(c) - assert c.max() <= layer.nC, 'Target classes exceed model classes' + if c.shape[0]: + assert c.max() <= layer.nC, 'Target classes exceed model classes' return txy, twh, tcls, indices # @profile -def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.4): +def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5): """ Removes detections with lower object confidence score than 'conf_thres' Non-Maximum Suppression to further filter detections.