A real-time computer vision solution for monitoring parking space availability using AI object detection.
AIProject-Video-Demo.mp4
- Features
- System Architecture
- Installation
- Raspberry Pi Integration(Optional)
- Configuration
- Usage
- Troubleshooting
- 🚘 Real-time vehicle detection using YOLOv8
- 🟢🔴 Visual parking space status (Green=A Spot Is Available, Red= Occupied)
- 🌐 REST API for integration with web/mobile apps
- 🖥️ Simple web interface for monitoring
- 🛠️ Customizable parking space layout
- 🍓 Optional Raspberry Pi integration for physical indicators
graph TD
A[Camera Feed] --> B[Computer Vision Module]
B --> C[status.json]
C --> D[Flask API]
D --> E[Web Interface]
D --> F[Raspberry Pi]
F --> G[LED Indicators]
- Python 3.8+
- Webcam or IP camera
- OpenCV
- Flask
- Ultralytics YOLOv8
- Tkinter
- PIL (Pillow)
- NumPy
- Clone the repository:
git clone https://github.com/Yae_sine/smart-parking-system.git
cd smart-parking-system- Install dependencies:
pip install -r requirements.txt- You need to install Tailwind CSS for the styling of the website.
The Raspberry Pi component of this project is optional. You can run the AI detection system and web interface without it.
The Raspberry Pi adds the following physical features to the smart parking system:
- LED Indicators:
- 🔴 Red LED illuminates when all parking spots are occupied
- 🟢 Green LED illuminates when at least one spot is available
- Barrier Control:
- Works with ESP32 to control entry/exit barriers
- Automatically opens when a car approaches
If you choose to implement the Raspberry Pi component, you'll need:
- Raspberry Pi (3B+ or newer recommended)
- LED indicators (red and green)
- Jumper wires
- Resistors (220-330Ω)
- ESP32 microcontroller for barrier control
- Servo motors for barriers
- IR or ultrasonic sensors for car detection
- Arduino IDE with ESP32 board support
- Required Libraries:
- WiFi
- PubSubClient (for MQTT)
- Servo
- The Raspberry Pi communicates with the main system via HTTP requests to get parking status updates
- Controls the physical indicators based on parking availability
- The ESP32 handles barrier control based on:
- Signals from proximity sensors
- Commands from the Raspberry Pi
-px_per_cm = 37.8 # Pixel to cm ratio
-spot_height = int(5.5 * px_per_cm) # Spot height in pixels
-spot_width = int(4.2 * px_per_cm) # Spot width in pixels
-spot_spacing = int(0.4 * px_per_cm) # Space between spotscamera_index = 0 # Change if using different cameraStart the computer vision module:
python AI/main.pyStart the Flask server (in another terminal):
python FlaskPrj/app.pyAccess the web interface at:
http://localhost:5000| Issue | Solution |
|---|---|
| Camera not detected | Try changing camera_index in main.py |
| YOLOv8 model not found | Verify yolov8s.pt is in the AI folder |
| Module import errors | Check all dependencies are installed (pip install -r requirements.txt) |
| Flask server not starting | Ensure port 5000 is available or change the port in app.py |
Pull requests are welcome! For major changes, please open an issue first.