From d0b1d006623b0df837643486ff7359bd375351c3 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 14 Aug 2022 23:05:28 +0200 Subject: [PATCH] Add `.tar` support for datasets --- utils/general.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index 502459d7b789..65130ca57762 100755 --- a/utils/general.py +++ b/utils/general.py @@ -594,10 +594,12 @@ def download_one(url, dir): else: LOGGER.warning(f'Failed to download {url}...') - if unzip and success and f.suffix in ('.zip', '.gz'): + if unzip and success and f.suffix in ('.zip', '.tar', '.gz'): LOGGER.info(f'Unzipping {f}...') if f.suffix == '.zip': ZipFile(f).extractall(path=dir) # unzip + elif f.suffix == '.tar': + os.system(f'tar xf {f} --directory {f.parent}') # unzip elif f.suffix == '.gz': os.system(f'tar xfz {f} --directory {f.parent}') # unzip if delete: