跳转至

本地DLib人脸识别

操作步骤

  1. 使用vlc配置一个抓屏摄像头(同上一个视频)
  2. 上传人物标准照片
  3. DLib人脸识别配置解说
  4. 使用packages方式配置
  5. 演示人脸识别,观察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

  • DLib人脸识别配置说明文档

https://www.home-assistant.io/integrations/dlib_face_identify

  • DLib人脸识别配置(example_9_3_1.yaml

```yaml # example_9_3_1.yaml image_processing: - platform: dlib_face_identify scan_interval: 1000000 source: - entity_id: camera.cam_input name: face_id faces: Trump: /home/pi/Pictures/trump.jpg Obama: /home/pi/Pictures/obama.jpg Clinton: /home/pi/Pictures/clinton.jpg script: dlib_face_identify: alias: 人脸识别 sequence: - service: image_processing.scan data: entity_id: image_processing.face_id # - 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

automation: - alias: Clinton coming trigger: platform: event event_type: image_processing.detect_face event_data: entity_id: image_processing.face_id name: 'Clinton' action: service: persistent_notification.create data: title: '发现认识的人' message: '克林顿出现在屏幕上' - alias: Obama coming trigger: platform: event event_type: image_processing.detect_face event_data: entity_id: image_processing.face_id name: 'Obama' action: service: persistent_notification.create data: title: '发现认识的人' message: '奥巴马出现在屏幕上' - alias: Trump coming trigger: platform: event event_type: image_processing.detect_face event_data: entity_id: image_processing.face_id name: 'Trump' action: service: persistent_notification.create data: title: '发现认识的人' message: '川普出现在屏幕上' ```

返回课程目录↩