From 99949daf3c60f22daa3c16d64935b54d019f59c9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 25 Aug 2019 22:58:44 -0400 Subject: [PATCH 1/4] Added doods component documentation --- source/_components/doods.markdown | 160 ++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 source/_components/doods.markdown diff --git a/source/_components/doods.markdown b/source/_components/doods.markdown new file mode 100644 index 000000000000..e951afdc2249 --- /dev/null +++ b/source/_components/doods.markdown @@ -0,0 +1,160 @@ +--- +title: "DOODS" +description: "Detect and recognize objects with DOODS." +logo: home-assistant.png +ha_category: + - Image Processing +ha_iot_class: Local Polling +ha_release: 0.82 +redirect_from: + - /components/image_processing.doods/ +--- + +The `doods` image processing platform allows you to detect and recognize objects in a camera image using [DOODS](https://github.com/snowzach/doods/). The state of the entity is the number of objects detected, and recognized objects are listed in the `summary` attribute along with quantity. The `matches` attribute provides the confidence `score` for recognition and the bounding `box` of the object for each detection category. + +## Setup + +You need to have DOODS running somewhere. It's easiest to run as a docker container and deployment is described on docker hub +[DOODS - Docker](https://hub.docker.com/r/snowzach/doods) + +## Configuration + +The configuration loosely follows the tensorflow configuration. To enable this platform in your installation, add the following to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +image_processing: + - platform: doods + url: "http://:8080" + detector: default + source: + - entity_id: camera.front_yard + confidence: 50 + labels: + - person + - car + - truck +``` + +{% configuration %} +source: + description: The list of image sources. + required: true + type: map + keys: + entity_id: + description: A camera entity id to get picture from. + required: true + type: string + name: + description: This parameter allows you to override the name of your `image_processing` entity. + required: false + type: string +url: + description: The URL of the DOODS server + required: true + type: string +detector: + description: The DOODS detector to use + required: false + type: string +confidence: + description: The default confidence for any detected objects where not explicitly set + required: false + type: float +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. + required: false + type: list +labels: + description: Information about the selected labels model. + required: false + type: map + keys: + name: + description: The label of the object to select for detection. + required: true + type: string + confidence: + description: The minimum confidence for the selected label + required: false + type: float + area: + description: Custom detection area. Only objects fully 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 + +{% endconfiguration %} + +```yaml +# Example advanced configuration.yaml entry +# Example configuration.yaml entry +image_processing: + - platform: doods + scan_interval: 1000 + url: "http://:8080" + detector: default + source: + - entity_id: camera.front_yard + file_out: + - "/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" + confidence: 50 + labels: + - name: person + confidence: 40 + area: + # Exclude top 10% of image + top: 0.1 + # Exclude right 15% of image + right: 0.85 + - car + - truck +``` + +## Optimising resources + +[Image processing components](/components/image_processing/) process the image from a camera at a fixed period given by the `scan_interval`. This leads to excessive processing if the image on the camera hasn't changed, as the default `scan_interval` is 10 seconds. You can override this by adding to your config `scan_interval: 10000` (setting the interval to 10,000 seconds), and then call the `image_processing.scan` service when you actually want to perform processing. + +```yaml +# Example advanced configuration.yaml entry +image_processing: + - platform: doods + scan_interval: 10000 + source: + - entity_id: camera.driveway + - entity_id: camera.backyard +``` + +```yaml +# Example advanced automations.yaml entry +- alias: Doods scanning + trigger: + - platform: state + entity_id: + - binary_sensor.driveway + action: + - service: image_processing.scan + entity_id: camera.driveway +``` From ffc66d2fc60528a23e7b7f3b3580515708db07c7 Mon Sep 17 00:00:00 2001 From: Zach Date: Mon, 26 Aug 2019 08:52:39 -0400 Subject: [PATCH 2/4] Update ha_release Co-Authored-By: Klaas Schoute --- source/_components/doods.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/doods.markdown b/source/_components/doods.markdown index e951afdc2249..7f6c64bb99a5 100644 --- a/source/_components/doods.markdown +++ b/source/_components/doods.markdown @@ -5,7 +5,7 @@ logo: home-assistant.png ha_category: - Image Processing ha_iot_class: Local Polling -ha_release: 0.82 +ha_release: 0.99 redirect_from: - /components/image_processing.doods/ --- From c25c881b897b2b5a98e884f5979755215dfe0e70 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 27 Aug 2019 23:05:17 -0400 Subject: [PATCH 3/4] Update for recommendations --- source/_components/doods.markdown | 7 ------- 1 file changed, 7 deletions(-) diff --git a/source/_components/doods.markdown b/source/_components/doods.markdown index 7f6c64bb99a5..3caf2594d98f 100644 --- a/source/_components/doods.markdown +++ b/source/_components/doods.markdown @@ -1,7 +1,6 @@ --- title: "DOODS" description: "Detect and recognize objects with DOODS." -logo: home-assistant.png ha_category: - Image Processing ha_iot_class: Local Polling @@ -26,14 +25,8 @@ The configuration loosely follows the tensorflow configuration. To enable this p image_processing: - platform: doods url: "http://:8080" - detector: default source: - entity_id: camera.front_yard - confidence: 50 - labels: - - person - - car - - truck ``` {% configuration %} From 7918bff4ae0d5de27b393f5144493dad9428af5e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 28 Aug 2019 08:45:20 -0400 Subject: [PATCH 4/4] Removed redirect_from option --- source/_components/doods.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/_components/doods.markdown b/source/_components/doods.markdown index 3caf2594d98f..80cc6ec6fffa 100644 --- a/source/_components/doods.markdown +++ b/source/_components/doods.markdown @@ -5,8 +5,6 @@ ha_category: - Image Processing ha_iot_class: Local Polling ha_release: 0.99 -redirect_from: - - /components/image_processing.doods/ --- The `doods` image processing platform allows you to detect and recognize objects in a camera image using [DOODS](https://github.com/snowzach/doods/). The state of the entity is the number of objects detected, and recognized objects are listed in the `summary` attribute along with quantity. The `matches` attribute provides the confidence `score` for recognition and the bounding `box` of the object for each detection category.