(USB的确实没官方MIPI的方便好用…)
1、MDT连接开发板
mdt shell
查看USB摄像头参数:
sudo v4l2-ctl --list-formats-ext --device /dev/video1
提示如下界面,后面还有,不用管,仔细看好各个分辨率支持的fps
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)
2、下载Edge TPU API识别demo数据库
export DEMO_FILES="$HOME/demo_files"
wget -P ${DEMO_FILES}/ https://dl.google.com/coral/canned_models/mobilenet_v2_1.0_224_quant_edgetpu.tflite
wget -P ${DEMO_FILES}/ https://dl.google.com/coral/canned_models/imagenet_labels.txt
wget -P ${DEMO_FILES}/ https://dl.google.com/coral/canned_models/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite
3、HDMI显示器查看识别界面
注意红色部分要对应fps,按键盘Q退出识别,或者关闭操作机终端也可退出识别
物体识别:
edgetpu_classify
--source /dev/video1:YUY2:800x600:24/1
--model ${DEMO_FILES}/mobilenet_v2_1.0_224_quant_edgetpu.tflite
--labels ${DEMO_FILES}/imagenet_labels.txt
人脸识别:
edgetpu_detect
--source /dev/video1:YUY2:800x600:24/1
--model ${DEMO_FILES}/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite
4、浏览器查看识别界面,开发板的IP:4664
物体识别:
edgetpu_classify_server
--source /dev/video1:YUY2:800x600:24/1
--model ${DEMO_FILES}/mobilenet_v2_1.0_224_quant_edgetpu.tflite
--labels ${DEMO_FILES}/imagenet_labels.txt
人脸识别:
edgetpu_detect_server
--source /dev/video1:YUY2:800x600:24/1
--model ${DEMO_FILES}/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite
5、注意事项
5.1下次打开demo,要提前设置API目录
export DEMO_FILES="$HOME/demo_files"
5.2分辨率和fps一定要对应
比如我的罗技摄像头800*600分辨率就没有24fps,官方文档输入就报错打不开,粗心大意没仔细看英文文档…
5.3不要拔电关机,在MDT用命令行关机
sudo shutdown now
原创文章,作者:ERROR204,本文章内容未经书面许可禁止一切形式的转载:https://imnks.com/133.html