小小甜菜OpenVINO爬坑记 - oZhiZhuXia12的博客 - CSDN博客
- -小小甜菜OpenVINO爬坑记. OpenVINO是intel提供的一个深度学习优化工具,目前可以使用在win10,Ubuntu16.04两个平台上,官方已经宣布后期会支持树莓派系统. 它是Movidius x的使用接口,同时支持多种框架,也提供了大量例程. 我使用的是UP Squared板卡,运行Ubuntu16.04.
OpenVINO是intel提供的一个深度学习优化工具,目前可以使用在win10,Ubuntu16.04两个平台上,官方已经宣布后期会支持树莓派系统。它是Movidius x的使用接口,同时支持多种框架,也提供了大量例程。
我使用的是UP Squared板卡,运行Ubuntu16.04。
//要安装在ubuntu16.04上,ubuntu18.04依赖出错。R4版有一定BUG,但不影响使用
//解压缩l_openvino_toolkit_p_2018.4.420.tgz
cd l_openvino_toolkit_p_2018.4.420
sudo ./install_GUI.sh
cd /opt/intel/computer_vision_sdk/install_dependencies
sudo -E ./install_cv_sdk_dependencies.sh
sudo gedit ~/.bashrc
//最后添加:source /opt/intel/computer_vision_sdk/bin/setupvars.sh
source ~/.bashrc
cd /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/install_prerequisites
sudo ./install_prerequisites.sh
//运行dome
cd /opt/intel/computer_vision_sdk/deployment_tools/demo
./demo_squeezenet_download_convert_run.sh
./demo_security_barrier_camera.sh
//使用Movidius,在新终端下
sudo usermod -a -G users "$(whoami)"
cat <<EOF > 97-usbboot.rules
SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF
sudo cp 97-usbboot.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo ldconfig
rm 97-usbboot.rules
//使用GPU
cd /opt/intel/computer_vision_sdk/install_dependencies/
sudo -E su
./install_NEO_OCL_driver.sh
reboot
人脸检测
//ubuntu16.04+OpenVINO(R4)+USB摄像头
//该项目默认服务器与处理后台放在一起,和通过修改实现前后端分离。项目使用Node.js,后台使用C++构建mosquitto服务器。
sudo apt update
sudo apt install ffmpeg
sudo apt install libssl-dev
git clone https://github.com/17702513221/openVINO.git
cd /home/xs/openVINO/AI_work/face-access-control
mkdir -p build && cd build
cmake ..
make
//配置环境
sudo apt update
sudo apt install npm nodejs nodejs-dev nodejs-legacy
sudo apt install libzmq3-dev libkrb5-dev
sudo apt install sqlitebrowser
cd /home/xs/openVINO/AI_work/webservice/server
npm install
cd /home/xs/openVINO/AI_work/webservice/front-end
npm install
npm run dist
//运行程序
//1.启动Web服务,包括服务器和前端组件。
cd /home/xs/openVINO/AI_work/webservice/server/node-server
node ./server.js
cd /home/xs/openVINO/AI_work/webservice/front-end
npm run dev
//2.启动ffserver
cd /home/xs/openVINO/AI_work
sudo ffserver -f ./ffmpeg/server.conf
//4.启动cvservice和pipe到ffmpeg:(笔记本自带摄像头有BUG,我使用的是USB摄像头)
cd /home/xs/openVINO/AI_work/face-access-control/build
export MQTT_SERVER=localhost:1883
export MQTT_CLIENT_ID=cvservice
export FACE_DB=./defaultdb.xml
export FACE_IMAGES=../../webservice/server/node-server/public/profile/
./cvservice 0 2>/dev/null | ffmpeg -f rawvideo -pixel_format bgr24 -video_size vga -i - http://localhost:8090/fac.ffm
//5.浏览器打开
http://localhost:8080
//监控MQTT发送的数据
mosquitto_sub -t 'person/seen'
'commands/register' 'person/registered'
摄像头监控
//环境搭建在ubuntu16.04+OpenVINO(R3)
sudo apt update
sudo apt install ffmpeg
git clone https://github.com/17702513221/openVINO.git
//构建程序(测试版)
cd /home/xs/openVINO/reference_example/web_detector/application
source env.sh
mkdir -p build && cd build
cmake ..
make
//构建程序(web显示版)
cd /home/xs/openVINO/reference_example/web_detector/application
source env.sh
mkdir -p build && cd build
cmake ..
make CXX_DEFINES=-DUI_OUTPUT
//运行该应用程序
cd /home/xs/openVINO/reference_example/web_detector/build
//在CPU上运行
./web_detector -d CPU -m ../resources/ssd-cpu.xml -l ../resources/labels.txt
//在神经计算棒上运行
./web_detector -d MYRIAD -m ../resources/ssd-ncs.xml -l ../resources/labels.txt
//在浏览器上显示结果
google-chrome --user-data-dir=$HOME/.config/google-chrome/Web_detector --new-window --allow-file-access-from-files --allow-file-access --allow-cross-origin-auth-prompt index.html
//查询摄像头设备号
ls /dev/video*
//修改conf.txt测试摄像头或视频
/dev/video0 person
../resources/bus_station_6094_960x540.mp4 person
人员计数器
//安装依赖环境
sudo apt update
sudo apt install npm nodejs nodejs-dev nodejs-legacy
sudo apt install libzmq3-dev libkrb5-dev
sudo apt install libssl-dev
sudo apt-get install doxygen graphviz
git clone https://github.com/17702513221/openVINO.git
cd /home/xs/openVINO/reference_example/paho.mqtt.c
make
make html
sudo make install
sudo ldconfig
cd /home/xs/openVINO/reference_example/people-counter/ieservice
mkdir -p build && cd build
source /opt/intel/computer_vision_sdk/bin/setupvars.sh
cmake ..
make
cd /home/xs/openVINO/reference_example/people-counter/webservice/ui
npm install
cd /home/xs/openVINO/reference_example/people-counter/webservice/server
npm install
sudo apt install ffmpeg
//运行程序
cd /home/xs/openVINO/reference_example/people-counter/webservice/server/node-server
node ./server.js
cd /home/xs/openVINO/reference_example/people-counter/webservice/ui
npm run dev
cd /home/xs/openVINO/reference_example/people-counter
sudo ffserver -f ./ffmpeg/server.conf
cd /home/xs/openVINO/reference_example/people-counter/ieservice/bin/intel64/Release
wget https://raw.githubusercontent.com/nealvis/media/master/traffic_vid/bus_station_6094_960x540.mp4
export MQTT_SERVER=localhost:1884
export MQTT_CLIENT_ID=cvservice
./obj_recognition -i bus_station_6094_960x540.mp4 -m ssd-cpu.xml -l ssd-cpu.bin -d CPU -t SSD -thresh 0.7 0 2>/dev/null | ffmpeg -v warning -f rawvideo -pixel_format bgr24 -video_size 544x320 -i - http://localhost:8090/fac.ffm
//5.浏览器打开
http://localhost:8080
yolov3识别
//环境搭建ubuntu16.04+openVINO(R4)(自己根据之前的项目改写的,依赖还没统计,如果前面例子跑通,这个就能运行)
//先生成模型,默认下载官网权重转,实际项目可以使用darknet训练自己的权重
git clone https://github.com/17702513221/tensorflow_tools.git
cd tensorflow-yolo-v3
wget https://pjreddie.com/media/files/yolov3.weights
wget https://raw.githubusercontent.com/nealvis/media/master/traffic_vid/bus_station_6094_960x540.mp4
python3 demo.py --weights_file yolov3.weights --class_names coco.names --input_img Traffic.jpg --output_img out.jpg
cd /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer
sudo python3 mo_tf.py --input_model /home/xs/xs/tensorflow-yolo-v3/yolo_v3.pb --tensorflow_use_custom_operations_config extensions/front/tf/yolo_v3.json --input_shape=[1,416,416,3]
将生成的yolo_v3.xml和yolo_v3.bin复制到本文件夹下
cd /home/xs/inference_engine_samples/intel64/Release
//视频测试:
./object_detection_demo_yolov3_async -i /home/xs/tensorflow_tools/tensorflow-yolo-v3/bus_station_6094_960x540.mp4 -m /home/xs/tensorflow_tools/tensorflow-yolo-v3/yolo_v3.xml -d CPU
//摄像头测试:
./object_detection_demo_yolov3_async -i cam -m /home/xs/tensorflow_tools/tensorflow-yolo-v3/yolo_v3.xml -d CPU
//下载我的开源项目运行:
git clone https://github.com/17702513221/openVINO.git
cd AI_work/yolov3-cpp
./build.sh
//测试(需先用tensorflow-yolo-v3生成模型,测试默认CPU其它需求自行修改)
./start.sh
//监视发送到本地服务器的MQTT消息,发送的是labels的序号,如:person对应0(需先使用新终端开启本地服务器)
mosquitto_sub -t 'yolov3/results'
darknet教学
yolo算法笔记
yolov3参数理解
车牌识别1
车牌识别2
HyperLPR车牌识别
Cascade车牌检测器训练
openVINO使用Intel® System Studio编写教学
System Studio许可证下载
openpose介绍
下载解压缩后,使用注册邮件获取激活码安装
cd /home/xs/system_studio_2019_ultimate_edition_offline
sudo ./install.sh
//启动
source /opt/intel/system_studio_2019/iss_ide_eclipse-launcher.sh
sudo dpkg -i code_1.30.0-1544567151_amd64.deb
sudo apt-get install sqlitebrowser
sqlitebroswer test.db