This commit is contained in:
Glenn Jocher 2019-12-23 23:28:56 -08:00
parent 61609b54b1
commit 05a9a6205f
1 changed files with 3 additions and 3 deletions

View File

@ -105,14 +105,14 @@ def detect(save_txt=False, save_img=False):
# Rescale boxes from img_size to im0 size # Rescale boxes from img_size to im0 size
det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round() det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round()
# Print time (inference + NMS)
print('%sDone. (%.3fs)' % (s, time.time() - t))
# Print results # Print results
for c in det[:, -1].unique(): for c in det[:, -1].unique():
n = (det[:, -1] == c).sum() # detections per class n = (det[:, -1] == c).sum() # detections per class
s += '%g %ss, ' % (n, names[int(c)]) # add to string s += '%g %ss, ' % (n, names[int(c)]) # add to string
# Print time (inference + NMS)
print('%sDone. (%.3fs)' % (s, time.time() - t))
# Write results # Write results
for *xyxy, conf, cls in det: for *xyxy, conf, cls in det:
if save_txt: # Write to file if save_txt: # Write to file