greenhouse/data/get_coco2017.sh

26 lines
825 B
Bash
Raw Normal View History

2019-12-13 17:31:27 -08:00
#!/bin/bash
# Zip coco folder
# zip -r coco.zip coco
# tar -czvf coco.tar.gz coco
# Download labels from Google Drive, accepting presented query
filename="coco2017labels.zip"
fileid="1cXZR_ckHki6nddOmcysCuuJFM--T-Q6L"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
2019-12-13 17:34:19 -08:00
rm ./cookie
2019-12-13 17:31:27 -08:00
# Unzip labels
unzip -q ${filename} # for coco.zip
# tar -xzf ${filename} # for coco.tar.gz
2019-12-13 17:46:42 -08:00
rm ${filename}
2019-12-13 17:31:27 -08:00
2019-12-21 19:23:50 -08:00
# Download and unzip images
2019-12-13 17:31:27 -08:00
cd coco/images
2019-12-21 19:23:50 -08:00
f="train2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $f
f="val2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $f
2019-12-13 17:31:27 -08:00
# cd out
cd ../..