From 1239e8dca32bd0655aa7ca96b195856d399d9b00 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 17 Feb 2019 17:32:53 +0100 Subject: [PATCH] updates --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index 4a955253..611c05a5 100644 --- a/detect.py +++ b/detect.py @@ -31,7 +31,7 @@ def detect( # Load weights if weights.endswith('.pt'): # pytorch format - if weights.endswith('yolov3.pt') and not os.path.isfile(weights) and (platform == 'darwin'): + if weights.endswith('yolov3.pt') and not os.path.exists(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