-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Added doods component documentation #10228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| --- | ||
| title: "DOODS" | ||
| description: "Detect and recognize objects with DOODS." | ||
| ha_category: | ||
| - Image Processing | ||
| ha_iot_class: Local Polling | ||
| ha_release: 0.99 | ||
| --- | ||
|
|
||
| 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 | ||
|
snowzach marked this conversation as resolved.
|
||
| [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: | ||
|
klaasnicolaas marked this conversation as resolved.
|
||
| - platform: doods | ||
| url: "http://<my doods server>:8080" | ||
| source: | ||
| - entity_id: camera.front_yard | ||
| ``` | ||
|
|
||
| {% 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://<my doods server>: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 | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.100