YOLO Object detection on Unifi Security Camera

I was inspired by this TED talks about YOLO Object detection.

When I saw it I instantly thought about my security cameras that send me push notifications multiple times a day when a branch of a tree is caught by the wind or a fly/spider is too close to the camera. I started to look into trying YOLO.

Turns out it’s pretty easy getting started… More info on YOLO
The fork I ended up using: here

I use Unifi G3 cameras that films whenever motion is detected in the cameras. I wrote a Python script that tails the recording.log and whenever a new motion is finished the python script will run YOLO on the recording and if a person is detected it will send me a push notice with an image. It was a fun project to work on.

Push notification:

Video on how Yolo detects me in my front porch camera:

14 Likes

Nice job, I’ve got unifi g3 cameras too and would love this but I’ve got no idea how to setup something like this, do you think something like this can be integrated into home assistant through a component?

What are the hardware requirements per camera? And at what fps?

Not sure, I have a server using a core i3 and a 2gb gtx card.
It should be possible to run on worse hardware.

For example on a RPI3.
https://github.com/AlexeyAB/darknet/issues/38

Hi,

Where can I find the script you used to run YOLO on the recording, how did you make this work with home assistant have you got a guide?

I am running HomeAssistant on Ubuntu inside docker.

Thanks

Hi,
The script I am using is something i coded for myself. It contains hardcoded paths etc. I will try to clean it up and publish it but meanwhile you can try to get yolo working by following instructions here: https://github.com/AlexeyAB/darknet

Hey,

Thanks, no problem if you do manage to share the script that would be great to see how you accomplished it.

I spent a bit of time researching Darknet versus TensorFlow etc and Darkflow making the two talk, and got a bit confused but I think conceptually I got it now. However, I am a beginner and using Ubuntu 16.04 no GPU, CPU only and in order to to be able to get this up and running I need some help with basic list of instructions, I mean basic as in the code to copy and paste into terminal.

Is there any chance you could help with providing the instructions to follow the Alexey instructions?

Hey…any chance of publishing the script its okay if hardcoded paths.

I need to do same if a person is at the front door then send message with or without image of person to android phone on same wifi network.

Thanks

Hi,

I have managed to get darknet and yolo2 working on Ubuntu Installing Darknet

It would be great to take it to the next level and see the scripts you are using to object detect a person then trigger an action.

Hi @christian.ek Great project thanks for sharing.

Quick question: Can YOLO Object detection detect any set object?

Also can I use any camera which I have set up in Home Assistant?

Thanks

Is YOLO able to be trained further? For instance, could it conceivably be trained to recognize and classify subgroups of people (eg., specific individuals, USPS/FedEx/UPS drivers by uniform, etc.) Could it also be extended and combined with OCR to allow reading license plates (would be lovely to get a text that my mother’s car was pulling up the drive, or that a deliveryman was coming up the walk)?

I just created an image processing component that can use the YOLO detection model. It utilizes Darkflow, which is a Python implementation of Darknet.

Hey,

Fantastic work and great to see the progress you have made. It seems like there is lot’s of interest in seeing your scripts, can you share? maybe just anonymise paths/passwords/IPs etc.

Many thanks
Fatman

I put my code up here:

I might try to make it easier for other people to use when i have more time

Hello,

Were you able to clean this code up and publish? Im curious about this at the moment I am using this setup. https://youtu.be/fwoonl5JKgo
I would like to use this yolo system cause seen more accurate and can detect live feed. I wonder if it’s possible to get yolo integrate with Bi?

Hi

Are there any updates on Yolo object detection in HASS?