blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
16.06k stars 1.51k forks source link

FR: Text recognition (leading into ANPR/ALPR) #2390

Open geftactics opened 2 years ago

geftactics commented 2 years ago

Describe what you are trying to accomplish and why in non technical terms It would be great enhancement to Frigate if it could recognise text, in turn leading to the ability to read car registration (or licence) plates, and in turn link these into home assistant automations. (ANPR/ALPR essentially)

Describe the solution you'd like A new object type for 'text', or it might justify its own top level config at the same level as objects. Reuse of existing frameworks for masking, or filtering detections to a certain zone. Part of the config could allow for a regular expression to be applied, so that we have an increased chance of getting the correct text vs a mis-read.

Describe alternatives you've considered Looked at OpenALPR, but not had much joy. Development and progress is limited (I have a PR open for 2.5yrs πŸ‘Ž )

Additional context Appreciate this is isn't a small or easy to implement feature, but would certainly take Frigate to the next level! I did look through existing open/closed issues but couldn't find much related to text detection.

sollie commented 2 years ago

Could anything from https://github.com/stevefielding/tensorflow-anpr be utilized for this?

I just started looking at Frigate, so I have no idea if/how the above could fit, but it seems to do what is asked for. I guess training for more than US plates would probably be needed.

bagobones commented 1 year ago

It looks like it is possible to get coral accelerated OCR with some conversions..

https://phurich.medium.com/ocr-based-on-deep-learning-implemented-on-raspberry-pi4-with-coral-usb-accelerator-fb6f6a933850

Would be nice to do a sub detection on cars for words like amazon / UPS / ice cream ;)

atv2016 commented 4 months ago

I don't think you need training for anything, just OCR. I see several times that platerecognizer just recognises text from the camera overlay, or from other text in the image. I think the problem now is that it's looking for license plates, so if one removes that part it should just process the whole image.

NickM-27 commented 3 months ago

I wrote a guide on doing this in home assistant https://github.com/blakeblackshear/frigate/discussions/8165