2020-08-10 11:52:57 +08:00
|
|
|
#!/bin/bash
|
2021-07-28 05:23:41 +08:00
|
|
|
# YOLOv5 🚀 by Ultralytics https://ultralytics.com, licensed under GNU GPL v3.0
|
2021-07-26 21:23:33 +08:00
|
|
|
# Download COCO 2017 dataset http://cocodataset.org
|
2021-07-28 05:23:41 +08:00
|
|
|
# Example usage: bash data/scripts/get_coco.sh
|
2021-07-26 21:23:33 +08:00
|
|
|
# parent
|
|
|
|
# ├── yolov5
|
|
|
|
# └── datasets
|
|
|
|
# └── coco ← downloads here
|
2020-08-10 11:52:57 +08:00
|
|
|
|
|
|
|
# Download/unzip labels
|
2021-06-26 21:29:16 +08:00
|
|
|
d='../datasets' # unzip directory
|
2020-10-13 21:58:03 +08:00
|
|
|
url=https://github.com/ultralytics/yolov5/releases/download/v1.0/
|
2021-02-12 13:22:45 +08:00
|
|
|
f='coco2017labels.zip' # or 'coco2017labels-segments.zip', 68 MB
|
2021-02-07 14:13:39 +08:00
|
|
|
echo 'Downloading' $url$f ' ...'
|
2021-07-29 05:35:14 +08:00
|
|
|
curl -L $url$f -o $f && unzip -q $f -d $d && rm $f &
|
2020-08-10 11:52:57 +08:00
|
|
|
|
|
|
|
# Download/unzip images
|
2021-06-26 21:29:16 +08:00
|
|
|
d='../datasets/coco/images' # unzip directory
|
2020-10-13 21:58:03 +08:00
|
|
|
url=http://images.cocodataset.org/zips/
|
|
|
|
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
|
2021-02-07 14:13:39 +08:00
|
|
|
echo 'Downloading' $url$f '...'
|
2021-07-29 05:35:14 +08:00
|
|
|
curl -L $url$f -o $f && unzip -q $f -d $d && rm $f &
|
2020-10-13 21:58:03 +08:00
|
|
|
done
|
2021-01-25 10:01:58 +08:00
|
|
|
wait # finish background tasks
|