lidicn 发表于 2018-1-20 13:09:07

人脸识别自动化【多人识别】【模版For循环】

本帖最后由 lidicn 于 2018-1-20 15:15 编辑

识别一个人并TTS名字【userinfo】
automation:
- alias: face_indentify
    trigger:
      platform: numeric_state
      entity_id: image_processing.dlib_face_identify
      above: 0

    action:
      - service: tts.baidu_say
      data_template:
          message: >
            {% if states.image_processing.dlib_face_identify.attributes.faces %}
            {{ states.image_processing.dlib_face_identify.attributes.faces['name'] }} ,是你呀!
            {% else %}
            你好,陌生人!
            {% endif %}

判断有几个人,多个人的话以执行for循环读取faces列表里面的name字段
**** Hidden Message *****

luzai 发表于 2018-1-20 13:13:03

骚年你最棒

CCYRUS 发表于 2018-1-20 13:36:57

学习一下

windgo 发表于 2018-1-20 13:42:37

感謝L大分享!

alex950418 发表于 2018-1-20 13:54:10

挺实际的用法

edisonyc911 发表于 2018-1-20 14:12:04

楼主 借鉴的要注明出处: https://www.hachina.io/1221.html:lol:lol:lol

25989406 发表于 2018-1-20 14:24:49

顶一个!啊啊啊啊

neroxps 发表于 2018-1-20 15:00:21

厉害了我的哥

nideshijie 发表于 2018-1-20 18:22:26

谢谢分享!

qwas12 发表于 2018-1-20 18:25:41


谢谢分享!
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 人脸识别自动化【多人识别】【模版For循环】