From 7a3d56952f6a89a26cf3c303678abce6b61ca827 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 24 Jan 2021 18:01:58 -0800 Subject: [PATCH] data-autodownload background tasks (#2034) --- data/scripts/get_coco.sh | 4 +++- data/scripts/get_voc.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/scripts/get_coco.sh b/data/scripts/get_coco.sh index 157a0b04cf86..b0df905c8525 100755 --- a/data/scripts/get_coco.sh +++ b/data/scripts/get_coco.sh @@ -20,5 +20,7 @@ f1='train2017.zip' # 19G, 118k images f2='val2017.zip' # 1G, 5k images f3='test2017.zip' # 7G, 41k images (optional) for f in $f1 $f2; do - echo 'Downloading' $url$f ' ...' && curl -L $url$f -o $f && unzip -q $f -d $d && rm $f # download, unzip, remove + echo 'Downloading' $url$f '...' && curl -L $url$f -o $f # download, (unzip, remove in background) + unzip -q $f -d $d && rm $f & done +wait # finish background tasks diff --git a/data/scripts/get_voc.sh b/data/scripts/get_voc.sh index 6bdaa9bcc071..06414b085095 100644 --- a/data/scripts/get_voc.sh +++ b/data/scripts/get_voc.sh @@ -17,9 +17,11 @@ url=https://github.com/ultralytics/yolov5/releases/download/v1.0/ f1=VOCtrainval_06-Nov-2007.zip # 446MB, 5012 images f2=VOCtest_06-Nov-2007.zip # 438MB, 4953 images f3=VOCtrainval_11-May-2012.zip # 1.95GB, 17126 images -for f in $f1 $f2 $f3; do - echo 'Downloading' $url$f ' ...' && curl -L $url$f -o $f && unzip -q $f -d $d && rm $f # download, unzip, remove +for f in $f3 $f2 $f1; do + echo 'Downloading' $url$f '...' && curl -L $url$f -o $f # download, (unzip, remove in background) + unzip -q $f -d $d && rm $f & done +wait # finish background tasks end=$(date +%s) runtime=$((end - start))