diff options
author | Kai Li <kaili_kloud@163.com> | 2014-03-17 14:33:13 +0800 |
---|---|---|
committer | Kai Li <kaili_kloud@163.com> | 2014-03-18 16:01:56 +0800 |
commit | 9b9eb7af01af5c8683d51f5383b2eed63953a778 (patch) | |
tree | d5b81613d068b49539e7340add0ec2c2d2f088e6 /models | |
parent | 974215d98285001565f3711f79453d091a9c52c3 (diff) | |
download | caffeonacl-9b9eb7af01af5c8683d51f5383b2eed63953a778.tar.gz caffeonacl-9b9eb7af01af5c8683d51f5383b2eed63953a778.tar.bz2 caffeonacl-9b9eb7af01af5c8683d51f5383b2eed63953a778.zip |
Avoid repeatedly downloading caffe reference imagenet model
Diffstat (limited to 'models')
-rwxr-xr-x | models/get_caffe_reference_imagenet_model.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/models/get_caffe_reference_imagenet_model.sh b/models/get_caffe_reference_imagenet_model.sh index af60cb6b..6c59472f 100755 --- a/models/get_caffe_reference_imagenet_model.sh +++ b/models/get_caffe_reference_imagenet_model.sh @@ -2,8 +2,22 @@ # This scripts downloads the caffe reference imagenet model # for ilsvrc image classification and deep feature extraction +MODEL=caffe_reference_imagenet_model +CHECKSUM=bf44bac4a59aa7792b296962fe483f2b + +if [ -f $MODEL ]; then + echo "Model already exists. Checking md5..." + checksum=`md5sum $MODEL | awk '{ print $1 }'` + if [ "$checksum" = "$CHECKSUM" ]; then + echo "Model checksum is correct. No need to download." + exit 0 + else + echo "Model checksum is incorrect. Need to download again." + fi +fi + echo "Downloading..." -wget -q https://www.dropbox.com/s/n3jups0gr7uj0dv/caffe_reference_imagenet_model +wget -q https://www.dropbox.com/s/n3jups0gr7uj0dv/$MODEL -echo "Done. Please check that the checksum = bf44bac4a59aa7792b296962fe483f2b." +echo "Done. Please check that the checksum = $CHECKSUM." |