微软人脸特征检测
操作步骤
- 申请免费的微软认知/人脸服务key
- 微软人脸特征检测配置解说
- 使用vlc配置一个抓屏摄像头(同上一个视频)
- 效果实验
参考
- 微软人脸云服务
https://azure.microsoft.com/zh-cn/services/cognitive-services/face/
- HA中微软人脸探测配置说明文档
https://www.home-assistant.io/integrations/microsoft_face_detect
-
微软人脸探测配置样例(
example_9_4_1.yaml
)example_9_4_1.yaml
microsoft_face: api_key: xxxxxxxxxxxxxx azure_region: westcentralus
image_processing: - platform: microsoft_face_detect scan_interval: 1000000 source: - entity_id: camera.cam_input name: ms_face_feature attributes: - age - gender - glasses
script: ms_face_detect: alias: 微软人脸特征识别 sequence: - service: image_processing.scan data: entity_id: image_processing.ms_face_feature
automation: - alias: Somebody appearing trigger: platform: event event_type: image_processing.detect_face event_data: entity_id: image_processing.ms_face_feature action: service: tts.google_translate_say entity_id: "all" data_template: message: > {% if trigger.event.data.glasses=="ReadingGlasses" %} {% set message = '眼镜' %} {% if trigger.event.data.gender=="male" %} {% set message=message+'男' %} {% else %} {% set message=message+'女' %} {% endif %} {% else %} {% if trigger.event.data.gender=="male" %} {% set message='男人' %} {% else %} {% set message='女人' %} {% endif %} {% endif %} 发现一个{{ message }},大概{{ trigger.event.data.age|int }}岁。
-
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