From 3bd00360bcd8b8473b217d46dab643399c0ac1fe Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 6 Dec 2019 13:50:16 -0800 Subject: [PATCH] updates --- models.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/models.py b/models.py index bbc1c057..b1431080 100755 --- a/models.py +++ b/models.py @@ -438,7 +438,6 @@ def attempt_download(weights): # Attempt to download pretrained weights if not found locally msg = weights + ' missing, try downloading from https://drive.google.com/open?id=1LezFG5g3BCW6iYaV89B2i64cqEUZD7e0' - r = 1 # error value if weights and not os.path.isfile(weights): d = {'yolov3-spp.weights': '16lYS4bcIdM2HdmyJBVDOvt3Trx6N3W2R', 'yolov3.weights': '1uTlyDWlnaqXcsKOktP5aH_zRDbfcDp-y', @@ -459,7 +458,7 @@ def attempt_download(weights): print('Downloading ' + url) r = os.system('curl -f ' + url + ' -o ' + weights) - # Error check - if not (r == 0 and os.path.exists(weights) and os.path.getsize(weights) > 1E6): # weights exist and > 1MB - os.system('rm ' + weights) # remove partial downloads - raise Exception(msg) + # Error check + if not (r == 0 and os.path.exists(weights) and os.path.getsize(weights) > 1E6): # weights exist and > 1MB + os.system('rm ' + weights) # remove partial downloads + raise Exception(msg)