From dea82efa294277c29cb020ee6f7ee1d409ff38b5 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 11 Feb 2019 14:19:06 +0100 Subject: [PATCH] updates --- detect.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/detect.py b/detect.py index 984615c7..0868d925 100755 --- a/detect.py +++ b/detect.py @@ -18,7 +18,7 @@ def detect( nms_thres=0.45, save_txt=False, save_images=True, - webcam=False + webcam=True ): device = torch_utils.select_device() os.system('rm -rf ' + output) @@ -85,13 +85,14 @@ def detect( label = '%s %.2f' % (classes[int(cls)], conf) plot_one_box([x1, y1, x2, y2], im0, label=label, color=colors[int(cls)]) - print('Done. (%.3fs)' % (time.time() - t)) + dt = time.time() - t + print('Done. (%.3fs)' % dt) if save_images: # Save generated image with detections cv2.imwrite(save_path, im0) if webcam: # Show live webcam - cv2.imshow(weights, im0) + cv2.imshow(weights + ' - %.2f FPS' % (1 / dt), im0) if save_images and (platform == 'darwin'): # MacOS os.system('open ' + output + '&& open ' + save_path)