Skip to content

Instantly share code, notes, and snippets.

@SeanSyue
Last active November 24, 2020 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanSyue/16191984b63d8786d91f2185ab0f1153 to your computer and use it in GitHub Desktop.
Save SeanSyue/16191984b63d8786d91f2185ab0f1153 to your computer and use it in GitHub Desktop.
Download all files from [Megaface Challenge](http://megaface.cs.washington.edu/)
#! /bin/bash
# Specify the destination of donwloaded files
DESTINATION="megaface_downloads"
# You may get the credential by following the instructions in
# `http://megaface.cs.washington.edu/participate/challenge.html`
# Follow the below format for the credential file:
# ```
# machine megaface.cs.washington.edu
# login <your-login-name>
# password <your-login-password>
# ```
# Reference for credential file: `https://ec.haxx.se/usingcurl-netrc.html`
CREDENTIAL="credential.txt"
# Directories for storing different dataset
FACESCRUB="Facescrub"
FGNET2="FGNET2"
CHALLENGE_1="Challege_1"
CHALLENGE_2="Challege_2"
# Construct arr for file-directory mapping
declare -A arr
arr+=(["devkit.zip"]="." \
["MegaFace_Features.zip"]="." \
["FaceScrub_LBPFeatures.zip"]="." \
["facescrub_actors.txt"]=$FACESCRUB \
["facescrub_actresses.txt"]=$FACESCRUB \
["test_cropped.zip"]=$FACESCRUB \
["downloaded.tgz"]=$FACESCRUB \
["FGNET2.tar.gz"]=$FGNET2 \
["MegaFace_dataset.zip"]=$CHALLENGE_1 \
["identities_tight_cropped.tar.gz"]=$CHALLENGE_2 \
["identities_meta.tar.gz"]=$CHALLENGE_2 \
["Megaface_Challenge_1M_disjoint.tar.gz"]=$CHALLENGE_2 \
["Megaface_Challenge_1M_disjoint_LOOSE.tar.gz"]=$CHALLENGE_2)
for i in {0..13}; do
arr+=(["identities_$i.tar.gz"]=$CHALLENGE_2)
done
# Download files and store them in proper directory
for file in ${!arr[@]}; do
echo "Fetching $file ... "
mkdir -p $DESTINATION/${arr[${file}]} && \
curl -s --netrc-file $CREDENTIAL http://megaface.cs.washington.edu/dataset/download/content/$file \
-o $DESTINATION/${arr[${file}]}/$file && \
echo "== $file downloading finished! ==" &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment