ultralytics 8.0.205 HUB dataset downloads fix (#6101)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
ff0aba10c5
commit
ff921ca93e
4 changed files with 10 additions and 8 deletions
|
|
@ -707,7 +707,7 @@ def remove_colorstr(input_string):
|
|||
>>> remove_colorstr(colorstr('blue', 'bold', 'hello world'))
|
||||
>>> 'hello world'
|
||||
"""
|
||||
ansi_escape = re.compile(r'\x1B(?:[@-Z\\\-_]|\[[0-9]*[ -/]*[@-~])')
|
||||
ansi_escape = re.compile(r'\x1B\[[0-9;]*[A-Za-z]')
|
||||
return ansi_escape.sub('', input_string)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue