2 ifneq ($(findstring movidius, $(PYTHONPATH)), movidius)
3 export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH)
6 NCCOMPILE = mvNCCompile
7 NCPROFILE = mvNCProfile
11 PROTOTXT_FILENAME= deploy.prototxt
12 GET_PROTOTXT = wget -P . https://github.com/DeepScale/SqueezeNet/raw/master/SqueezeNet_v1.0/${PROTOTXT_FILENAME}
14 CAFFEMODEL_FILENAME = squeezenet_v1.0.caffemodel
15 GET_CAFFEMODEL = wget -P . -N https://github.com/DeepScale/SqueezeNet/raw/master/SqueezeNet_v1.0/${CAFFEMODEL_FILENAME}
19 all: profile check compile cpp
23 @echo "\nmaking prereqs"
24 (cd ../../data/ilsvrc12; make)
25 @sed -i 's/\r//' run.py
27 @if [ -e LICENSE.squeezenet ] ; \
29 echo "LICENSE file already exists"; \
31 echo "Downloading LICENSE file"; \
32 wget -P . -N https://github.com/DeepScale/SqueezeNet/raw/master/LICENSE; mv LICENSE LICENSE.squeezenet; \
38 @echo "\nmaking prototxt"
39 @if [ -e ${PROTOTXT_FILENAME} ] ; \
41 echo "Prototxt file already exists"; \
43 echo "Downloading Prototxt file"; \
45 if [ -e ${PROTOTXT_FILENAME} ] ; \
47 echo "modifying prototxt file."; \
48 sed -i '11s/10/1/' ${PROTOTXT_FILENAME}; sed -i '530s/pad/#pad/' ${PROTOTXT_FILENAME}; \
50 echo "***\nError - Could not download prototxt file. Check network and proxy settings \n***\n"; \
57 @echo "\nmaking caffemodel"
58 @if [ -e ${CAFFEMODEL_FILENAME} ] ; \
60 echo "caffemodel file already exists"; \
62 echo "Downloading caffemodel file"; \
64 if ! [ -e ${CAFFEMODEL_FILENAME} ] ; \
66 echo "***\nError - Could not download caffemodel file. Check network and proxy settings \n***\n"; \
73 @echo "\nmaking profile"
74 ${NCPROFILE} ${PROTOTXT_FILENAME} -s 12
76 .PHONY: browse_profile
77 browse_profile: profile
78 @echo "\nmaking browse_profile"
79 @if [ -e output_report.html ] ; \
81 firefox output_report.html & \
83 @echo "***\nError - output_report.html not found" ; \
87 compile: prototxt caffemodel
88 @echo "\nmaking compile"
89 ${NCCOMPILE} -w ${CAFFEMODEL_FILENAME} -s 12 ${PROTOTXT_FILENAME}
92 check: prototxt caffemodel
93 @echo "\nmaking check"
94 #-${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M ../../data/ilsvrc12/ilsvrc_2012_mean.npy
95 ${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M 120 -metric top1
104 @echo "\nmaking run_py"
108 cpp: cpp/run.cpp cpp/fp16.c
110 g++ cpp/run.cpp cpp/fp16.c -o cpp/run_cpp -lmvnc
114 @echo "\nmaking run_cpp"
115 cd cpp; ./run_cpp; cd ..
119 @echo "possible make targets: ";
120 @echo " make help - shows this message";
121 @echo " make all - makes the following: prototxt, profile, compile, check, cpp, run_py, run_cpp";
122 @echo " make prototxt - downloads and adds input shape to Caffe prototxt file";
123 @echo " make caffemodel - downloads the caffemodel for the network"
124 @echo " make compile - runs SDK compiler tool to compile the NCS graph file for the network";
125 @echo " make check - runs SDK checker tool to verify an NCS graph file";
126 @echo " make profile - runs the SDK profiler tool to profile the network creating output_report.html";
127 @echo " make browse_profile - runs the SDK profiler tool and brings up report in browser.";
128 @echo " make cpp - builds the run_cpp executable example";
129 @echo " make run_cpp - runs the run_cpp executable example program";
130 @echo " make run_py - runs the run.py python example program";
131 @echo " make clean - removes all created content"
134 @echo "\nmaking clean_caffe_model"
135 rm -f ${PROTOTXT_FILENAME}
136 rm -f ${CAFFEMODEL_FILENAME}
138 clean: clean_caffe_model
139 @echo "\nmaking clean"
143 rm -f output_report.html
144 rm -f output_expected.npy
145 rm -f zero_weights.caffemodel
146 rm -f output_result.npy
149 rm -f LICENSE.squeezenet