From 2634ff502de36c52451d3e25ca1e9afb954c6ee8 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 12 Feb 2019 18:21:06 +0100 Subject: [PATCH] optimize imports --- detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index 577be924..d5db8fe2 100644 --- a/detect.py +++ b/detect.py @@ -30,7 +30,7 @@ def detect( # Load weights if weights.endswith('.pt'): # pytorch format - if weights.endswith('weights/yolov3.pt') and not os.path.isfile(weights): + if weights.endswith('yolov3.pt') and not os.path.isfile(weights) and (platform == 'darwin'): os.system('wget https://storage.googleapis.com/ultralytics/yolov3.pt -O ' + weights) model.load_state_dict(torch.load(weights, map_location='cpu')['model']) else: # darknet format @@ -98,7 +98,7 @@ def detect( if webcam: # Show live webcam cv2.imshow(weights + ' - %.2f FPS' % (1 / dt), im0) - if save_images and (platform == 'darwin'): # MacOS + if save_images and (platform == 'darwin'): # linux/macos os.system('open ' + output + ' ' + save_path)