Skip to content

Yasouimo/Parking-Recognition-System-2-Bellmir_Chegdati

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ…ΏοΈ Parking Space Recognition System

An intelligent computer vision system that detects and classifies parking spaces in real-time using machine learning algorithms.

Documentation Streamlit App Python

πŸ“‹ Table of Contents

🎯 Overview

This project addresses the growing challenge of urban parking management by leveraging advanced computer vision and machine learning techniques. The system can automatically detect and classify parking spaces as "empty" or "occupied" from video streams or images.

Academic Project Details:

  • Course: ModΓ©lisation et Simulation en IA (4th Year)
  • Academic Year: 2024-2025
  • Institution: ENSAM MeknΓ¨s
  • Supervisor: Mr. Tawfik Masrour

Page de Garde (1)_page-0001

✨ Features

  • Real-time Detection: Process video streams for live parking space monitoring
  • Dual Model Support: Choose between SVM and YOLOv8 models based on your requirements
  • Web Interface: User-friendly Streamlit application for easy interaction
  • High Accuracy: Achieves ~85% accuracy with SVM and ~95% with YOLOv8
  • Scalable Architecture: Modular design for easy integration and expansion
  • Visual Analytics: Comprehensive performance metrics and confusion matrices

🧠 Models

Support Vector Machine (SVM)

  • File: models/model.p
  • Type: Classification model
  • Accuracy: ~85%
  • Use Case: Suitable for smaller datasets and simpler setups
  • Training: Grid search optimization for hyperparameters

YOLOv8 (You Only Look Once v8)

  • File: models/best.pt
  • Type: Object detection model
  • Accuracy: ~95%
  • Use Case: Real-time applications with high accuracy requirements
  • Training: 100 epochs on 1700 labeled images

πŸš€ Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager
  • Git (for cloning the repository)

Clone the Repository

git clone https://github.com/yourusername/parking-space-recognition.git
cd parking-space-recognition

Install Dependencies

pip install -r requirements.txt

Additional Requirements (if needed)

pip install -r requirementProject.txt

πŸ’» Usage

Running the Streamlit Application

streamlit run src/app.py

Training Models

For detailed training steps and model development, refer to:

Using Individual Components

# Example usage of the SVM model
from src.model import load_model
from src.util import empty_or_not

# Load the trained model
model = load_model('models/model.p')

# Classify a parking spot
result = empty_or_not(model, image_crop)

πŸ“ Project Structure

parking-space-recognition/
β”œβ”€β”€ πŸ“ src/                          # Source code
β”‚   β”œβ”€β”€ app.py                       # Streamlit web application
β”‚   β”œβ”€β”€ main.py                      # Main execution script
β”‚   β”œβ”€β”€ model.py                     # Model utilities
β”‚   β”œβ”€β”€ ParkingSpaceRecognition.py   # SVM training and evaluation
β”‚   β”œβ”€β”€ util.py                      # Utility functions
β”‚   └── yolo_page.py                 # YOLOv8 integration
β”œβ”€β”€ πŸ“ models/                       # Trained models
β”‚   β”œβ”€β”€ model.p                      # SVM model (pickle)
β”‚   └── best.pt                      # YOLOv8 model (PyTorch)
β”œβ”€β”€ πŸ“ data/                         # Dataset and videos
β”‚   └── parking_1920_1080.mp4       # Sample parking video
β”œβ”€β”€ πŸ“ mask/                         # Parking spot masks
β”‚   β”œβ”€β”€ mask_1920_1080.png          # Main mask file
β”‚   └── mask_crop.png               # Cropped mask
β”œβ”€β”€ πŸ“ clf-data/                     # Classification dataset
β”‚   β”œβ”€β”€ empty/                       # Empty parking spots
β”‚   └── not_empty/                   # Occupied parking spots
β”œβ”€β”€ πŸ“ Notebook/                     # Jupyter notebooks
β”‚   └── ParkingDetection_Bellmir_Chegdati.ipynb
β”œβ”€β”€ πŸ“ Readthedocs/                  # Documentation
β”œβ”€β”€ requirements.txt                 # Python dependencies
β”œβ”€β”€ requirementProject.txt           # Additional requirements
└── README.md                        # This file

πŸ“š Documentation

Comprehensive documentation is available on ReadTheDocs: πŸ“– View Documentation

Key Documentation Sections:

  • Technical Implementation: Detailed code explanations
  • Model Comparison: SVM vs YOLOv8 performance analysis
  • API Reference: Function and class documentation
  • Training Guide: Step-by-step model training process

🌐 Demo

Live Demo

Experience the system in action: πŸš€ Try the Live Demo

Note: Some features may be limited on Streamlit Cloud. For the best experience, run the application locally.

Project Report

For comprehensive project details and research methodology: πŸ“„ View Full Report

πŸ“Š Performance

Feature SVM YOLOv8
Model Type Classifier Object Detector
Accuracy ~85% ~95%
Real-time Capability Limited Excellent
Implementation Effort Medium High
Dataset Size Smaller datasets Large datasets
Use Case Simple setups Production environments

πŸ› οΈ Technical Stack

  • Computer Vision: OpenCV
  • Machine Learning: scikit-learn
  • Deep Learning: YOLOv8 (Ultralytics)
  • Web Framework: Streamlit
  • Image Processing: scikit-image
  • Data Visualization: Matplotlib, Seaborn
  • Data Handling: NumPy, Pandas

🀝 Contributing

We welcome contributions to improve the system! Here's how you can help:

  1. Fork the repository
  2. Create a 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

πŸ‘₯ Authors

Students:

Supervisor:

  • Mr. Tawfik Masrour - Academic Supervisor

πŸ“ž Contact

For questions, suggestions, or collaboration opportunities:


⭐ Star this repository if you found it helpful! ⭐

About

Welcome to the Parking Recognition System. We use Object detection to determine occupied and empty parking spaces

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published