Local realtime person detection for RTSP cameras

Hi All,

I’ve made some tweaks to the clip management script Blake wrote recently in order to get it running on HassOS on Raspberry Pi.

You can find the updated version here:

Tested on RPi4 running HA 0.116.4 on HassOS 4.13.

Hopefully some of you might find it useful until something more sophisticated comes along!

1 Like

The mask only applies to motion. If there was motion outside of the mask, frigate may have picked up the car in the background. It will continue to track it once it finds it, even if it is outside of the mask. Probably best to have a separate mask for object detection. If you open an issue on GH, I can look at it.

@blakeblackshear I have started playing with the crop=1 parameter, and was wondering if there was an option to get even smaller regions, for example only including the bounding box of detected object?
thx

Definitely. Can you open an issue on GH for multiple crop types? I’m thinking you would pass a string instead of 1/0. Maybe region/object/none as the initial options.

Sure: https://github.com/blakeblackshear/frigate/issues/262

How is cropped image size determined? I have small images for persons (300x300), and bigger images for cars (720x720)?

It’s based on the original size of the dynamic region. You can make it static by passing the h parameter too.

Can anyone who is running this on proxmox please take a look at the issue here and hopefully help point out what I’m doing wrong.

Been struggling with this all week.

EDIT: All working well, not sure what was up but all working with passthrough.

Well good luck. It seems that windows server 2019 works better than win10 for this config.
My QEMU has just crashed, had to reboot the VM. Lasted 3 days. I will switch back to SW decode on other VM.

Setup the cameras.
I though I would share a nice script to be able to see your recorded clips from the frontend.

Just set destination path to a folder you serve from HA webserver (usually www).
It will create a motion.html and a directory videos containing videos and thumbnails.
Then use a iframe card to incorporate in the frontend.
next thing will be modifying to generate the site directly referring the clips directory .
Should not be hard.

BTW @blakeblackshear is there a rotation/retention policy for clips stored or is it left to user manage/clean ?
I could not find any instructions so I guess there is not. :slight_smile:

1 Like

Not yet. I’m planning to incorporate all of these things in the coming releases.

1 Like

Tried the new HA add-on and with 1 camera found my cpu usage was jumping up to ~90%. Didn’t want to think about trying it with 9 cameras.

So I set this up in a docker container on my server which has tons of cpu power.
The log on the server version is just a large everending loop of “on connect called”. In the HA add-on the same message was there but it seemed to only be once.

Here’s an exert from the log. The container was running for less than a minute. Is this normal behavior?

On connect called
On connect called
On connect called
On connect called
On connect called
On connect called
On connect called
On connect called
On connect called
On connect called
On connect called

Check your mqtt settings or post your config

Why not use HA’s new media browser feature?

This happens when you have multiple instances of frigate connected to the same mqtt server. You have to set a different client ID in the mqtt settings if you want to do that. 9 cameras will probably crush even the best CPUs. I strongly suggest getting a Coral. It will outperform a top of the line server CPU by an order of magnitude without breaking a sweat.

Hey guys, let me preface this by saying im a complete docker newb. I just added the health check section to my docker compose file, when I try to launch frigate now i get the following message "Unsupported config option for frigate: ‘healthcheck’. Any ideas?

That’s exactly what it was. I still had the HA add-on running when I was firing up the instance on my server.

I likely will end up getting a Coral usb device in hopes of being able to run it all in-house with the HA add-on. But they seem to be limited stock and estimated delivery date here to Canada is in December.

So I’ve got time to play with Frigate for a bit first to make sure it fits what I’m looking to do. I just want to turn on lights if a person is detected when the house is armed, so that should be pretty simple. Playing with it a bit last night it was a good 15-20s of standing right in front of the camera before it registered a person, so I think I’ve definitely got some settings to tweak :stuck_out_tongue:

You are probably on an old version of docker compose.

Hi,

I try to run the plugin with the pcie Coral card but it is not detected.
On the host the installation wen fine :
lspci
01:00.0 System peripheral: Device 1ac1:089a

But it seems that the device /dev/apex_0 is not exposed to the to the container.
Can you fix that ? Or I miss an option ?

inside the frigate-addon container with the /dev/apex_0 exposed I can run the example :

Pehap’s that’s because frigate edgetpu.py code expects an usb device ?

Kind regards,

I made sure compose was up to date
docker-compose version 1.27.4, build 40524192

@zeliant how do you edit the detect_objects.py? I tried to install nano but got package not found error.