From ffe9eb42389038972d47eecd44c0f0dc9f2cf033 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 3 Sep 2020 11:41:33 -0700 Subject: [PATCH] remove if platform.system() == 'Darwin' checks --- utils/general.py | 5 +---- utils/google_utils.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/utils/general.py b/utils/general.py index 482b2c7..686e682 100755 --- a/utils/general.py +++ b/utils/general.py @@ -146,10 +146,7 @@ def check_dataset(dict): print('Downloading %s ...' % s) if s.startswith('http') and s.endswith('.zip'): # URL f = Path(s).name # filename - if platform.system() == 'Darwin': # avoid MacOS python requests certificate error - os.system('curl -L %s -o %s' % (s, f)) - else: - torch.hub.download_url_to_file(s, f) + torch.hub.download_url_to_file(s, f) r = os.system('unzip -q %s -d ../ && rm %s' % (f, f)) # unzip else: # bash script r = os.system(s) diff --git a/utils/google_utils.py b/utils/google_utils.py index 5c60fa2..6012f14 100644 --- a/utils/google_utils.py +++ b/utils/google_utils.py @@ -31,10 +31,7 @@ def attempt_download(weights): try: # GitHub url = 'https://github.com/ultralytics/yolov5/releases/download/v3.0/' + file print('Downloading %s to %s...' % (url, weights)) - if platform.system() == 'Darwin': # avoid MacOS python requests certificate error - r = os.system('curl -L %s -o %s' % (url, weights)) - else: - torch.hub.download_url_to_file(url, weights) + torch.hub.download_url_to_file(url, weights) assert os.path.exists(weights) and os.path.getsize(weights) > 1E6 # check except Exception as e: # GCP print('Download error: %s' % e)