File: install-caffe2-models.sh

package info (click to toggle)
berrynet 3.10.2-2
  • links: PTS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,572 kB
  • sloc: python: 6,286; javascript: 2,373; xml: 1,094; sh: 738; makefile: 33
file content (42 lines) | stat: -rwxr-xr-x 1,282 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

# Main dependencies

sudo apt-get update
#sudo apt-get install -y git-lfs

# Download models
#
# FIXME: caffe2.python.models.download can not download correct
#   squeezenet model files currently.
#
#   It will download {init_net.pb, predict_net.pb}, but the latest
#   squeezenet model files on Caffe2 model repo are
#   {exec_net.pb, predict_net.pb}.
#
#   These two predict_net.pb are also different.
#
# Caffe2 model repo: https://github.com/caffe2/models/tree/master/squeezenet

CAFFE2_MODEL_DIR="/caffe2/caffe2/python/models"

#TMPDIR1=`mktemp -d`
#cd /caffe2/build
#sudo python -m caffe2.python.models.download squeezenet
#sudo mkdir -p "$TMPDIR1"/models
#sudo mv -f squeezenet "$TMPDIR1"/models
#cd "$TMPDIR1"
#git lfs clone https://github.com/caffe2/models.git


# Install models
#
# FIXME: git-lfs is unavailable on Raspbian.

sudo mkdir -p $CAFFE2_MODEL_DIR/squeezenet
sudo wget -O $CAFFE2_MODEL_DIR/squeezenet/exec_net.pb \
    https://github.com/caffe2/models/raw/master/squeezenet/exec_net.pb
sudo wget -O $CAFFE2_MODEL_DIR/squeezenet/predict_net.pb \
    https://github.com/caffe2/models/raw/master/squeezenet/predict_net.pb
#sudo cp -f models/squeezenet/*.pb /caffe2/caffe2/python/models
#sudo cp -f models/bvlc_alexnet/*.npy /caffe2/caffe2/python/models