From 08d7f8c6398cd9103cceb128aff8e3e7e3fd94cb Mon Sep 17 00:00:00 2001 From: Sergey Karayev Date: Thu, 18 Sep 2014 16:11:07 -0700 Subject: [PATCH] [model zoo] download gist script --- docs/model_zoo.md | 2 +- scripts/download_model_from_gist.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 scripts/download_model_from_gist.sh diff --git a/docs/model_zoo.md b/docs/model_zoo.md index 5603c62..330850c 100644 --- a/docs/model_zoo.md +++ b/docs/model_zoo.md @@ -43,7 +43,7 @@ Github Gist is a good format for model info distribution because it can contain Try doing `scripts/upload_model_to_gist.sh models/bvlc_alexnet` to test the uploading (don't forget to delete the uploaded gist afterward). -Downloading models is not yet supported as a script (there is no good commandline tool for this right now), so simply go to the Gist URL and click "Download Gist" for now. +Downloading model info is done just as easily with `scripts/download_model_from_gist.sh `. ### Hosting trained models diff --git a/scripts/download_model_from_gist.sh b/scripts/download_model_from_gist.sh new file mode 100755 index 0000000..61d995f --- /dev/null +++ b/scripts/download_model_from_gist.sh @@ -0,0 +1,16 @@ +echo "usage: download_model_from_gist.sh " + +GIST=$1 +DIRNAME=$2 + +if [ -d "$DIRNAME/$GIST" ]; then + echo "$DIRNAME/$GIST already exists! Please make sure you're not overwriting anything important!" + exit +fi + +echo "Downloading Caffe model info to $DIRNAME/$GIST ..." +mkdir -p $DIRNAME/$GIST +wget https://gist.github.com/$GIST/download -O $DIRNAME/$GIST/gist.tar.gz +tar xzf $DIRNAME/$GIST/gist.tar.gz --directory=$DIRNAME/$GIST --strip-components=1 +rm $DIRNAME/$GIST/gist.tar.gz +echo "Done" -- 2.7.4