An intelligent computer vision system that detects and classifies parking spaces in real-time using machine learning algorithms.
- Overview
- Features
- Models
- Installation
- Usage
- Project Structure
- Documentation
- Demo
- Performance
- Technical Stack
- Contributing
- Authors
- Contact
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
- 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
- File:
models/model.p
- Type: Classification model
- Accuracy: ~85%
- Use Case: Suitable for smaller datasets and simpler setups
- Training: Grid search optimization for hyperparameters
- 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
- Python 3.8 or higher
- pip package manager
- Git (for cloning the repository)
git clone https://github.com/yourusername/parking-space-recognition.git
cd parking-space-recognition
pip install -r requirements.txt
pip install -r requirementProject.txt
streamlit run src/app.py
For detailed training steps and model development, refer to:
- Jupyter Notebook:
Notebook/ParkingDetection_Bellmir_Chegdati.ipynb
- Training Script:
src/ParkingSpaceRecognition.py
# 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)
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
Comprehensive documentation is available on ReadTheDocs: π View Documentation
- 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
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.
For comprehensive project details and research methodology: π View Full Report
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 |
- 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
We welcome contributions to improve the system! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Students:
Supervisor:
- Mr. Tawfik Masrour - Academic Supervisor
For questions, suggestions, or collaboration opportunities:
- Email: [yahyabellmir@gmail.com]
- Project Link: [https://github.com/yourusername/parking-space-recognition]
- Documentation: [https://parking-recognition-system-2.readthedocs.io/en/latest/]
β Star this repository if you found it helpful! β