r/UofT • u/Wide-Chemical4495 • 6h ago
Rant I refuse to pay for parking at the UTM campus, so I built a dashcam + AI system that automatically buys me a parking pass when enforcement shows up
This won't be a tutorial, I will it not be showing any photos, code, etc. That'll probably dox me. Also photos would show where I park and that's important. Finally, this probably not legal.
For content: At the UTM campus there is parking lots which are mostly patrolled by a White Nissan Leaf with an array of roof mounted LPRs(license plate readers). From my data collection, I have a list of known plates for these LPR cars and I see only the very small lots and a particular sub lot is patrolled by foot. When I refer to AMP park, it is a by hour app which you can purchase at min. a 15 minute parking session for a $1.50ish with a max daily of around 15 dollars. They have a web browser version which is important later on.
So the car drives around the lot and scans the plates of each car close up, as they are pointed down, the car has 4 LPRs on each corner and travels pretty slow.
With most newer dash-cams they have 24/7 parking vehicle detection. If they sense a vehicle they'll record and take a few snapshots of it. The snapshots are quite high quality and on sensitive mode, it takes it quite early in frame.
I realized I could hijack that snapshots and then feed it into a VLM running on my PI(the pi does need to be connected to hotspot for the purchasing script later on). Since it is only a few still frames that are being analyzed, and the actual detection is being done by the dash-cam itself meaning no tokens used for hours of streaming, the token cost is cents and a rounding error basically.
The VLM first tries to find a plate using its built in OCR, usually the only text in the format of a ON plate on screen will be a license plate. As I said earlier on, I found most of the plates that are being used which means I probably have most if not all of the confirmed enforcement plates. The city of Mississauga only has so many cars with LPRs and from my knowledge, currently all look the same(the white Nissan leafs).
If the plate matches my data base. Thats the end of it and it sends a confirmation to a script(I'll talk about it later). If it doesn't see a correct plate, it then checks for color(white), make(nissian), roof rack(as that how a LRPs are mounted) and finally blue color on the side(it's the city text but from that distance and angle it'll just be a blue blob). I did also manually train this VLM with data I collected and online photos of the car. The confidence level for a confirmed output is set quite high.
After the VLM confirms or denies, it sends it's answer to a check, if it's true that there is parking enforcement, it runs a buy script. Thankfully there is a web browser version of the AMP park app which then allows me to go into dev mode to form a headless script instead of having to use an emulator. This saves lots of secs when each second matters.
This is important, kind of the who reason this works. Where I usually park, it's a semi blind spot for the parking enforcement. This means my dashcam is able to see the car around 20-30 secs before the enforcement car sees my plate. It will always be able to see my car but not my plate in time.
My script buys the min. amount of time. The VLM response is almost instant as it's honestly a really easy task for a VLM to see a pretty unique looking car, the payment processing is the bottle neck. I have no way to optimize how they process payments.
TL;DR It's pretty simple. Dash cam detects and takes snapshot -> VLM processing -> checks output of VLM(if confirmed) -> buy script runs
I am working on a human on foot version but that is quite hard as some parking officers on foot don't even wear the city uniform. Pretty hard to confidently choose between a normal person walking in a parking lot and a person ticketing. Currently, I just park in a lot that is known to be large enough that foot enforcement is not viable.
Is spending $900 for a parking pass worth it or building this ridiculous contraption worth it?
As a normal person, no. As a person who's petty. Yes.
This does save quite a lot. I tested this over the last few weeks of summer. Zero False detections as most detections were based off the plate. No tickets, most days only costed a dollar in parking as only 1 check was done. Some days no checks where done. When the normal semester starts, I assume checks will be more often, maybe 2-3 times a day.
If anyone has any clarification questions, I'll be happy to answer. Any repetition of question, I'll just refer you to comments I already did. Not all the details are said here for obvious reasons. The nitty gritty isn't here.