@@ -449,8 +449,9 @@ def check_dataset(data, autodownload=True):
449449 if val :
450450 val = [Path (x ).resolve () for x in (val if isinstance (val , list ) else [val ])] # val path
451451 if not all (x .exists () for x in val ):
452- LOGGER .info ('\n Dataset not found, missing paths: %s' % [str (x ) for x in val if not x .exists ()])
452+ LOGGER .info (emojis ( '\n Dataset not found ⚠️ , missing paths %s' % [str (x ) for x in val if not x .exists ()]) )
453453 if s and autodownload : # download script
454+ t = time .time ()
454455 root = path .parent if 'path' in data else '..' # unzip directory i.e. '../'
455456 if s .startswith ('http' ) and s .endswith ('.zip' ): # URL
456457 f = Path (s ).name # filename
@@ -465,9 +466,11 @@ def check_dataset(data, autodownload=True):
465466 r = os .system (s )
466467 else : # python script
467468 r = exec (s , {'yaml' : data }) # return None
468- LOGGER .info (f"Dataset autodownload { f'success, saved to { root } ' if r in (0 , None ) else 'failure' } \n " )
469+ dt = f'({ round (time .time () - t , 1 )} s)'
470+ s = f"success ✅ { dt } , saved to { colorstr ('bold' , root )} " if r in (0 , None ) else f"failure { dt } ❌"
471+ LOGGER .info (emojis (f"Dataset download { s } " ))
469472 else :
470- raise Exception ('Dataset not found.' )
473+ raise Exception (emojis ( 'Dataset not found ❌' ) )
471474
472475 return data # dictionary
473476
@@ -491,7 +494,7 @@ def download_one(url, dir):
491494 if curl :
492495 os .system (f"curl -L '{ url } ' -o '{ f } ' --retry 9 -C -" ) # curl download, retry and resume on fail
493496 else :
494- torch .hub .download_url_to_file (url , f , progress = True ) # torch download
497+ torch .hub .download_url_to_file (url , f , progress = threads == 1 ) # torch download
495498 if unzip and f .suffix in ('.zip' , '.gz' ):
496499 LOGGER .info (f'Unzipping { f } ...' )
497500 if f .suffix == '.zip' :
0 commit comments