Smart parking for future using Open CV and Deep learning AI

Akshay Bhor ..an Data Scientist
3 min readFeb 25, 2020
Smart parking using Artificial Intelligence (AI)

Sometimes ,it is very difficult to find parking to park vehicle.

what we can do ????

think ,think and Think..

we got an solution …Use deep learning to find where we can park our vehicle …

Lets, divide the smart parking problem into bit of sections.

  1. Get the Rough view of the Parking image and fix parking spot as they are continue to be remains constant.
  2. Generate the Training Data to train the model from parking images for classification of empty and occupied space
  3. Run the pre-trained Model on Training Data and obtain accuracy above 95%
  4. Save best model weights
  5. Predict empty or occupied parking on the given image
  6. Run prediction model on the video

Lets,Start….

Note: Dont forget to visit my github profile for the same project,where i uploaded all the files,in this blog i only shown the important code not all…Link:

https://github.com/akshayashokbhor/smartparking

1.Get the Rough view of the Parking image and fix parking spot as they are continue to be remains constant.

To,generate the fix parking spots ,we need to define the end co-ordinates of the parking lot

I wrote following code to generate parking spots…

given ,end coordinates of the parking lot

2.Generate the Training Data to train the model from parking images for classification of empty and occupied space

To ,generate the data i collect multiple parking images for an interval of time and then from that images i get the training data containing all individual image of parked and non parked vehicle

and then i classify that data into train and test and further empty and occupied

To generate the data i wrote the following code…

Note:Here we are making this problem as 2 class classification problem

Occupied Parking
Empty Parking

3.Run the pre-trained Model on Training Data and obtain accuracy above 95%

Then ,after data augamentation i used pretrained Resnet-50 and VGG16 model on training data and run then model

plotted accuracy and loss curve

accuracy and loss curve

4.Save best model weights

save the best model weight and reuse for prediction

5.Predict empty or occupied parking on the given image

i also run code on video,

for further doubt you can visit my github profile,where i have uploaded all model script along with the trained model ipynb

link is: https://github.com/akshayashokbhor/smartparking

Final result i get is,….

Final result showing empty and occupied parking spot

Blog By:

Akshay Bhor: Deep learning Engineer

an Data Scientist

--

--