ultralytics 8.0.205 HUB dataset downloads fix (#6101)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2023-11-02 22:32:52 +01:00 committed by GitHub
parent ff0aba10c5
commit ff921ca93e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View file

@ -278,7 +278,9 @@ def safe_download(url,
url, file = get_google_drive_file_info(url)
f = Path(dir or '.') / (file or url2file(url)) # URL converted to filename
if not f.is_file(): # URL and file do not exist
if '://' not in str(url) and Path(url).is_file(): # URL exists ('://' check required in Windows Python<3.10)
f = Path(url) # filename
elif not f.is_file(): # URL and file do not exist
desc = f"Downloading {url if gdrive else clean_url(url)} to '{f}'"
LOGGER.info(f'{desc}...')
f.parent.mkdir(parents=True, exist_ok=True) # make directory if missing