Fix None bug in detect.py (#177)

This commit is contained in:
Gabriel Bianconi 2019-03-31 08:06:49 -04:00 committed by Glenn Jocher
parent c0cacc45a1
commit 6b828f184e
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ def detect(
pred = model(img) pred = model(img)
detections = non_max_suppression(pred, conf_thres, nms_thres)[0] detections = non_max_suppression(pred, conf_thres, nms_thres)[0]
if len(detections) > 0: if detections is not None and len(detections) > 0:
# Rescale boxes from 416 to true image size # Rescale boxes from 416 to true image size
scale_coords(img_size, detections[:, :4], im0.shape).round() scale_coords(img_size, detections[:, :4], im0.shape).round()