New Custom Compontent - Image Processing - Object Detection - DOODS

Sounds very complex, I’m afraid I have no idea myself as I was just barely able succeed my automation. Sorry.

@snowzach, could you please take a look at the following? Getting error logs from the hass.io repository:

21-02-08 19:09:21 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'devices' use a deprecated format, the new format uses a list of paths only. Please report this to the maintainer of DOODS
21-02-08 19:09:21 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of DOODS-cuda
21-02-08 19:09:21 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'devices' use a deprecated format, the new format uses a list of paths only. Please report this to the maintainer of DOODS-cuda
21-02-08 19:09:21 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of DOODS-amd64
21-02-08 19:09:21 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'devices' use a deprecated format, the new format uses a list of paths only. Please report this to the maintainer of DOODS-amd64
21-02-08 19:09:21 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of RTS2P

Probably because of an update of HA.

Info: Now I use i9 10th Gen with RTX3070 and speed is 0.045 Sec (for Tensorflow)

WARN: NOT working on RTX3070 now (02/2021), whole image is 100% person (on CPU and GTX95050 works fine)

It’s probably going to require a manual sensor that triggers when the value from DOODS is non-zero and then automatically resets itself after a certain amount of time. One of these days when I can come up for air, I think it would be ideal to have DOODS trigger events. I do not believe the image_processing function of home assistant supports that (yet)

1 Like

I just did a merge request someone submitted to update the hassio repo. Hopefully that fixed it.

1 Like

I am looking for an example on how to setup a notification when the something is detected. Perhaps one should be added to the official docs page here ?

Would save hours of searching and asking.

Anyway I am here and asking :slight_smile:

Ideally I want a notification on pushover with an image detected but I am not sure if it supports images.

Hi to everybody, having little experience I’m trying to experiment with DOODS in HA using this nice docker image with an RP4. I managed almost everything but the automation which should be triggering an action upon detecting something (for the time being I do not use any boolean switch). The trigger part of the automation seems to be very basic but it does not trigger whenever the image processing service completes it’s job and I don’t understand why. This is the automation I’m talking about:

platform: state
entity_id: image_processing.doods_camera_1
attribute: total_matches
from: '0'

Anyone willing to shed some light,
Thank you,
Federico

You might have luck in a general forum. Honestly, I have so much trouble with automations I do it all in Node Red.

I have two automations per camera. The first one uses the camera as a motion detector and if there is motion seen then it calls the image processing service.
The second automation is this:

- id: e123456
  alias: DOODS
  trigger:
  - entity_id: image_processing.doods_driveway
    platform: state
  condition:
  - condition: or
    conditions:
    - condition: template
      value_template: '{{ ''car'' in state_attr(''image_processing.doods_driveway'',
        ''summary'') }}'
    - condition: template
      value_template: '{{ ''truck'' in state_attr(''image_processing.doods_driveway'',
        ''summary'') }}'
    - condition: template
      value_template: '{{ ''person'' in state_attr(''image_processing.doods_driveway'',
        ''summary'') }}'
  action:
  - data:
      data:
        photo:
        - caption: Motion In Driveway
          file: /config/www/tmp/driveway_latest.jpg
      message: Motion in Driveway
    service: notify.telegram

You may have to modify it to work with pushover as I use telegram, but that shouldn’t be too hard if you already use it with home assistant.

I want to give it a try. Could you also share a first automation that detects the motion?

I’m not in front of a computer right now so I can’t copy examples. I use the amcrest and hikvision components for my amcrest (works for my dahua cams to) and hikvision cams. These make motion sensor entities in HA. So my automation says if motion sensor state changes then call image processing for doods for whichever camera.
Hope that helps.

Never mind then. I thought you were using motion software to detect motion but you are using motion sensors whoch my cameras don’t have.

It would be great if the service “image_processing.scan” would allow to override configuration options such as confidence level.

There may be situations where I would accept a lower level, or even for testing purposes.

Not exactly sure what you are looking for…you can specify the confidence level you want to see in the config.

Hi @danbutter,

That is clear to me.
But to change that value I would need to restart home assistant.
My suggestion would be to also take confidence level as an optional input parameter in the service. Something like:

image

1 Like

I was looking for this same thing. What I am playing around with that might prove useful is another automation that resets it. For this automation, when motion is off, call the image_processing.scan service again. If you’re only trying to detect a person, then I should return 0 matches. It’s worked for me in testing, but I’ve not put that into real world use yet.

Hi Ive already have that the problem I have , is that sometime part of my car is detected as a person at 75% and I have TTS running to tell me if anyone is on my drive.

I love the simplicity of this and the fact that I can call the image processing on demand as needed!

I’m wondering if there’s a way to create a mask so that a certain section of the image isn’t used for object detection? I have my camera overlooking my driveway, when motion is detected, I send the image to DOODS for object detection of cars/trucks. The problem I have from time to time is when I need to park my car outside. I always park it in the same spot I would like to mask out of detection. Since I’m triggering object detection based on motion, if a stray dog walks across the driveway, it triggers and then identifies my own car parked in the driveway.

1 Like

You can do this.
Example is shown here:


You’ll just want to move it under car or truck rather than person as shown in the example.

Ah yes! I see, that should work. I didn’t realize you could exclude an area like that. Do you know if there’s a way to determine where the box would be in the image? I mean, I could roughly guess and go by trial and error, but if you knew of a quick trick to determine it, that’d be helpful as well. Thanks again!