Fix None bug in detect.py (#177)
This commit is contained in:
parent
c0cacc45a1
commit
6b828f184e
|
@ -62,7 +62,7 @@ def detect(
|
|||
pred = model(img)
|
||||
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
|
||||
scale_coords(img_size, detections[:, :4], im0.shape).round()
|
||||
|
||||
|
|
Loading…
Reference in New Issue