跳转至

Facebox-在docker中运行人脸识别

操作步骤

  1. 安装docker
  2. 获得MB_KEY
  3. 启动machinebox/facebox
  4. 在facebox的web界面中传入标准照并进行识别操作
  5. 在HA中配置与使用facebox

参考

  • Linux下docker的安装

curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

  • Windows下docker的安装

https://docs.docker.com/docker-for-windows/install/

  • facebox网站

https://machinebox.io/docs/facebox

  • MB_KEY获得

https://machinebox.io/account

  • docker运行facebox

docker run -d --name=facebox --restart=always -p 9999:8080 -e "MB_KEY=$MB_KEY" machinebox/facebox

  • 测试照片URL

https://a57.foxnews.com/static.foxnews.com/foxnews.com/content/uploads/2018/09/1862/1048/billhillaryclintonreut.jpg?ve=1&tl=1

  • HA中facebox配置样例(example_9_6_1.yaml

```yaml # example_9_6_1.yaml image_processing: - platform: facebox scan_interval: 1000000 ip_address: 192.168.3.156 port: 9999 confidence: 10 source: - entity_id: camera.cam_input name: facebox_identify

script: ms_face_identify_script: alias: facebox人脸识别 sequence: - service: image_processing.scan data: entity_id: image_processing.facebox_identify

automation: - alias: Clinton Identify trigger: platform: event event_type: image_processing.detect_face event_data: entity_id: image_processing.facebox_identify name: 'Clinton' action: service: persistent_notification.create data_template: title: '人脸认证' message: '克林顿出现在摄像头中,可信度{{ trigger.event.data.confidence }}%' ```

返回课程目录↩