New Custom Compontent - Image Processing - Object Detection - DOODS

I do this to avoid having a parked vehicle being detected every time a cloud goes by as I trigger image processing via an automation after detecting motion.

image_processing:
  - platform: doods
    scan_interval: 10000
    url: "http://192.168.9.111:8080"
    detector: inception
    file_out:
      - "/config/www/tmp/{{ camera_entity.split('.')[1] }}_latest.jpg"
    source:
      - entity_id: camera.driveway
    confidence: 50
    labels:
      - name: person
        confidence: 40
      - name: car
        area:
           top: 0.2
           right: 0.65

Last part right after area. You will have to adjust the top and right values until it works for you. The numbers are how much down from the top and how much from the right you want to leave out if I recall correctly. When a car is detected outside that area I get a bounding box. This is how I made the size appropriate for my needs.
Hope that helps.

Yeah I get the idea of setting up the are for one camera, but how can you setup different detection areas for different cameras?

1 Like

This is just one camera. It won’t affect any others.
I have other cams that simply don’t have an area defined. Also this area is only for car. It will still detect people in this area on this camera.

1 Like

Hi there,

Unfortunately, I’m completely new to the Home Assistant. I now wanted to install doods via Hass.io and cannot use this because port 8080 is already being used by facebox. Can I move the port to 8181?
Unfortunately I don’t know what the name of the config file should be and whether it should be in “/ home-assistant / share”?

Should be no reason you can’t change the port in the settings of the addon. The config file can be set from inside the addon so no need to look for it.

1 Like

ohhh man … that i can edit the addon directly in the panel i didn’t even notice.

Thanks for the information

Is there anyway to get this addon working in a vm (Proxmox) ?
I’ve installed the addon from https://github.com/snowzach/hassio-addons.git but it wont start and there is no logs. So I’m not sure what the issue is :frowning:

OK, so I’ve tried the non amd64 version and it works.

Very happy, I’ve ported over to proxmox so now I’m running a supported HA install with DOODS working.

However, when running on Ubuntu with the amd DOODS the cpu would hang around 40%, now the CPU hangs around 90%.

Is there anything I can do to bring this down?
I noticed a message in the log file suggesting a compiler option, will this help, if so how to I do that? There is a rebuild button but no where to add an option :(.

Hey!
DOODS works great!

I have 4 camera’s in my doods setup running, but I want to have different area settings.
What’s the best way to do this? Make different a image_processing for each camera?

My current yaml:

image_processing:
  platform: doods
  url: "http://192.168.0.163:6543"
  detector: tensorflow
  source:
    - entity_id: camera.inkom
    - entity_id: camera.garage
    - entity_id: camera.tuin1
    - entity_id: camera.tuin2
  file_out:
    - "/config/www/doods/{{ camera_entity.split('.')[1] }}_latest.jpg"
    - "/config/www/doods/{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg"
  labels:
    - name: person
      confidence: 60
    - name: car 
      confidence: 70
      area:
        top: 0.2
        right: 0.3
    - name: truck
      confidence: 70
      area:
        top: 0.2
        right: 0.3

It probably means you are running constant detections. What do you have scan_interval set to? If it’s the default it’s set to 10 seconds. Set it to 10000 and then manually trigger it.

Yes, you need to create multiple doods instances and define an area and detection settings for each one. It doesn’t make it any less efficient to do it this way other than requiring more config.

1 Like

Thanks for the answer.

Can I make multiple doods instances on the same camera?
I currently have one that scans for all persons on the camera screen, but I want a second one with a on a smaller screen. (To use this as a detector)

I tried to do this, but it doesn’t seem to work?

Interesting… I would have thought you could… I haven’t tried it myself. What’s the error? DOODS certainly won’t care.

Well, nothing happens. No error nothing.

I have an image process that does person, car and truck labels without area and an other one with a person label in a certain area.

The first one keeps working, second doesn’t get triggered.

Can the camera handle the simultaneous request from 2 doods instances?

I’ve been playing with Doods successfully for the last week or so, and recently ordered some Jetson Nano’s to continue experimenting more - hats off to @snowzach for such magnificent code!

I want to be able to detect both Humans and Motorcycles, so I can raise the alarm if a human is detected but also count the number of motorbikes inside my garage and outside in the driveway. The idea is that, after sundown, if I’ve forgotten to bring my bike inside it will send me a notification.

I can see the labels of identified motorcycles / persons / cats etc coming through image_processing.doods under Developer tools, but I’m struggling to get these entities and counts through to lovelace. Right now it just shows the total count of all detected people and motorbikes, how do I show the individual count for Motorbikes, People, Cats etc in lovelace, and ideally updating a sensor too for further automation?

Second question - has anyone tried using Lidar sensors in place of the cameras? I don’t see why it wouldn’t work since many cars already have this feature - but would it be more accurate and efficient than processing the image from a camera?

Fantastic work on this. I’d be interested to know how I can manually trigger the image processing, would certainly help with the load on the little machine it is running on. I’m currently using mjpeg stream from my camera, could you elaborate on how I could just manually trigger based on a motion sensor?

Edit:

Found my answer in the HA docs

Has anyone been able to create a custom model and use that instead of the default ones? I currently get the following error when starting doods up.

|doods    | 2021-01-13T16:12:42.343Z|DEBUG|detector/detector.go:61|Configuring detector|{"package": "detector", "config": {"name":"default","type":"tflite","model_file":"models/new_mobile_model.tflite","label_file":"models/class_labels.txt","num_threads":1,"num_concurrent":1,"hw_accel":false,"timeout":120000000000}}|
|---|---|---|---|---|
|doods    | 2021-01-13T16:12:42.493Z|ERROR|detector/detector.go:74|Could not initialize detector default: unsupported input tensor name: serving_default_input_1:0|{"package": "detector"}|
|doods    | 2021-01-13T16:12:42.493Z|FATAL|detector/detector.go:84|No detectors configured|{"package": "detector"}|

I would probably use something like node red to accomplish this. I am sure home assistant could probably do it but I find node red much easier to use.