Sudo Find Me a Parking Space; Machine Learning Ends Circling the Block

If you live in a bustling city and have anyone over who drives, it can be difficult for them to find parking. Maybe you have an assigned space, but they’re resigned to circling the block with an eagle eye. With those friends in  mind, [Adam Geitgey] wrote a Python script that takes the video feed from a web cam and analyzes it frame by frame to figure out when a street parking space opens up. When the glorious moment arrives, he gets a text message via Twilio with a picture of the void.

It sounds complicated, but much of the work has already been done. Cars are a popular target for machine learning, so large data sets with cars already exist. [Adam] didn’t have to train a neural network, either–he found a pre-trained Mask R-CNN model with data for 80 common objects like people, animals, and cars.

The model gives a lot of useful info, including a bounding box for each car with pixel coordinates. Since the boxes overlap, there needs be a way to determine whether there’s really a car in the space, or just the bumpers of other cars. [Adam] used intersection over union to do this, which is conveniently available as a function of the Mask R-CNN model’s library. The function returns a score, so it was just a matter of ignoring low-scoring bounding boxes.

[Adam] purposely made the script adaptable. A few changes here and there, and you could be picking up tennis balls with a robotic collector or analyzing human migration patterns on your block in no time. Or change it up and detect all the cars that run the stop sign by your house.

Thanks for the tip, [foamyguy].

27 thoughts on “Sudo Find Me a Parking Space; Machine Learning Ends Circling the Block

  1. Municipalities could hook this up to their street cams and you could check into a service looking for spaces once you cross into a geofence for your destination.
    The trouble is, if one two or more cars use the service, they’ll all converge on the same spot! Because this is America, you’d obviously start an auction for the spot and the winner would park there when it wins the spot. The city’s cam would of course pick up the license plate and debit your parking account. It would also time your car’s parking to the second and prorate the parking fee.
    Or you could walk or take the bus!

    1. Cameras around the city upload parking space data to the web,
      Data is processed on a server.
      Server spits out map of city on web with vacant parking spaces.
      Driver uses mobile phone to access the web and view the map.
      Drive car to parking space.
      Fight to the death with other drivers trying to use the same parking space.

      1. Hah. Maybe a little less chaotic: driver selects a parking space and it’s reserved (not shown to other users) for 5 minutes, giving the driver time to park. Concert halls do that for seat reservation – if you don’t pay within a few minutes then the seats you picked go back into the pool.

        1. Cue people trolling and reserving every parking space in a 3 mile radius every 5 minutes and angry fights over people not giving a toss about a reservation and just parking in the spot when it becomes free.

          1. Blah blah tragedy of the commons blah blah must raise prices because the plebs can’t control themselves blah blah why don’t the poor just stop being poor- 1 percenters probably.

      1. It’s called regional cities/towns.
        Screw the big cities where can’t park can’t get anywhere too many people and no personal space .

        If I have stop at an intersection on my commute that’s a bad trip into work. God forbid if I have to park any further than right out the front of my office.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.