Skip to content

danielbob32/ParkingSpace

Repository files navigation

License


index

ParkingSpace Parking Spots Detector

YOLOv8 based parking detection system using a RTSP camera.

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Install and Setup
  3. Walkthrough
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Learn More
  9. Data
  10. Acknowledgments

About The Project

Finding parking spaces has become increasingly challenging in densely populated neighborhoods, where the number of cars is growing rapidly. This task not only frustrates drivers but also contributes to traffic congestion as unsuccessful searches add unnecessary delays to journeys. What if there was a solution that could streamline this process?

Introducing ParkingSpace, a Python-based system leveraging YOLOv8 and real-time streaming protocol (RTSP) cameras to revolutionize parking spot detection. Developed as a project during my computer science degree, under the guidance of Prof. Roi Poranne, ParkingSpace aims to alleviate the parking woes encountered in urban areas.

The Challenge In bustling neighborhoods, the hunt for a vacant parking spot can be maddening. It not only consumes valuable time but also exacerbates traffic congestion as drivers circle blocks in search of elusive spaces. This frustration inspired the creation of ParkingSpace, a solution designed to make urban parking more efficient and less stressful.

The Solution By harnessing the power of computer vision and YOLOv8, ParkingSpace identifies empty parking spaces in real-time, even within undefined parking areas. This innovative algorithm detects available spots, allowing drivers to make informed decisions about where to park without aimless circling. With ParkingSpace, navigating crowded streets becomes more manageable, reducing overcrowding the street and enhancing the overall urban driving experience on the way home or any other destination.

(back to top)

Getting Started

Install and Setup

This will help you to get started with ParkingSpace if you want to run and experiment with the default street provided. For more complex changes and setting it to work on other input, please refer to the references section.

Prerequisites

It's highly suggested to run the program on a CUDA-compatible NVIDIA video card, although this version manages to use CPU, use at your own risk! You can find more information about installing CUDA here. You need 2.5 GB of space to run the demo version.

YOLOv11 and CUDA 11.7 Updates!

ParkingSpace now supports YOLOv11 with CUDA 11.7 and Python 3.8. This version has been tested and optimized with the following package versions:

PyTorch 1.13.1+cu117

Torchvision 0.14.1+cu117

Torchaudio 0.13.1+cu117 To install these specific versions, use the following command:

pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117

CUDA Installation To install CUDA 11.7:

Download the installer for your operating system from the NVIDIA CUDA Toolkit Archive. Follow the CUDA installation guide for your OS (Linux/Windows/macOS). After installation, ensure that your system’s environment variables are correctly set for CUDA_HOME and PATH. Once installed, verify the installation with:

nvcc --version

You should see CUDA version 11.7 in the output.

Dependencies

Note that ParkingSpace requires python >= 3.8. Before starting, creating a virtual environment is recommended. Vscode guide on how to is linked-here. Some of the Dependencies will be installed with ultralytics.

pip install ultralytics
pip install opencv-python
pip install numpy

To run with ipython (highly recommended) install:

pip install jupyter
pip install ipython

Installation

Clone the repo:

git clone https://github.com/danielbob32/ParkingSpace.git

As for now, you should have every thing you need to run the demo with your machine and get to know the system by adjusting the parameters.

(back to top)

Walkthrough

On the first run, after you opened a virtual environment and installed all the dependencies the model it-self will be installed, which will take some time depends on your machine. You will might need to re-run the code to actually start it.

If everything works, about 15 seconds after running the cell you should get the first frame, Congratulations! Note that this is not showing a live video and set to a specific interval, you can always reduce it to see live footage if your machine can handle it.

image

A window will pop-up and you will able to see the parking spots that are being processed every 15 seconds or so.

Screenshot 2024-05-02 000605


Note that the model is really heavy to assure the maximum accuracy, if you find the program crashing you can do the following steps :

  1. Extend the sampling intervals.

image

  1. Reduce the model resolution.

image

  1. Reduce the model accuracy.

image

_For more options and development, please refer to the references section.

(back to top)

Roadmap

  • Add step-by-step template to init the system anywhere.
  • Make a solid web-app version.
  • Future development:
    • Self region assignment system.
    • Plug'n'Play.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the Apache License, click here for more information.

(back to top)

Contact

Daniel Bobritski - danielbob32@gmail.com

Project Link: https://github.com/danielbob32/ParkingSpace

(back to top)

Learn More

If you are interested in learning more about how to apply ParkingSpace to your use, develop and more, please check the quicklinks below.

Section Description
How To's
Home Setup Here will be an in-depth guide on how to setup a home system.
How to Record the data Here will be a quick guide on how to acquire your own data.
🖱️ Developers
Training the system Here will be a guide on how to train the system on your own data.
Effective Regions Here will be a guide to choosing the right regions.
Contributing Walk-through for how you can start contributing now.
💚 Community
Discord Join our community to discuss more. I would love to hear from you and assist!

(back to top)

Data

The data that has been used is kindly listed bellow.

Section Description
🖼️ Raw Data
Raw Images Set of raw images snipped from the live videos.
Augmented Images Augmented data set of the images above to enrich the Probability map (save tracking time.)
🖌️ Processed Data
Segmented Images YOLOv8 segmented images .
Binary Masks Binary masks made out of the segmentation.
Probability Map Grey-scale probability map constructed out of the binary masks.

Acknowledgments

(back to top)