本地DLib人脸探测
操作步骤
- 使用vlc配置一个抓屏摄像头
- Dlib人脸探测配置解说
- 使用packages方式保存配置文件
- 配置
whitelist_external_dirs
- 演示人脸探测,观察CPU状态
参考
- VLC http mjpeg输出配置
:sout=#transcode{vcodec=MJPG,vb=800,scale=自动,acodec=none,scodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/} :no-sout-all :sout-keep
注:最新版的vlc,可能会将8888仅监听到ipv6上;可以修改为:dst=x.x.x.x:8888/
其中,x.x.x.x
是你的pc的ip地址
- DLib人脸探测配置说明文档
https://www.home-assistant.io/integrations/dlib_face_detect
- DLib人脸探测配置(example_9_2_1.yaml)
yaml
# example_9_2_1.yaml
image_processing:
- platform: dlib_face_detect
scan_interval: 1000000
source:
- entity_id: camera.cam_input
name: face
script:
dlib_face_detect:
alias: 人脸探测并保存图片
sequence:
- service: image_processing.scan
data:
entity_id: image_processing.face
- service: camera.snapshot
data:
entity_id: camera.cam_input
filename: '/home/pi/Pictures/face.jpg'
camera:
- platform: local_file
name: image_to_be_processed
file_path: /home/pi/Pictures/face.jpg