Live data from Hacker News

I built a DIY license plate reader with a Raspberry Pi and machine learning

towardsdatascience.com

61–70 of 78 posts

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#61
post #4

The solution described in the blog uses 12 Nvidia T4s, which are basically specialized RTX 2080s. Depending on what vCPUs etc. get used, it's running 1000-1500 W of computing power continuously. If their car was electric, this project would be increasing the power consumption of the vehicle by around 10%.

I may have missed something, but I believe the T4s are running in the cloud, so it wouldn't have any effect on the car's power consumption.

For a project that's intended to be a part of a car, cloud only makes sense for prototyping. 900 ms latency? Uh-oh.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#62
post #48

What are the privacy implications of this? For example, in the EU under GDPR, would you really be allowed to collect information on, for example, license plates, time and location? It seems to me that you could argue that license plates are "personally identifiable information" and collecting this type of data could, with or without intention, mean that you are collecting data on people's whereabouts.

Not every plate may idenfity a person (cars can be owned by companies and used by different employees and so on), but a significant number of cars is owned and driven by a single private owner. You can't easily discern if a license plate does or does not map to one individual, thus if you can't prove that the license plate does not map to a specific person, you should assume it does.

Thus the license plates can easily be argued they are PII.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#64
post #39

Surprised by the negativity in the comments. This is an extremely impressive presentation of ability to put together current technologies and get the thing working front start to finish. A+, would hire.

The reason for the negativity is that this demonstrates the "Design by StackOverflow" mentality where the solution is like swatting a fly with a sledgehammer and no real domain knowledge. Plus the author didn't even train the neural nets: it's just a LEGO project. I'd higher this person to be a lab intern, but nothing above that. The fact the author couldn't solve it locally and had to invoke the CLOUD is... laughabl…

TL;DR: reinventing wheels is a good way to learn a lot.

For trying out something in a few hours, of course you don't want to spend hundreds of hours setting it up, by definition. Yes, the result is "just about works, but doesn't scale" - but that's the point of experimenting. Sure, this is a LEGO-style experiment in reinventing the wheel, but exactly for that, an excellent way to start learning about this problem domain: power consumption? Latency? ML basics? Sure. That's hacking at its core - even though the project is rudimentary.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#65
post #54

Ok, I have a use case for this. If you could figure out how to get it off the cloud and low power, it would be awesome to have one of these on the gates to my house, so when I drive up the plates are automatically recognized and the gates open to my car.

The best password is the one written in plaintext on the outside of your car.

Don't rely on garage openers for security, either: the door relies on a rather simple password scheme. In other words, treat it as a garden fence, not a blast door.

https://www.geek.com/gadgets/a-32-hacking-tool-can-open-your...

(Perhaps recognizing the car's license plate plus MAC address would be more secure...? Many cars use BT/WiFi nowadays.)

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#66

Epic work, well done! What FPS you getting out of it?

Creator here. I get about 30FPS. The more compute power you throw in, the higher the framerate.

It's really buttery smooth if I disable the recognition part and just leave in the detection. Since it's demo project (something I just wanted to experiment with), my focus hasn't been on optimizing it. Lots of improvements could be brought to it.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#67
post #36

Earlier quoted context omitted.

Disgusting, indeed. But as long as these links are accepted here, nothing won't change. Take this in the meantime: https://outline.com/qsv7ab

Would be great if we could have built-in Outline support on HN, or some kind of bot commenting a link automatically when someone posts a story with a paywall. Just throwing an idea out there. :)

That's a great idea actually! @dang are such bots allowed in HN? I can roll it out pretty easily with Monitoro (https://monitoro.xyz) and would be happy to cover the costs.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#68
post #27

Earlier quoted context omitted.

I'm the creator here. Yeah, 20 K80s is a bit excessive. That's because cortex (cortexlabs), which is the ML-model-deployment platform didn't initially have multiprocessing on each of their replicas - so I was bound to using just one CPU per GPU. AWS has instances with 4, 8, 16 vCPUs and so on. Once cortex started supporting gunicorn (still yet unreleased but present on their master branch), I was able to reduce the n…

Consider using a smaller, lighter-weight network (e.g. TinyYOLO) and object tracking (instead of running inferences on every camera frame) for faster throughput -- I imagine you should be able to get through with You can also customize the network to your use case, e.g. you don't need YOLO's default 5 anchor box sizes if you know the thing you're detecting is a license plate. Also, profile your code and see where you…

I like all of your suggestions. I've been thinking about using TinyYOLOv3 as well. Provided the training set is considerably bigger than my own (I've created about ~550 samples and fine-tuned the model with them), you could end up with a very capable detection system that uses very few resources.

Object tracking is yet a very good idea. I will consider it. Anchor-box tuning is another very good idea.

Also, the CRAFT text detector that I'm using should IMHO be removed. Instead just use a very well trained text recognizer (like the CRNN I'm using). The text detector is expensive computationally since it's based on the VGG-16 model.

Then convert the models to use mixed-precision.

All in all, I think the performance improvements can be anywhere between 1 and 2 orders of magnitude.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#69
post #47

Earlier quoted context omitted.

I'm the creator here. Yeah, 20 K80s is a bit excessive. That's because cortex (cortexlabs), which is the ML-model-deployment platform didn't initially have multiprocessing on each of their replicas - so I was bound to using just one CPU per GPU. AWS has instances with 4, 8, 16 vCPUs and so on. Once cortex started supporting gunicorn (still yet unreleased but present on their master branch), I was able to reduce the n…

I believe you may achieve the same result locally using https://github.com/openalpr/openalpr and cut your AWS and cell bills to exactly zero. It has Tesseract and OpenCV inside. Would love to see it as a part two of the article!

I've come across that. And it looks awesome! Might give it a chance, why not. I see Tesseract's OCR engine is based on LSTM networks.

Re: I built a DIY license plate reader with a Raspberry Pi and machine learning

#70

"Machine Learning" is the wrong tool for the job here. Tesseract OCR can do this, using only the Raspberry Pi, at a "good enough" framerate for any real driving situation.

Tesseract really baaaad imo

Why is it bad?
Post reply on HN