forked from BVLC/caffe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[model zoo] download from gist grooming
- invoke by shell - default download dir to models/ - save to flat dir of owner-gist instead of nested owner/gist
- Loading branch information
Showing
1 changed file
with
17 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
echo "usage: download_model_from_gist.sh <gist_id> <dirname>" | ||
#!/usr/bin/env sh | ||
|
||
GIST=$1 | ||
DIRNAME=$2 | ||
DIRNAME=${2:-./models} | ||
|
||
if [ -d "$DIRNAME/$GIST" ]; then | ||
echo "$DIRNAME/$GIST already exists! Please make sure you're not overwriting anything important!" | ||
if [ -z $GIST ]; then | ||
echo "usage: download_model_from_gist.sh <gist_id> <dirname>" | ||
exit | ||
fi | ||
|
||
GIST_DIR=$(echo $GIST | tr '/' '-') | ||
MODEL_DIR="$DIRNAME/$GIST_DIR" | ||
|
||
if [ -d $MODEL_DIR ]; then | ||
echo "$MODEL_DIR 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 "Downloading Caffe model info to $MODEL_DIR ..." | ||
mkdir -p $MODEL_DIR | ||
wget https://gist.github.com/$GIST/download -O $MODEL_DIR/gist.tar.gz | ||
tar xzf $MODEL_DIR/gist.tar.gz --directory=$MODEL_DIR --strip-components=1 | ||
rm $MODEL_DIR/gist.tar.gz | ||
echo "Done" |