Skip to content

Commit

Permalink
Merge pull request BVLC#1110 from sergeyk/dev
Browse files Browse the repository at this point in the history
  [model zoo] download gist script
  • Loading branch information
shelhamer committed Sep 18, 2014
2 parents 8008533 + 08d7f8c commit 58dce0e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/model_zoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <gist_id> <dirname>`.

### Hosting trained models

Expand Down
16 changes: 16 additions & 0 deletions scripts/download_model_from_gist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
echo "usage: download_model_from_gist.sh <gist_id> <dirname>"

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"

0 comments on commit 58dce0e

Please sign in to comment.