-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Add support for opencv-based object detection #2864
Comments
I just ordered a Coral TPU from the one place that would actually accept an order and they quoted a 46 week wait time! Every place is backordered. It looks like having alternatives to use the GPU is going to be essential for the next year or so. |
After looking at the frigate code a little bit it occurred to me that this feature could be GREATLY simplified by implementing this as a feature to call an external REST API for object detection. I previously used a project called mlapi (https://github.com/ZoneMinder/mlapi) with ZoneMinder and it basically exposes object detection with opencv and GPU support via such an API. There really isn’t anything ZM specific to what it does and it seemed to be actively maintained for the few years I used it. Setting up mlapi isn’t simple and usually involves compiling stuff specific for your GPU card. But the upside is that the messy part doesn’t become part of Frigate but leverages an existing open source project. Something to think about… |
It will probably be too slow. Frigate is fast because it works with the same decoded frames in memory across the entire pipeline. If you have to copy, convert, and call a 3rd party service, you probably arent going to get much better latency than running CPU detectors when it's all said and done. If I was going to support this, it would probably use doods. |
Yeah that makes sense. I thought about the speed issue. I am just more concerned with managing my CPU usage at the moment until I can snag a TPU. I think the way it worked with ZM is that it may have only checked the frame with the 'most' motion in an event or the frame that triggered the alarm but I always felt that it was hackish in the way it was done. Object detection was an afterthought and not integrated into the pipeline. |
I may look at adding some configuration options to tone down the object detection a bit. Frigate is currently built around the assumption that it has access to a Coral that can run it fast without much overhead. |
Describe what you are trying to accomplish and why in non technical terms
Opencv is capable of performing its own object detection, and can load a variety of model formats. Adding this would allow object detection acceleration on other hardware than just coral/nvidia (such as opencl and vulkan).
Describe the solution you'd like
Using the object detection example from opencv, create an object detection implementation that uses opencv rather than tensorflow, and add options in the configuration to use the opencv detector rather than the tensorflow detector. This should be able to be done on the 'cpu' version of frigate, as long as the opencv dnn module is included.
Describe alternatives you've considered
This is adding alternatives for object detection in tensorflow, allowing more users to use hardware acceleration.
Additional context
Opencv currently does not support loading tflite files. One would need to obtain alternative model files at the moment
The text was updated successfully, but these errors were encountered: