Show HN: Build a DIY license plate reader with machine learning
github.com
github.com
I’m Caleb, and I’m a maintainer of Cortex, an open source model deployment platform. Not long ago, we published this DIY license plate reader project, and I wanted to share it here for anyone who is interested in computer vision or production machine learning in general.
The project is a web service that accepts images and, using three trained models, returns extracted license plate text, assuming there is a license plate in the image. Of the models used, two are pre-trained models from keras-ocr, while one is a fine tuned YOLOv3. All models are freely available.
You can see a video of the project in action here: https://www.youtube.com/watch?v=gsYEZtecXlA
And read a write up by Robert Lucian, the maintainer who spearheaded this entire project, about how he built a camera system to interface with the web service using a Raspberry Pi and 5G: https://towardsdatascience.com/i-built-a-diy-license-plate-r...
The longer answer is that this project has a ton of room for optimization, some of which is mentioned in the repo, and with lower latency requirements + optimizations, I don't see why it wouldn't work on less powerful hardware (I've never personally worked with the Jetson Nano, so I don't want to speak with any false confidence on it specifically).
https://www.freecodecamp.org/news/remember-that-86-million-l...
For anyone else wondering, he used a Raspberry Pi and a mobile internet connection. Any number of G's will do.
What if you had a child read off every license plate they see and use voice recognition to record the license plates?
Is it illegal in real time, but allowed if you replay your dashcam footage later?
https://camo.githubusercontent.com/5138d6bce5c840d15e533db6f...
Recognizing that something is a license place, and being able to read the plate are mutually exclusive things. People can identify license plates even if they can't read them, and people who don't know what a license plate is my still be able to read the numbers on them.
The ML has to do two things; the first is reject anything that isn't a License Plate, the second is OCR License Plates.
For example, if I built a model that always returns the same plate number, it would be 100% confident, but wrong 1947791 times out of every 1947792 plates it sees.
That said I would have thought confidence would be lower for plates with 5 and S in it.
Also, humans aren’t perfect at reading plates from highway footage still images - which is why ANPR systems are never 100% accurate.
If you showed it to and asked a string of randoms off the street, I think way more than half would agree with the "DIY Alexa" label as reasonably communicative description and more useful than a longer but more precise title.
Often the video footage is not good enough to get a plate because the capture settings are set lower so that more footage can be stored.
They can, for example, have a camera in all the cruisers, and automatically alert when a nearby car has an expired registration, inspection, etc. Or, if they have the tie-ins, registered to an owner with an open warrant or unpaid traffic citations.
[1] https://en.wikipedia.org/wiki/Automatic_number-plate_recogni...
At the very least running local inference becomes much more expensive, and possibly provides worse results.
[1]: https://www.freecodecamp.org/news/how-i-replicated-an-86-mil...
Even with ALPR retention restrictions, I could trigger a video save and send the police a video of the idiots doing 50mph through the residential neighborhood.
When the reader triggers and takes a picture, it pings your server for a timestamp. It does the processing and records car X at time T provided by the timestamp. You then calculate the speed by the distance between the two meters divided by the time between the two timestamps for X.
Provided that speeding cars are a problem in your neighborhood, I bet you could find the people responsible for the light poles (which likely have power associated to them) to let you install the devices, especially if you're providing the devices and servers.
I don't think you'd necessarily be able to ticket the drivers though, as you're not law enforcement. Maybe you'd be able to work with local law enforcement though.
Maybe I could work with a neighbor, but then things need to be tightly time-synced.
Zero chance I could get light pole access. A city endorsed surveillance system? No way.
I'd maybe like to know if it detects the plates of people I know well nearby (sometimes I wonder when I see a car I feel I recognize), and I'd want to be able to mark bad drivers I see, and be warned if they come near my car again.
My thought is that if I am driving around a driver bad enough that I think about the risk of accident, I might want to know if they're close to me again in the future.
Yes, I get the technical appeal. I wish we all wondered less if we could, and more if we should.