Skip to content

Instantly share code, notes, and snippets.

@moodoki
Last active July 6, 2023 09:58
Show Gist options
  • Save moodoki/8a46cc15e6b92f3208ddd4813e777e30 to your computer and use it in GitHub Desktop.
Save moodoki/8a46cc15e6b92f3208ddd4813e777e30 to your computer and use it in GitHub Desktop.
Segment Anything SA-1B Dataset Download script
#!/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