Real-time AI-powered parking management using YOLOv8 deep learning with 99%+ accuracy. Upload parking lot images for instant detection with color-coded bounding boxes, occupancy statistics, and interactive booking.
- ๐ฏ Real-time Detection - Process images in < 2 seconds
- ๐ง YOLOv8m AI - 99.30% mAP50 accuracy
- ๐จ Visual Feedback - Green (empty) / Red (occupied) boxes
- ๐ Live Statistics - Real-time occupancy tracking
- ๐ซ Smart Booking - Interactive slot reservation
- ๐ฑ Modern UI - React 19 with Framer Motion
- โก Fast Inference - 50-200ms GPU, 500-1000ms CPU
Frontend (React 19) Backend (Flask + YOLOv8)
http://localhost:5173 http://localhost:5001
โ โ
โ POST /detect (image) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ>โ
โ โ 1. Receive image
โ โ 2. Run YOLOv8 inference
โ โ 3. Draw bounding boxes
โ โ 4. Calculate statistics
โ โ 5. Return JSON + base64
โ<โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ {annotated_image_b64, stats} โ
โ โผ
best.pt (52MB)
YOLOv8m Model
- Node.js โฅ 18
- Python โฅ 3.10
- npm/yarn
# Clone repository
git clone https://github.com/dalaldia5/ParkSight
cd SmartPark
# Backend setup
cd backend
python -m venv venv
.\venv\Scripts\activate # Windows
pip install -r requirements.txt
# Frontend setup
cd ../frontend
npm installOption A: Kaggle Training (FREE GPU)
- Go to Kaggle
- Upload
parking-lot-prediction.ipynb - Add dataset: Search "pklot-yolov8"
- Enable GPU: Settings โ GPU T4
- Run Cell 4 (2-3 hours)
- Download
best.ptโ Place inbackend/
Option B: Download Pre-trained
- Check project releases
# Terminal 1: Backend
cd backend
C:/DevProjects/ParkSight/.venv/Scripts/python.exe app.py
# Terminal 2: Frontend
cd frontend
npm run dev- Frontend: http://localhost:5173
- Backend: http://localhost:5001
- Health: http://localhost:5001/health
- Navigate to http://localhost:5173/parking
- Upload parking lot image (JPG/PNG, < 10MB)
- View Results:
- Annotated image with bounding boxes
- Confidence badge (typically 95-96%)
- Statistics: Total/Occupied/Available counts
- Interactive Grid:
- Each slot shows confidence score
- Green slots = Available (clickable to book)
- Red slots = Occupied (non-clickable)
- Click any green (available) slot in the grid
- Select duration (1-4 hours)
- Enter vehicle number
- Choose payment method
- Confirm booking โ Download parking pass
GET /health # Health check
POST /detect # Full detection (JSON + image)
POST /infer # Frontend-optimized
POST /detect/json # JSON only
POST /detect/image # Image only
GET /download/<filename> # Retrieve saved imagescurl -X POST http://localhost:5001/detect \
-F "image=@parking_lot.jpg" \
-F "confidence=0.25"{
"success": true,
"timestamp": "2024-01-15T10:30:00Z",
"annotated_image_b64": "iVBORw0KGgoAAAA...",
"occupied_count": 27,
"free_count": 1,
"per_spot": [true, true, false, true, ...],
"confidence": [0.96, 0.95, 0.94, ...],
"statistics": {
"total_spaces": 28,
"occupancy_rate": 96.43
}
}ParkSight/
โโโ frontend/ # React 19 application
โ โโโ src/
โ โ โโโ pages/
โ โ โ โโโ Parking.jsx # โญ Main detection UI
โ โ โ โโโ Booking.jsx # Booking system
โ โ โ โโโ Home.jsx # Landing page
โ โ โ โโโ Analytics.jsx # Dashboard
โ โ โ โโโ Traffic.jsx # Traffic monitor
โ โ โโโ components/ # Reusable components
โ โโโ package.json
โ
โโโ backend/ # Flask API
โ โโโ app.py # โญ Main API (601 lines)
โ โโโ requirements.txt # Python dependencies
โ โโโ best.pt # โ ๏ธ Model weights (REQUIRED)
โ โโโ uploads/ # Temp storage
โ โโโ outputs/ # Results
โ
โโโ parking-lot-prediction.ipynb # โญ Training notebook
โโโ docs/ # Additional documentation
โ โโโ TRAINING_GUIDE.md # Detailed training guide
โ โโโ QUICK_START.md # Quick reference
โ โโโ ACCURACY_IMPROVEMENTS.md
โ โโโ INTEGRATION_STATUS.md
โ โโโ INTEGRATION_COMPLETE.md
โโโ README.md # This file (main documentation)
Trained on PKLot Dataset (10,000+ images):
| Metric | Score | Description |
|---|---|---|
| mAP50 | 99.30% | Detection accuracy at 50% IoU |
| Precision | 99.87% | Correct positive predictions |
| Recall | 99.14% | Actual positives detected |
| F1-Score | 99.50% | Precision-recall harmonic mean |
Classes: space-occupied (red), space-empty (green)
Confidence: Typically 94-97% per detection
Speed: 50-200ms (GPU), 500-1000ms (CPU)
- React 19.1.1 with Vite 7.1.7
- Styling: TailwindCSS 3.4
- Animation: Framer Motion 12
- Icons: Lucide React
- Routing: React Router DOM 7
- Charts: Recharts 3
- Flask 3.0 with Flask-CORS
- ML: YOLOv8m (Ultralytics)
- Vision: OpenCV, Pillow
- DL: PyTorch 2.0+, TorchVision
- Data: NumPy, PKLot Dataset
MODEL_PATH = "best.pt" # Model file
CONFIDENCE_THRESHOLD = 0.25 # Detection threshold
UPLOAD_FOLDER = "uploads" # Temp storage
OUTPUT_FOLDER = "outputs" # Results
COLORS = {
'space-empty': (0, 255, 0), # Green
'space-occupied': (0, 0, 255) # Red
}const API_URL = "http://localhost:5001";
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB
const ACCEPTED_FORMATS = ['.jpg', '.png'];โ FileNotFoundError: best.pt
Solution: Train on Kaggle or download from releases. Place in backend/
โ ๏ธ 0 objects detected
Solution: Lower CONFIDENCE_THRESHOLD to 0.15 in app.py
โ Access-Control-Allow-Origin blocked
Solution: Verify backend running on localhost:5001
โ Port 5001 already in use
Solution:
Get-Process -Id (Get-NetTCPConnection -LocalPort 5001).OwningProcess | Stop-ProcessDetailed documentation is available in the docs/ folder:
- Training Guide - Complete model training instructions
- Quick Start - Rapid setup guide
- Accuracy Improvements - Frontend optimization details
- Integration Status - Implementation progress
- Integration Complete - Final integration notes
Backend Dockerfile:
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5001
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5001", "app:app"]Frontend Dockerfile:
FROM node:18-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80docker-compose.yml:
version: '3.8'
services:
backend:
build: ./backend
ports:
- "5001:5001"
volumes:
- ./backend/best.pt:/app/best.pt
frontend:
build: ./frontend
ports:
- "80:80"
depends_on:
- backendContributions welcome! Please:
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
MIT License - See LICENSE file
Project Owner: Dia Dalal Repository: github.com/dalaldia5/ParkSight
- YOLOv8: Ultralytics
- PKLot Dataset: Federal University of Paranรก
- Real-time video stream support
- Mobile app (React Native)
- Multi-camera management
- Payment gateway integration
- Email/SMS notifications
- Admin dashboard
- License plate recognition
- Vehicle type classification
- IoT sensor integration
- Cloud deployment templates
- Documentation: Check guides in repository
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Q: How accurate is detection?
A: 99.30% mAP50, 99.87% precision, 99.14% recall
Q: Can I use commercially?
A: Yes, under MIT License terms
Q: Does it work with video?
A: Currently images only. Video support planned for v2.0
Q: GPU required?
A: Optional. CPU works but 5-10x slower
Made with โค๏ธ by the ParkSight Team
Report Bug โข Request Feature โข Documentation
โญ Star us on GitHub โ it motivates us a lot!
Version 1.0.0 | Status: Production Ready ๐ | Last Updated: November 25, 2025