Last active
September 23, 2021 06:17
-
-
Save ShixiangWang/acbbe20adf2059496d2d315407fde659 to your computer and use it in GitHub Desktop.
download-images-from-block-site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# identify and remove broke images | |
# with imageMagick | |
for i in $(ls -d train/cat/* train/fish/* val/cat/* val/fish/* test/cat/* test/fish/*); do | |
identify $i > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "file $i is broken, removing it" | |
rm $i | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://github.com/Dreamacro/clash/issues/592 | |
export ALL_PROXY=socks5://127.0.0.1:7891 | |
#loon batch -f images.csv 'curl -k -o {2}/{1}/"$(basename {0})" -C - {0}' | |
loon batch -f images.csv 'out={2}/{1}/"$(basename {0})"; echo processing $out; if ! [ -f $out ]; then curl -k -o $out -C - {0}; fi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url | class | type | |
---|---|---|---|
https://farm2.static.flickr.com/1245/1259825348_6a2aa94e8d.jpg | cat | train | |
https://farm2.static.flickr.com/1080/1029412358_7ee17550fc.jpg | cat | train | |
https://farm1.static.flickr.com/196/443645811_8c4bb1af50.jpg | cat | train | |
https://farm2.static.flickr.com/1201/1285591549_593ca7cf6a.jpg | cat | train | |
https://farm3.static.flickr.com/2002/1760479467_068432dd3f.jpg | cat | train | |
https://farm2.static.flickr.com/1411/649938210_e9dcbde5ea.jpg | cat | train | |
https://farm2.static.flickr.com/1423/918775832_9ecfd414b8.jpg | cat | train |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment