get_coco.sh 820 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # COCO 2017 dataset http://cocodataset.org
  3. # Download command: bash ./scripts/get_coco.sh
  4. # Download/unzip labels
  5. d='./' # unzip directory
  6. url=https://github.com/ultralytics/yolov5/releases/download/v1.0/
  7. f='coco2017labels-segments.zip' # or 'coco2017labels.zip', 68 MB
  8. echo 'Downloading' $url$f ' ...'
  9. curl -L $url$f -o $f && unzip -q $f -d $d && rm $f & # download, unzip, remove in background
  10. # Download/unzip images
  11. d='./coco/images' # unzip directory
  12. url=http://images.cocodataset.org/zips/
  13. f1='train2017.zip' # 19G, 118k images
  14. f2='val2017.zip' # 1G, 5k images
  15. f3='test2017.zip' # 7G, 41k images (optional)
  16. for f in $f1 $f2 $f3; do
  17. echo 'Downloading' $url$f '...'
  18. curl -L $url$f -o $f && unzip -q $f -d $d && rm $f & # download, unzip, remove in background
  19. done
  20. wait # finish background tasks