Local realtime person detection for RTSP cameras

Try specifying width and height parameters directly in your camera config.

Actually, that looks like an old version.

What makes you say that? Here is my docker run command:

docker run --rm --privileged --shm-size=1g -v /dev/bus/usb:/dev/bus/usb -v  /home/xxxxx/frigate_config:/config:ro -v /etc/localtime:/etc/localtime:ro -p 5000:5000 -e FRIGATE_RTSP_PASSWORD='xxxxxx' blakeblackshear/frigate:0.5.0-rc2

Here is my image list:

 REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
frigate                   latest              c6cd47f62393        29 minutes ago      1.05GB
blakeblackshear/frigate   0.5.0-rc2           b85e654281b3        3 hours ago         1.29GB
<none>                    <none>              d264ad68304d        21 hours ago        1.29GB
blakeblackshear/frigate   0.5.0-rc1           85f281231df0        26 hours ago        1.29GB
<none>                    <none>              38abad9bd2a1        2 weeks ago         901MB

Tried including the height and width as well…no joy.

Your screenshot has a region box and the FPS on it. The new version does not have that.

Sorry, you are correct - I posted the wrong screenshot. Here is the right one and the issue still persists:

Yes, it is portainer. I’ll look for the place to set shm-size in portainer.

Have any previous versions worked for you? It seems like ffmpeg isn’t decoding your video properly.

Can you compare the ffmpeg commands in the logs between the two versions to see if there are any differences? I confirmed that the same version of ffmpeg is being used in both versions.

So it looks like 0.4 also is giving me similar error to 0.5 but it does work with 0.3. The FFMpeg commands are pretty much the same but I did see that 0.3 had “INFO: Initialized TensorFlow Lite runtime.” where as 0.4+ did not have anything. Again, appreciate all the help here.

Edit: 0.4 was working the other day now I am not sure what has changed.

Hoping this doesnt affect Unraid users. One way to find out…

What is the resolution of your camera?

I received my Coral today, plugged it in and restated Frigate.
Previously I would get the following since I wasn’t using a TPU

No EdgeTPU detected. Falling back to CPU.

I no longer receive that so it seems safe to assume that the absence of that message means it’s using the TPU.

So far things seems to be more responsive.
It did die once… the CPU went back done to practically nothing and it stopped reviewing the feed.
I had turned the logging back down so I couldn’t see anything when it died.
I’ve turned it back to be more verbose and I’ll report back if I see it die again.

BTW… this is on a Synology

The Coral will almost always show inference speeds at 8-50ms when you check /debug/stats. CPU speeds are more like 300ms at best.

1 Like

Thanks blake, 0.5.0-rc2 seems to work fine on my side. The labels that “smudged out” seems fixed.

I do get a glitch every now and then with one camera though:

2020-02-23T19:37:45.528872824Z Process Process-8:
2020-02-23T19:37:45.530555271Z Traceback (most recent call last):
2020-02-23T19:37:45.530602200Z   File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
2020-02-23T19:37:45.530621151Z     self.run()
2020-02-23T19:37:45.530646312Z   File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
2020-02-23T19:37:45.530656836Z     self._target(*self._args, **self._kwargs)
2020-02-23T19:37:45.530666615Z   File "/opt/frigate/frigate/video.py", line 349, in track_camera
2020-02-23T19:37:45.530676275Z     object_tracker.match_and_update(frame_time, detections)
2020-02-23T19:37:45.530685897Z   File "/opt/frigate/frigate/objects.py", line 66, in match_and_update
2020-02-23T19:37:45.530695362Z     for id, obj in self.tracked_objects.items():
2020-02-23T19:37:45.530706365Z RuntimeError: dictionary changed size during iteration
2020-02-23T19:37:48.923366804Z Process for cat_cam is not alive. Starting again...
2020-02-23T19:37:48.927897510Z Camera_process started for cat_cam: 195
2020-02-23T19:37:48.931613961Z Starting process for cat_cam: 195

Edit: OK I get it for the others too when it starts detecting objects.

2020-02-23T19:49:32.222146720Z Process Process-7:
2020-02-23T19:49:32.223945015Z Traceback (most recent call last):
2020-02-23T19:49:32.223968589Z   File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
2020-02-23T19:49:32.223979864Z     self.run()
2020-02-23T19:49:32.223988576Z   File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
2020-02-23T19:49:32.223999046Z     self._target(*self._args, **self._kwargs)
2020-02-23T19:49:32.224008140Z   File "/opt/frigate/frigate/video.py", line 349, in track_camera
2020-02-23T19:49:32.224017745Z     object_tracker.match_and_update(frame_time, detections)
2020-02-23T19:49:32.224028797Z   File "/opt/frigate/frigate/objects.py", line 66, in match_and_update
2020-02-23T19:49:32.224034957Z     for id, obj in self.tracked_objects.items():
2020-02-23T19:49:32.224040696Z RuntimeError: dictionary changed size during iteration
2020-02-23T19:50:00.992220396Z Process for front is not alive. Starting again...
2020-02-23T19:50:00.996596238Z Camera_process started for front: 142
2020-02-23T19:50:01.000017862Z Starting process for front: 142

I’m seeing these errors as well - running on a nuc i7 with coral.

Yea. I found that and have fixed it in the dev image if you want to try that before I can push up rc3.

Currently it is at 1024x576. I can change it to 1920x1080 or 640x360.

Got it up and running. Thanks for the help @blakeblackshear. Quick question…is the new motion detection on by default? The reason I switched from motion to tensorflow was due to f+ and f- with motion. With my hardware I would rather just analyze every frame. I can’t really tell if it’s still doing that.

It is using tensorflow to check for objects. There shouldn’t be any f+ or f- due to motion alone. It is only used to determine where to check for objects.

Not the end of the world – if it is only affecting the debug view (Which I was of course playing around with tonight).

I am unfortunately also getting these:

2020-02-23T21:11:06.028522973Z Last frame for front is more than 30 seconds old...
2020-02-23T21:11:06.029026182Z Waiting for process to exit gracefully...
2020-02-23T21:11:06.042370333Z Process for front is not alive. Starting again...
2020-02-23T21:11:06.045092171Z Camera_process started for front: 988
2020-02-23T21:11:06.045247686Z Last frame for cars is more than 30 seconds old...
2020-02-23T21:11:06.045263907Z Waiting for process to exit gracefully...
2020-02-23T21:11:06.047821768Z Starting process for front: 988
2020-02-23T21:11:06.054550169Z Process for cars is not alive. Starting again...
2020-02-23T21:11:06.057741338Z Camera_process started for cars: 991
2020-02-23T21:11:06.060736678Z Starting process for cars: 991

I did increase the framerate of the cameras a little bit, which I will undo. In the stats endpoint the Coral FPS has fallen to 0 and on the TPU itself the light is constantly flashing (not the “pulsing” it usually does).