Download all files from [Megaface Challenge](http://megaface.cs.washington.edu/)
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 | |
# 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