Giter VIP home page Giter VIP logo

smart-parking's Introduction

smart-parking

A deep learning system to identify vacant and occupied lots in outdoor car parkings.

1. Background

This program implements a Convolutional Neural Network through transfer learning on the Resnet50 model and additional fully-connected layers. The model is trained using the PyTorch library on the CNRPark dataset. The CNRPark dataset was downloaded and sorted into train, test and validation sets irrespective of the weather conditions and camera angles of the overall image. OpenCV is used to read lot video and capture the individual frames. At a regular defined interval, the captured frames are evaluated based on defined lot coordinate values to determine vacant and occupied parking lots. The status is reflected by drawing red and green grids on the video. The evaluated status of the lots can be written to a Firebase Realtime database, and this status can be used to update the Android app at github.com/rnitin/smart-parking-app

2. Dependencies

The programs were evaluated on Python 3.8 with the following versions of the dependencies:
Package Version
torch 1.5.0
torchvision 0.6.0
opencv_python 4.2.0
numpy 1.18.1
matplotlib 2.2.0
pandas 1.0.3
Pillow 7.1.2
Optional Package Version
torchsummary 1.5.1
Pyrebase 3.0.27

3. Executing the Programs

Preparing the programs and the dataset

  1. Clone this repository
    git clone https://github.com/rnitin/smart-parking.git
  2. Prepare the dataset Download the CNRPark+EXT dataset and separate it into training, validation and test sets in:
    ./train/dataset/carpark/training_set/, ./train/dataset/carpark/valid_set/, and ./train/dataset/carpark/test_set/

Training the CNN model

  1. Change the value of model_no each time to determine the result file names.
  2. Execute the python script smartpark-train.py
    python smartpark-train.py

Using the vacancy detection system

  1. Execute the python script smartpark-test.py
    python smartpark-test.py
  2. To evalute a different parking lot video: 2.1 Replace ./test-data/lot.mp4 with the new video 2.2 Identify the top-left and bottom-right coordinates of the individual parking lots present in the video and update the ./test-data/lot-coords.csv file.
  3. (Optional) To upload the evaluated status to Firebase: 3.1 Create a Firebase Realtime database 3.2 Update the values of apiKey, authDomain, databaseURL and storageBucket in the config dictionary of the script. 3.3 Uncomment relevant lines from the update_output function.

4. References and Acknowledgements

CS231n: Convolutional Neural Networks for Visual Recognition
CNRPark+EXT Database
PyTorch
LearnOpenCV

smart-parking's People

Contributors

chokkam99 avatar rnitin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.