New Custom Compontent - Image Processing - Object Detection - DOODS

Hi @orginda, without any logs, I cannot really help you.

Hi @wnelson I have been trying occasionally to get one of the Yolo models working with the EdgeTPU. There is a project that has it working but I am struggling to interpret the output. I agree with you quality is garbage with the EdgeTPU. I am hoping to figure it out eventually. I just found a library that allows me to use PyTorch models so I am going to work on that next. I understand PyTorch is a lot easier to work with.

2 Likes

@tuxabyte DOODS detected 10 things in your image… So my guess is that they are all below your confidence of 70. Try lowering that and see if it returns something.

For some reason doods keeps reporting 10 detections in the log. I changed the still_image picture to 5 people. And the doods entity is not reporting any detections.

Output of doods log

> |---|---|---|---|---|
> |2020-11-15T17:00:16.993+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.104064072, "detections": 10, "device": null}|
> |2020-11-15T17:00:16.994+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.437625079, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000016", "remote": "172.30.32.1:46032"}|
> |2020-11-15T17:01:24.863+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.098090652, "detections": 10, "device": null}|
> |2020-11-15T17:01:24.865+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.437336018, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000017", "remote": "172.30.32.1:46098"}|
> |2020-11-15T17:20:04.766+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003196293, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000018", "remote": "192.168.178.4:42844"}|
> |2020-11-15T17:20:04.805+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003309626, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000019", "remote": "192.168.178.4:42846"}|
> |2020-11-15T17:21:30.819+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.131904199, "detections": 10, "device": null}|
> |2020-11-15T17:21:30.822+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.481741149, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000020", "remote": "192.168.178.4:42954"}|
> |2020-11-15T17:30:57.753+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.108152042, "detections": 10, "device": null}|
> |2020-11-15T17:30:57.755+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.45800326, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000021", "remote": "192.168.178.4:43354"}|
> |2020-11-15T18:11:37.182+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003447153, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000022", "remote": "192.168.178.4:45156"}|
> |2020-11-15T18:11:37.218+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.00315101, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000023", "remote": "192.168.178.4:45158"}|
> |2020-11-15T18:12:19.752+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.097915679, "detections": 10, "device": null}|
> |2020-11-15T18:12:19.754+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.4828394, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000024", "remote": "192.168.178.4:45298"}|
> |2020-11-15T18:13:55.459+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.108023103, "detections": 10, "device": null}|
> |2020-11-15T18:13:55.464+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.465917894, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000025", "remote": "192.168.178.4:45378"}|
> |2020-11-15T18:14:52.255+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.114388543, "detections": 10, "device": null}|
> |2020-11-15T18:14:52.257+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.46685569, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000026", "remote": "192.168.178.4:45418"}|
> |2020-11-15T18:19:22.462+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003168715, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000027", "remote": "192.168.178.4:45630"}|
> |2020-11-15T18:19:22.530+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.002806688, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000028", "remote": "192.168.178.4:45632"}|
> |2020-11-15T18:23:27.309+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.099485299, "detections": 10, "device": null}|
> |2020-11-15T18:23:27.311+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.45035358, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000029", "remote": "192.168.178.4:45912"}|
> |2020-11-15T18:35:52.183+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003951757, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000030", "remote": "192.168.178.4:46534"}|
> |2020-11-15T18:35:52.234+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003601285, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000031", "remote": "192.168.178.4:46536"}|
> |2020-11-15T18:41:47.251+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.122229377, "detections": 10, "device": null}|
> |2020-11-15T18:41:47.253+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.516671519, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000032", "remote": "192.168.178.4:46866"}|
> |2020-11-15T18:42:42.325+0100|INFO|tflite/detector.go:393|Detection Complete|{"package": "detector.tflite", "name": "default", "id": "", "duration": 0.106919006, "detections": 10, "device": null}|
> |2020-11-15T18:42:42.327+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.478128883, "request": "/detect", "method": "POST", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000033", "remote": "192.168.178.4:46910"}|
> |2020-11-15T18:51:24.231+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.003891444, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000034", "remote": "192.168.178.4:47346"}|
> |2020-11-15T18:51:24.258+0100|INFO|server/server.go:139|HTTP Request|{"status": 200, "took": 0.004937118, "request": "/detectors", "method": "GET", "package": "server.request", "request-id": "d5f40609-doods/axJOVuyxsZ-000035", "remote": "192.168.178.4:47348"}|```

DOODS will always report as many as it finds. The Home Assistant component filters it down to the confidence matches. I would still drop the confidence number and figure out what it’s matching. DOODS is finding things, Home assistant is filtering it.

Hey snowzach, awesome work on this component. I hope to be able to integrate it into my home assistant setup but I have a quick question I am not able to find the answer to here or on your github. I see in this thread it is mentioned a few time that this only works on x86_64 architecture. In a few places however, I see discussion about processing speed on a raspberry Pi4. Can you please clarify for me if DOODS can be implemented only on raspberry Pis? Currently I run Home Assistant OS (arm64) on a Pi3B. I have a spare Pi4 8GB that I would like to use for object detection using DOODS but I am unclear if this will work. Any additional information you can provide would be great.

Hey @viper33802 doods only works on x86_64 on Intel. It does also support both arm32 and arm64. It will work on the Pi3 and Pi4. The Tensorflow lite models work pretty well (albeit with much less accuracy) The Pi4 with 4GB will run the tensorflow model (inception) but it’s a little bit slow.

hello, trying to install doods via docker i am getting this error:

 2020-11-24 12:34:36 ERROR (MainThread) [homeassistant.components.image_processing] Error while setting up doods platform for image_processing
  File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 85,  in setup_platform

I’m running latest 0188.3 HA via docker in Ubuntu. This is only error i’m seeing in logs.

Any idea how to get it resolved. I see that container is running.

Are you running doods in a docker container also? What config are you using?

Yes, doods is running in container. Not sure what do you mean by “which config”. I think what comes with default. I installed the latest:
docker run -it -p 8080:8080 snowzach/doods:latest

this is my config:

image_processing:
  - platform: doods
    url: 192.168.15.2:8080
    detector: default
    source:
      - entity_id: camera.frontdoor_cam

Try using (assuming they are on the same machine)

  url: http://doods:8080

Or http://localhost:8080

Thank for helping me out.
yes, they are on same machine and port 8080 is listening and open.

docker-pr 11503            root    4u  IPv6 10837235      0t0  TCP *:8080 (LISTEN) 

Nmap output from my laptop showing that port is open

8080/tcp open http-proxy

when I try to access ip:8080 either local or from my laptop I get respond not found

~$ curl http:/localhost:8080
Not Found 

when I check container logs I see connections from localhost and my laptop

2020-11-25T14:58:35.415Z        INFO    server/server.go:139    HTTP Request    {"status": 404, "took": 0.000016185, "request": "/", "method": "GET", "package": "server.request", "request-id": "d8882d2ffad1/qCXd0hQO2q-000006", "remote": "192.168.10.54:54900"}
2020-11-25T15:04:35.273Z        INFO    server/server.go:139    HTTP Request    {"status": 404, "took": 0.000036439, "request": "/", "method": "GET", "package": "server.request", "request-id": "d8882d2ffad1/qCXd0hQO2q-000007", "remote": "192.168.10.54:55723"}
2020-11-25T15:05:36.928Z        INFO    server/server.go:139    HTTP Request    {"status": 404, "took": 0.000014462, "request": "/", "method": "GET", "package": "server.request", "request-id": "d8882d2ffad1/qCXd0hQO2q-000008", "remote": "172.17.0.1:35766"}

If they are on the same machine, you generally have to made doods and home assistant run in the same network. (See docker manual on creating and starting a container in a specific network.) Then you can reference the doods container by http://doods:8080

That NotFound is actually being returned by doods, so it’s working. But inside the home assistant container it might be a different IP and/or host. Localhost inside the doods container might not be what you think either. It’s just a caveat of container networking.

Just wondering here…will there ever be a addon for the Cuda version?
I’m running the amd64 addon right now. Just wanted to try the cuda version, but no clue how to do both an addon and a separate docker container at the same time.
That and it is so easy to backup with a snapshot using the addons.

Thanks,
I just confirmed they are on the same network. I just went inside of hassio container and run:

config $ curl 172.30.33.5:8080
Not Found

and using public IP, that works as well

config $ curl 192.168.15.2:8080
Not Found

when I restart HA, why I see this error:


2020-11-25 09:04:08 ERROR (MainThread) [homeassistant.components.image_processing] Error while setting up doods platform for image_processing
  File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 85, in setup_platform
    doods = PyDOODS(url, auth_key, timeout)
  File "/usr/local/lib/python3.8/site-packages/pydoods/__init__.py", line 13, in __init__
  File "/usr/local/lib/python3.8/site-packages/pydoods/__init__.py", line 20, in get_detectors

I dont think its a connectivity issue

EDIT: I’m such an idiot … in my config I was missing http:// in front of my IP … after I fixed that error went away & I see image_processing under developer tools

thanks again fro your help and bearing with me

I don’t think you have it pointed at the right ip. Do a curl http://<ip>:8080/version and doods will return something like {"version":"v0.2.6-0-gb2a1c53-dirty"}

edit: NVM I see you got it

thanks! you did amazing job! so far it works great!!! I wish I did not think a car parked on the street is a person :slight_smile:

now I will work on automation to push an image to our phones if somebody is at the front door.

Set your confidence levels a little higher, that should help filter out false positives. I would recommend maybe 50 to start as all of those are under that. I have been slowly increasing mine and the number of false positives goes down each time.

hi,
can i install doods on google cloud or amazon aws and call it from my local HA? If so what google cloud product would work best for it?

If run in local environment what kind of machine would you recommend to get to run doods smoothly for 3-4 cameras?

btw, can rpi3 handle HA that sends to separate more powerful machine 3-4 cameras for object recognition?

Hi,
Can someone explain how to set different areas for different sources? i have a camera on the driveway and dont want to get notified from people walking on the sidewalk, just the driveway itself, but dont want to limit the detection range of the other cameras…

Any idea?

1 Like