Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.91 KB | None | 0 0
  1. binary_sensor tensor:
  2.    - platform: template
  3.      sensors:
  4.        person:
  5.          friendly_name: 'Person'
  6.          value_template: >
  7.           {% set ns = namespace(found=false) %}
  8.            {% if states.image_processing.tensorflow_wjazd.attributes.matches.person or
  9.                  states.image_processing.tensorflow_wejscie.attributes.matches.person %}
  10.              {% for persons in states.image_processing.tensorflow_wjazd.attributes.matches.person %}
  11.                {% if persons.score >= "92"|float %}
  12.                  {% set ns.found = true %}
  13.                {% endif %}
  14.              {% endfor %}
  15.              {% for persons in states.image_processing.tensorflow_wejscie.attributes.matches.person %}
  16.                {% if persons.score >= "92"|float %}
  17.                  {% set ns.found = true %}
  18.                {% endif %}
  19.              {% endfor %}
  20.            {% endif %}
  21.            {{ ns.found }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement