[SUPPORT] blakeblackshear - Frigate


Recommended Posts

image.png.27f30d24af87bac720b628bb9ad305ff.png

 

 

IMPORTANT PLEASE

UPDATE V0.12.0 IS A BREAKING CHANGE:

 

From 0.12 release onwards there will be only one unified app, so it will be recommended to uninstall the current app (either the normal or the nvidia version) and reinstall it to meet the needs of the new template. The old apps will no longer receive updates.

 

PLEASE READ THE CHANGELOG TO UPDATE YOUR CONFIG FILE

 

 

Support for Frigate docker container. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras. Designed for integration with HomeAssistant or others via MQTT.

 

Application Name: Frigate
Application Site: https://github.com/blakeblackshear/frigate

Docker Hub: https://hub.docker.com/r/blakeblackshear/frigate/
Github: https://github.com/blakeblackshear/frigate

Documentation: https://docs.frigate.video/

 

This container is only for AMD64 architecture CPUs (Intel/AMD) and its intended use is with a Coral Edge TPU accelerator to reduce de CPU usage.

 

Make sure to look at the complete documentation available on Github! Any question about the usage of the app and runtime errors please use the github issue page.

 

Post any questions or issues relating to this docker in this thread.

 

PD: To use a M.2 or PCI CORAL instead of a USB Edge TPU install the drivers easily thanks to @ich777 by going to CA Apps and installing the 'Coral Accelerator Module Driver' app. To use a Nvidia dedicate graphics card install the 'Nvidia-Driver' plugin from CA Apps.

 

 

Edited by yayitazale
  • Like 4
Link to comment
On 11/11/2020 at 5:07 PM, whoisdecoy said:

Anyone get this working with the cheaper Mini PCIE Accelerator instead of the USB Accelerator? A bit worried about figuring out PCIe passthrough to docker container. I checked and my cpu does support VT-d

@yayitazale I'd like to know this as well, I'm keen to set this up for use with home assistant but I'd much rather spend £20 on the M.2 Card, Any thoughts?

Edited by Tungmeister
Link to comment

Alright, so i’ve received the mini PCIe card and since I don’t have a mini slot, i’m using a mini PCIe to PCIe adapter.

 

I have it showing up in my PCIe devices:

IOMMU group 8: [1ac1:089a] 01:00.0 Non-VGA unclassified device: Global Unichip Corp. Coral Edge TPU

Does not show up in VM device options:

63c21d15e89e365b96bca5c5462231ed4e4d485e.thumb.png.1605e86fd0fc324947661c727f8fa729.png

Also not seeing anything useful in /dev/:

476029465_ScreenShot2020-11-19at20_31_10.thumb.png.fc5a3024a15408c55342d1f54ea4cc5a.png

Perhaps a custom kernel with drivers? https://coral.ai/docs/m2/get-started#2a-on-linux

 

Getting cheaper in terms of time to return and get the USB version. Anyone have ideas?

Link to comment
  • 2 weeks later...
  • 3 weeks later...

Hi 

 

Did order a USB coral. Today i run shinobi in docker with 6 cams. 
 

Is this instead of Shinobi I mean use Shinobi for recording and this for detection or shall I use this and don’t use shinobi. 
 

My goal here is to record 24/7 and also get object detection with Home Assistant mqtt. Like not home and camera detects person —> send notification and picture. 

Link to comment
7 hours ago, KaptenMicro said:

Hi 

 

Did order a USB coral. Today i run shinobi in docker with 6 cams. 
 

Is this instead of Shinobi I mean use Shinobi for recording and this for detection or shall I use this and don’t use shinobi. 
 

My goal here is to record 24/7 and also get object detection with Home Assistant mqtt. Like not home and camera detects person —> send notification and picture. 

Home Assistant is not intended to record 24/7. For that goal, as you said, Shinobi or Zoneminder are the best options. As far as I know, Shinobi doesn't have any pluging that supporst Coral and TFlite (There is a TF pluging but not a TFlite one). Zoneminder does support CoralEdge TPU, but is not so easy to install and configure all the system.

 

So, at this point, I think you just can use one of them as pure NVR recording 24/7 and then using the same RSTP streams of the cameras run this docker using CoralEdge TPU to achieve the notification automations on HA vía MQTT sensors.

 

Anyway, if you only need to record clips for the detection events and not 24/7, you can achieve that using only this docker by two ways:

 

 

In my case, I'm using HA to pull telegram messages with attached images of the events as you can see here, I'm detecting birds at my balcony when they are close to the feeder I placed there and my cat's movements when I'm not at home.

 

 

 

 

photo_2020-12-14_14-25-14.jpg

photo_2020-10-25_13-33-38.jpg

Edited by yayitazale
Link to comment
  • 1 month later...
On 1/23/2021 at 8:43 PM, pgbtech said:

Not sure if anyone is still interested, but I have the Coral mini PCIE card working in the frigate docker. I had to compile the gasket and apex drivers. It’s far from elegant but I was able to run an insmod on boot in order to load the drivers. So far, so good.

 

Just received my m.2 coral device and struggling to get it working with the frigate docker. Would you mind sharing the steps to compile and load the driver? Thank you!

Link to comment
17 hours ago, DiabloXP said:

 

Just received my m.2 coral device and struggling to get it working with the frigate docker. Would you mind sharing the steps to compile and load the driver? Thank you!

 

I followed a bunch of different guides, but am terrible about documenting. I do have my bash history, so I'll put that below and try and explain. I installed all of the dev-tools plugin options and any other missing dependencies should be in the NerdTools plugin. The only one I manually installed below is bison. You may have to update the linux kernel version in the commands if you aren't on 6.8.3 (kernel 4.19.107) and then the bison package if you aren't on amd64 (note I did have to use the version of bison shown below, the newest version did not work). Worth noting that some of the make commands in there might be unnecessary (again, sorry for my shitty documentation). If you have the apex and gasket modules reporting in the 'lsmod' command, you should be go to go. To fully verify, just check and see if you have the /dev/apex_0 device showing up.

 

First, grab the source from google:

 

mkdir /root/apex/
wget https://coral.googlesource.com/linux-imx/+archive/refs/heads/dkms/drivers/staging/gasket.tar.gz
tar zxvf gasket.tar.gz

 

With the source extracted to /root/apex/, my bash_history mess is below:

 

302  uname -a
303  mkdir packages
304  cd packages/
305  wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.19.107.tar.gz
306  ls
307  mv linux-4.19.107.tar.gz linux-4.19.107.tgz
310  cd /usr/src/
311  mv linux-4.19.107-Unraid/ linux-4.19.107-Unraid_orig
313  tar zxvf ~/packages/linux-4.19.107.tgz
314  ln -s linux-4.19.107 linux
315  cp -rf linux-4.19.107-Unraid_orig/* linux
316  cp -f linux-4.19.107-Unraid_orig/.config linux
317  ln -sf /usr/src/linux/include/asm-generic /usr/include/asm-generic
319  ln -sf /usr/src/linux/arch/x86/include/asm /usr/include/asm
320  ln -sf /usr/src/linux/include/linux /usr/include/linux
331  cd /root/
361  wget http://slackware.cs.utah.edu/pub/slackware/slackware64-14.2/slackware64/d/bison-3.0.4-x86_64-1.txz
362  installpkg bison-3.0.4-x86_64-1.txz
377  cd /usr/src/linux
380  make modules_prepare
381  make modules_prepare M=/root/apex/
382  export CONFIG_STAGING_APEX_DRIVER=m
383  export CONFIG_STAGING_GASKET_FRAMEWORK=m
384  make M=/root/apex/
394  insmod gasket.ko
397  insmod apex.ko
398  lsmod|grep apex
402  mkdir /boot/config/drivers
405  cp /root/apex/gasket.ko /boot/config/drivers/
406  cp /root/apex/apex.ko /boot/config/drivers/

 

To get it loaded on boot, I just added the below to my /boot/config/go file:

 

insmod /boot/config/drivers/gasket.ko
insmod /boot/config/drivers/apex.ko

 

I'm sure there are better, more proper ways to get these drivers loaded, but I didn't really want to compile my own entire kernel to do it. With 6.9, I know they're planning to make driver loading easier via an overlayfs, but I'm not running that OS yet to try it out.

 

If you're running v6.8.3 on a 64-bit system, I can send you the drivers to make it super simple for you.

Edited by pgbtech
typo
Link to comment
On 12/19/2020 at 9:03 AM, KaptenMicro said:

Hi 

 

Did order a USB coral. Today i run shinobi in docker with 6 cams. 
 

Is this instead of Shinobi I mean use Shinobi for recording and this for detection or shall I use this and don’t use shinobi. 
 

My goal here is to record 24/7 and also get object detection with Home Assistant mqtt. Like not home and camera detects person —> send notification and picture. 

 

Updated to v0.8.0 now you can easily use this to detect and record 24/7. See https://blakeblackshear.github.io/frigate/configuration/cameras#247-recordings

Link to comment
4 hours ago, pgbtech said:

 

I followed a bunch of different guides, but am terrible about documenting. I do have my bash history, so I'll put that below and try and explain. I installed all of the dev-tools plugin options and any other missing dependencies should be in the NerdTools plugin. The only one I manually installed below is bison. You may have to update the linux kernel version in the commands if you aren't on 6.8.3 (kernel 4.19.107) and then the bison package if you aren't on amd64 (note I did have to use the version of bison shown below, the newest version did not work). Worth noting that some of the make commands in there might be unnecessary (again, sorry for my shitty documentation). If you have the apex and gasket modules reporting in the 'lsmod' command, you should be go to go. To fully verify, just check and see if you have the /dev/apex_0 device showing up.

 

First, grab the source from google:

 


mkdir /root/apex/
wget https://coral.googlesource.com/linux-imx/+archive/refs/heads/dkms/drivers/staging/gasket.tar.gz
tar zxvf gasket.tar.gz

 

With the source extracted to /root/apex/, my bash_history mess is below:

 


302  uname -a
303  mkdir packages
304  cd packages/
305  wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.19.107.tar.gz
306  ls
307  mv linux-4.19.107.tar.gz linux-4.19.107.tgz
310  cd /usr/src/
311  mv linux-4.19.107-Unraid/ linux-4.19.107-Unraid_orig
313  tar zxvf ~/packages/linux-4.19.107.tgz
314  ln -s linux-4.19.107 linux
315  cp -rf linux-4.19.107-Unraid_orig/* linux
316  cp -f linux-4.19.107-Unraid_orig/.config linux
317  ln -sf /usr/src/linux/include/asm-generic /usr/include/asm-generic
319  ln -sf /usr/src/linux/arch/x86/include/asm /usr/include/asm
320  ln -sf /usr/src/linux/include/linux /usr/include/linux
331  cd /root/
361  wget http://slackware.cs.utah.edu/pub/slackware/slackware64-14.2/slackware64/d/bison-3.0.4-x86_64-1.txz
362  installpkg bison-3.0.4-x86_64-1.txz
377  cd /usr/src/linux
380  make modules_prepare
381  make modules_prepare M=/root/apex/
382  export CONFIG_STAGING_APEX_DRIVER=m
383  export CONFIG_STAGING_GASKET_FRAMEWORK=m
384  make M=/root/apex/
394  insmod gasket.ko
397  insmod apex.ko
398  lsmod|grep apex
402  mkdir /boot/config/drivers
405  cp /root/apex/gasket.ko /boot/config/drivers/
406  cp /root/apex/apex.ko /boot/config/drivers/

 

To get it loaded on boot, I just added the below to my /boot/config/go file:

 


insmod /boot/config/drivers/gasket.ko
insmod /boot/config/drivers/apex.ko

 

I'm sure there are better, more proper ways to get these drivers loaded, but I didn't really want to compile my own entire kernel to do it. With 6.9, I know they're planning to make driver loading easier via an overlayfs, but I'm not running that OS yet to try it out.

 

If you're running v6.8.3 on a 64-bit system, I can send you the drivers to make it super simple for you.

 

Awesome, I used these steps to get my m.2 coral running on 6.9.0. Thank you very much!!! 

Link to comment
1 hour ago, Andrew1 said:

Ive got it installed on unraid but when i try to open the web ui it says connection refused cant connect. Ive already added the port 5000 to my firewall

You don't need to add the port to the firewall if you are only going to connet to the ui on your local lan. The UI doesn't have any kind of security or login so opening the port to the world is a really bad idea.

 

Anyway:

 

  • Did you create a config file before running the container?
  • Is the docker running?
  • Can you post your configuration of your container and the logs?
Link to comment
14 minutes ago, Andrew1 said:

I got it to open the web ui, there was an extra line next to the web port. i now get this error in the log

 

* Starting nginx nginx
...done.
Error parsing config: expected '<document start>', but found '<block mapping start>'
in "<unicode string>", line 5, column 1:
detectors:
^

config.yml 7.22 kB · 0 downloads

 

Some of those items in the config look like they are from the older version config and will not work. Try starting with the minimal config from here: https://blakeblackshear.github.io/frigate/configuration/index

 

Once you get it running start adding in the cameras and object tracking one by one.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.