Local realtime person detection for RTSP cameras

This is also happening to me. After 4-6 weeks I just find the container has stopped itself or is unresponsive. Though I haven’t had to unplug the Coral, I just restart the container. I have never caught it in the logs before it was too far gone to access so I’m not sure what’s causing it.

JFYI, Coral is now out of Beta:

New, cheaper form factors also available. $35 for the M.2/Mini PCIe versions!

James

2 Likes

This is actually pretty sad, i bought the USB version few days ago. Dang it, M.2/miniPCI-e would be much suitable for me and it’s even half of the price. :grin:

1 Like

Guys, please buy this man more coffee. His software is great. https://ko-fi.com/P5P7XGO9

1 Like

Any luck getting object detection working with this?

Thanks for this tip. It helped me get the Coral working with Proxmox.

I had attached the Coral with " Use USB Vendor/Device ID" and I couldn’t get it to work. Then I switched to “Use USB Port” and I was able to get Frigate up and running within Portainer running under Proxmox.

Update on this. While I was able to get the Coral into Docker on Portainer, I was unable to get hardware acceleration for ffmpeg routed through, so I ended up having the create an LXE container directly on Proxmox, manually install Frigate (based off steps in Dockerfile), and configure permissions/devices using the Proxmox config files. Some snippets below without proper context or instructions, though. This is on an Intel NUC8.

/etc/pve/lxc/108.conf additions for container 108 (based on https://forums.plex.tv/t/pms-installation-guide-when-using-a-proxmox-5-1-lxc-container/219728):

lxc.cgroup.devices.allow: c 226:0 rwm
lxc.cgroup.devices.allow: c 226:128 rwm
lxc.cgroup.devices.allow: c 29:0 rwm
lxc.autodev: 1
lxc.hook.autodev:/var/lib/lxc/108/mount_hook.sh
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/004 dev/bus/usb/004 none bind,optional,create=dir

/var/lib/lxc/108/mount_hook.sh:

mkdir -p ${LXC_ROOTFS_MOUNT}/dev/dri
mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/card0 c 226 0
mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/renderD128 c 226 128
mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/fb0 c 29 0

Hope this helps someone.

5 Likes

Hey, I’ve been having a funny situation lately… It’s been recognizing my table as a human… Usually it’s just below the detection threshold, but if a cat comes along and adds legs to it (they make the rounds every night), then it gets high enough to send me an alert at night.

Maybe a max_person_area would be a good idea? I think it would work in this case.

Before cat:

After cat:

2 Likes

I would like to save All the detection images to file. Preferably like /detections/camera_date-time.jpg.
Movie is OK but I think require scrutiny of value vs image due to file size. Many movie file potentially fill disk but many image not make big deal.

Is there any method I might use to do this outside of HA automation?

I see this “Output movie clips of people for notifications, etc”. Is this related to my above question?

yes it helps!
I have been running a few cams on a ancient Q6600 CPU. With Proxmox LXC. Yes it gets quite hot.

m.2 slot for the coral is perfect

I see error below in logs.
MQTT not really returning images or messages. (pretty much not working)
This is with and without hardware acceleration and (2) different machines.

Latest docker image
Ubuntu 18.04

ideas?

ffmpeg didnt return a frame. Something is wrong. Exiting capture frame...

EDIT
the web streams seem OK

It’s not able to read the stream. Make sure you can connect to the URL you are using with VLC.

Is the threshold the ratio of changing pixels of a specific region? Like, threshold: 0.5 means that 50% of that region’s pixels need to change from one frame to the next for the script to continue?

Is the threshold the minimum level of detection for a person or for any kind of object? Is it possible to define which objects should be detected (like only car, person)?

It’s the threshold for detecting any object type, but only persons are reported. I could make this configurable by object type when support for other types is added.

Any plans to allow for configurable maximum object size and/or minimum confidence?

1 Like

Threshold is the minimum confidence. I do plan to add max size as well.

2 Likes

Hi Blake,

By adding -e DEBUG='1' to the docker run command I don’t see anything populating the log folder (which is mounted correctly) and I don’t see any debug messages on screen. Is there anything else I need to do?

Here is the complete command:
sudo docker run --rm --privileged -v /dev/bus/usb:/dev/bus/usb -v /home/j/frigate/config:/config:ro -v /home/j/frigate/debug:/lab/debug:rw -p 5001:5001 -e RTSP_PASSWORD='xxxx' -e DEBUG='1' frigate:latest

sweet!

@blakeblackshear
Will these work with a simple run-time argument change using the dev pci path to the device instead of the usb path?

I would assume yes, but I haven’t tried.

Is there a typo in the commented out ffmpeg acceleration args in the sample config file? I have been running frigate for months successfully, but I tried uncommenting them for the first time today and started getting a concatenation error.


Creating a new ffmpeg process...

    main()

  File "detect_objects.py", line 62, in main

    camera.start()

  File "/opt/frigate/frigate/video.py", line 255, in start

    self.start_or_restart_capture()

  File "/opt/frigate/frigate/video.py", line 230, in start_or_restart_capture

    self.start_ffmpeg()

  File "/opt/frigate/frigate/video.py", line 247, in start_ffmpeg

    self.ffmpeg_output_args +

TypeError: can only concatenate list (not "str") to list

I see a few have strange double dashes with a space in-between on github.