Skip to content

Commit 58dce0e

Browse files
committed
Merge pull request #1110 from sergeyk/dev
[model zoo] download gist script
2 parents 8008533 + 08d7f8c commit 58dce0e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

docs/model_zoo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Github Gist is a good format for model info distribution because it can contain
4343

4444
Try doing `scripts/upload_model_to_gist.sh models/bvlc_alexnet` to test the uploading (don't forget to delete the uploaded gist afterward).
4545

46-
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.
46+
Downloading model info is done just as easily with `scripts/download_model_from_gist.sh <gist_id> <dirname>`.
4747

4848
### Hosting trained models
4949

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
echo "usage: download_model_from_gist.sh <gist_id> <dirname>"
2+
3+
GIST=$1
4+
DIRNAME=$2
5+
6+
if [ -d "$DIRNAME/$GIST" ]; then
7+
echo "$DIRNAME/$GIST already exists! Please make sure you're not overwriting anything important!"
8+
exit
9+
fi
10+
11+
echo "Downloading Caffe model info to $DIRNAME/$GIST ..."
12+
mkdir -p $DIRNAME/$GIST
13+
wget https://gist.github.com/$GIST/download -O $DIRNAME/$GIST/gist.tar.gz
14+
tar xzf $DIRNAME/$GIST/gist.tar.gz --directory=$DIRNAME/$GIST --strip-components=1
15+
rm $DIRNAME/$GIST/gist.tar.gz
16+
echo "Done"

0 commit comments

Comments
 (0)