Difference between revisions of "TB3 Movidius Applications"
(→Fix) |
(→Fix) |
||
Line 47: | Line 47: | ||
$ sudo mv cv2.so cv2_rename.so | $ sudo mv cv2.so cv2_rename.so | ||
[sudo] password for eepp: | [sudo] password for eepp: | ||
+ | |||
+ | == Finish Build == | ||
+ | |||
+ | $ make run | ||
+ | ... | ||
+ | mvNCCompile -w gender_net.caffemodel -s 12 deploy.prototxt | ||
+ | mvNCCompile v02.00, Copyright @ Movidius Ltd 2016 | ||
+ | |||
+ | /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance | ||
+ | "Consider reducing your data sizes for best performance\033[0m") | ||
+ | make[1]: Leaving directory '/home/eepp/workspace/ncappzoo/caffe/GenderNet' | ||
+ | |||
+ | making AgeNet | ||
+ | (cd ../../caffe/AgeNet; make compile;) | ||
+ | make[1]: Entering directory '/home/eepp/workspace/ncappzoo/caffe/AgeNet' | ||
+ | make[2]: Entering directory '/home/eepp/workspace/ncappzoo/data/age_gender' | ||
+ | make[2]: Leaving directory '/home/eepp/workspace/ncappzoo/data/age_gender' | ||
+ | test -f deploy.prototxt || (wget -P . https://raw.githubusercontent.com/GilLevi/AgeGenderDeepLearning/master/age_net_definitions/deploy.prototxt; awk 'NR <2 {print}' < deploy.prototxt > temp; cat input_shape.prototxt >> temp; awk 'NR > 6 {print}' < deploy.prototxt >> temp; mv temp deploy.prototxt) | ||
+ | test -f age_net.caffemodel || wget -P . -N https://github.com/GilLevi/AgeGenderDeepLearning/raw/master/models/age_net.caffemodel | ||
+ | mvNCCompile -w age_net.caffemodel -s 12 deploy.prototxt | ||
+ | mvNCCompile v02.00, Copyright @ Movidius Ltd 2016 | ||
+ | |||
+ | /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance | ||
+ | "Consider reducing your data sizes for best performance\033[0m") | ||
+ | make[1]: Leaving directory '/home/eepp/workspace/ncappzoo/caffe/AgeNet' | ||
+ | |||
+ | Running live-image-classifier.py | ||
+ | python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt | ||
+ | I am 48.8% confidant you are 48-53 years ( 46.69 ms ) | ||
+ | I am 48.0% confidant you are 8-12 years ( 42.57 ms ) | ||
+ | I am 54.2% confidant you are 48-53 years ( 42.45 ms ) | ||
+ | I am 51.6% confidant you are 48-53 years ( 42.59 ms ) | ||
+ | I am 54.3% confidant you are 8-12 years ( 41.93 ms ) | ||
+ | I am 48.1% confidant you are 8-12 years ( 42.05 ms ) | ||
+ | I am 71.2% confidant you are 8-12 years ( 42.00 ms ) | ||
+ | I am 69.7% confidant you are 8-12 years ( 42.02 ms ) | ||
+ | I am 64.3% confidant you are 8-12 years ( 42.37 ms ) | ||
+ | I am 50.9% confidant you are 8-12 years ( 42.73 ms ) | ||
+ | I am 65.6% confidant you are 8-12 years ( 41.91 ms ) | ||
+ | I am 71.0% confidant you are 8-12 years ( 42.36 ms ) | ||
+ | I am 66.3% confidant you are 8-12 years ( 42.26 ms ) | ||
= Log Image Classifier = | = Log Image Classifier = |
Revision as of 13:36, 29 May 2018
Contents
Reference
Install App Zoo
$ cd ~/workspace/ $ git clone https://github.com/movidius/ncappzoo
Live Image Classifier
Build
$ cd ~/workspace/ncappzoo/apps/live-image-classifier/ $ make run ... age_net.caffemodel 100%[===================>] 43.55M 6.02MB/s in 7.3s Last-modified header missing -- time-stamps turned off. 2018-05-29 13:16:32 (5.99 MB/s) - ‘./age_net.caffemodel’ saved [45661480/45661480] mvNCCompile -w age_net.caffemodel -s 12 deploy.prototxt mvNCCompile v02.00, Copyright @ Movidius Ltd 2016 /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance "Consider reducing your data sizes for best performance\033[0m") make[1]: Leaving directory '/home/eepp/workspace/ncappzoo/caffe/AgeNet' Running live-image-classifier.py python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt Traceback (most recent call last): File "live-image-classifier.py", line 12, in <module> import cv2 ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type Makefile:41: recipe for target 'run' failed make: *** [run] Error 1
Fix
Import Error ROS python3 opencv. ROS creates its own open cv which is compatible with python2 only. I do the following.I followed zishan’s instructions
$ pwd /opt/ros/kinetic/lib/python2.7/dist-packages $ sudo mv cv2.so cv2_rename.so [sudo] password for eepp:
Finish Build
$ make run ... mvNCCompile -w gender_net.caffemodel -s 12 deploy.prototxt mvNCCompile v02.00, Copyright @ Movidius Ltd 2016
/usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
"Consider reducing your data sizes for best performance\033[0m")
make[1]: Leaving directory '/home/eepp/workspace/ncappzoo/caffe/GenderNet'
making AgeNet (cd ../../caffe/AgeNet; make compile;) make[1]: Entering directory '/home/eepp/workspace/ncappzoo/caffe/AgeNet' make[2]: Entering directory '/home/eepp/workspace/ncappzoo/data/age_gender' make[2]: Leaving directory '/home/eepp/workspace/ncappzoo/data/age_gender' test -f deploy.prototxt || (wget -P . https://raw.githubusercontent.com/GilLevi/AgeGenderDeepLearning/master/age_net_definitions/deploy.prototxt; awk 'NR <2 {print}' < deploy.prototxt > temp; cat input_shape.prototxt >> temp; awk 'NR > 6 {print}' < deploy.prototxt >> temp; mv temp deploy.prototxt) test -f age_net.caffemodel || wget -P . -N https://github.com/GilLevi/AgeGenderDeepLearning/raw/master/models/age_net.caffemodel mvNCCompile -w age_net.caffemodel -s 12 deploy.prototxt mvNCCompile v02.00, Copyright @ Movidius Ltd 2016
/usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
"Consider reducing your data sizes for best performance\033[0m")
make[1]: Leaving directory '/home/eepp/workspace/ncappzoo/caffe/AgeNet'
Running live-image-classifier.py python3 live-image-classifier.py --graph ../../caffe/AgeNet/graph --labels ../../data/age_gender/age_categories.txt I am 48.8% confidant you are 48-53 years ( 46.69 ms ) I am 48.0% confidant you are 8-12 years ( 42.57 ms ) I am 54.2% confidant you are 48-53 years ( 42.45 ms ) I am 51.6% confidant you are 48-53 years ( 42.59 ms ) I am 54.3% confidant you are 8-12 years ( 41.93 ms ) I am 48.1% confidant you are 8-12 years ( 42.05 ms ) I am 71.2% confidant you are 8-12 years ( 42.00 ms ) I am 69.7% confidant you are 8-12 years ( 42.02 ms ) I am 64.3% confidant you are 8-12 years ( 42.37 ms ) I am 50.9% confidant you are 8-12 years ( 42.73 ms ) I am 65.6% confidant you are 8-12 years ( 41.91 ms ) I am 71.0% confidant you are 8-12 years ( 42.36 ms ) I am 66.3% confidant you are 8-12 years ( 42.26 ms )
Log Image Classifier
$ cd ~/workspace/ncappzoo/apps/log-image-classifier/ $ make run ... making compile mvNCCompile -w bvlc_alexnet.caffemodel -s 12 deploy.prototxt mvNCCompile v02.00, Copyright @ Movidius Ltd 2016 /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance "Consider reducing your data sizes for best performance\033[0m") make[1]: Leaving directory '/home/eepp/workspace/ncappzoo/caffe/AlexNet' Running log-image-classifier.py python3 log-image-classifier.py Pre-processing images... /usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15. warn("The default mode, 'constant', will be changed to 'reflect' in " Performing inference on a lot of images... Inference complete! View results in ./inferences.csv.