Object detection using OpenCV and Darknet/YOLO

This is what I am doing with my MQTT approach. When a motion sensor triggers, my hacked Wyze camera takes a snapshot which is then processed via my Movidius Neural Compute stick. That has a VPU that can handle the object detection (granted not nearly as well a a NVIDIA CUDA GPU, but then again it’s a fraction of the cost). My python scripts process the image and report the class detected via MQTT to a sensor in HASS. I’m not interested in the image or bounding boxes, so I removed that portion. The image processing takes about 2 second’s give or take

Seems the git repo was taken down…has anyone worked on this further? I would be interested in playing with it and contributing.

Thanks

@flashoftheblades can you fix the manifest file to trigger opencv installation?

I think the reason I didn’t do it originally, is that unless you’re running a raspberry pi, the binaries that are available through pip install are not going to be optimized for your system (you really want them to be for good performance). This is especially true if you want to enable some of the more advanced optimizations like GPU or Movidius compute stick.

I think we are not thinking the same. I just want you to add opencv installation so we do not need to add antoher - platform: opencv, just to get working opencv library on opencv_darknet, just add it to installation wheels. Because it deletes the opencv library on every update without - platform: opencv.I am on intel nuc

So, I think I have it updated to what you’re requesting, in the dev branch of the repo. I set the dependencies in the manifest to be the same as the main OpenCV component. Part of the issue is that I already upgraded the Python install on my HA setup (installed on Raspberry Pi), and it doesn’t look like piwheels has a 3.7 build of OpenCV 4.1.0.25 yet, so I can’t entirely test it. Let me know if it works for you, and then I can promote it to the master branch.

1 Like

Uff that was fast! Thank you very much! I must also wait for new update and then test it :slight_smile: Think 0.96.2 will be soon and then will I report!

@flashoftheblades update. Fix is working!!! Thank you very much! Update to 0.96.2, which deleted opencv library, added your fix and all good.

You can push to master

I’ve been working on integrating the dev into my Docker of HA, v0.103.6.
I have the /custom_components/opencv_darknet/ with the 3 files, but my config checker keeps telling me this:
Platform error image_processing.opencv_darknet - Integration ‘opencv_darknet’ not found.

Am I missing some understanding of how to use custom_components? Using portainer, I have opencv 4.1.0 and darknet working. It exists within /config

Do I need to restart HA in order for it to recognize the component?

Maybe some people on this thread would have tips or an interest in my OpenCV Timelapse project? Timelapse Video with Computer Vision | Make timelapse with bounding boxes of detected objects using your own trained OpenCV model!

Hi

Are there any updates on Yolo object detection in HASS? Like a newer code using newer Yolo?

Hi Everyone,

Does anyone have this currently working? I have installed as described on the github, and set up as per the example (see photo) image.

It is set up with a custom model (spaghetti detector, for a 3D printer), and im seeing no errors, but i am also not seeing anything on Home assistant? Is there an entity or anything that the information gets attached to?

Any help would be really apprecciated