Last active
July 6, 2023 09:58
-
-
Save moodoki/8a46cc15e6b92f3208ddd4813e777e30 to your computer and use it in GitHub Desktop.
Segment Anything SA-1B Dataset Download script
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
#!/bin/bash | |
count=0 | |
if [ $# -ne 2 ]; then | |
>&2 echo "Usage: $0 <input_file> <output_dir>" | |
>&2 echo "This script downloads all the tar files listed in the text file from https://ai.facebook.com/datasets/segment-anything-downloads/" | |
>&2 echo "To use this, accept the terms there, download the text file and run this script with it" | |
exit 1 | |
fi | |
mkdir -p $2 | |
cat $1 | while IFS= read -r line | |
do | |
read -ra arr <<<"$line" | |
if [[ ${arr[1]} == https* ]] | |
then | |
wget -c ${arr[1]} -O $2/${arr[0]} | |
else | |
echo "Not a link ${arr[1]} ${arr[0]}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment