Doods component - Update for contains flag (#10471)

* Update for contains flag

* Added timeout option

* Change contains to covers
This commit is contained in:
Zach 2019-10-16 16:34:58 -04:00 committed by Franck Nijhof
parent 420aec4b7b
commit 12e3fd7769

View File

@ -46,6 +46,11 @@ url:
description: The URL of the DOODS server description: The URL of the DOODS server
required: true required: true
type: string type: string
timeout:
description: Timeout for requests (in seconds)
required: false
type: integer
default: 90
detector: detector:
description: The DOODS detector to use description: The DOODS detector to use
required: true required: true
@ -54,6 +59,36 @@ confidence:
description: The default confidence for any detected objects where not explicitly set description: The default confidence for any detected objects where not explicitly set
required: false required: false
type: float type: float
area:
description: Global detection area. Objects in this box will be reported. Top of image is 0, bottom is 1. Same left to right.
required: false
type: map
keys:
top:
description: Top line defined as % from top of image.
required: false
type: float
default: 0
left:
description: Left line defined as % from left of image.
required: false
type: float
default: 0
bottom:
description: Bottom line defined as % from top of image.
required: false
type: float
default: 1
right:
description: Right line defined as % from left of image.
required: false
type: float
default: 1
covers:
description: If true the detection must be fully in this box. If false any part of the detection in the box will trigger.
required: false
type: boolean
default: true
file_out: file_out:
description: A [template](/docs/configuration/templating/#processing-incoming-data) for the integration to save processed images including bounding boxes. `camera_entity` is available as the `entity_id` string of the triggered source camera. description: A [template](/docs/configuration/templating/#processing-incoming-data) for the integration to save processed images including bounding boxes. `camera_entity` is available as the `entity_id` string of the triggered source camera.
required: false required: false
@ -96,6 +131,11 @@ labels:
required: false required: false
type: float type: float
default: 1 default: 1
covers:
description: If true the detection must be fully in this box. If false any part of the detection in the box will trigger.
required: false
type: boolean
default: true
{% endconfiguration %} {% endconfiguration %}
@ -106,6 +146,7 @@ image_processing:
- platform: doods - platform: doods
scan_interval: 1000 scan_interval: 1000
url: "http://<my doods server>:8080" url: "http://<my doods server>:8080"
timeout: 60
detector: default detector: default
source: source:
- entity_id: camera.front_yard - entity_id: camera.front_yard
@ -113,6 +154,14 @@ image_processing:
- "/tmp/{% raw %}{{ camera_entity.split('.')[1] }}{% endraw %}_latest.jpg" - "/tmp/{% raw %}{{ camera_entity.split('.')[1] }}{% endraw %}_latest.jpg"
- "/tmp/{% raw %}{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}{% endraw %}.jpg" - "/tmp/{% raw %}{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}{% endraw %}.jpg"
confidence: 50 confidence: 50
# This global detection area is required for all labels
area:
# Exclude top 10% of image
top: 0.1
# Exclude right 5% of image
right: 0.95
# The entire detection must be inside this box
covers: true
labels: labels:
- name: person - name: person
confidence: 40 confidence: 40
@ -121,6 +170,8 @@ image_processing:
top: 0.1 top: 0.1
# Exclude right 15% of image # Exclude right 15% of image
right: 0.85 right: 0.85
# Any part of the detection inside this area will trigger
covers: false
- car - car
- truck - truck
``` ```