An end-to-end AI-powered vehicle damage detection and repair cost estimation system that automates inspection using computer vision and backend intelligence.
The system allows users to upload an image of a damaged vehicle, detects affected parts using a YOLOv8 model, and estimates repair cost based on structured pricing data stored in PostgreSQL.
Traditional vehicle damage assessment is:
- Time-consuming
- Dependent on human expertise
- Prone to inconsistency
This system provides:
- Automated damage detection
- Standardized cost estimation
- Faster and data-driven decision-making
- YOLOv8 object detection model
- Detects vehicle parts (Bumper, Door, Light, etc.)
- Confidence-based filtering
-
Dynamic pricing based on:
- Vehicle brand & model
- Detected damage parts
-
Applies damage factor for realistic estimation
-
Layered architecture:
Routes → Controllers → Services → Repositories -
Clean separation of concerns
-
Stores:
- User data
- Damage reports
- Cost breakdown (JSONB)
-
Enables analytics & reporting
- Stores historical damage reports
- Supports future analytics (cost trends, damage frequency)
- Secure user registration & login
- Password hashing using bcrypt
Frontend (React / UI)
↓
Flask API
↓
Controllers
↓
Services
↙ ↘
AI Layer Database Layer
(YOLOv8) (PostgreSQL)
↓
JSON Response
backend/
│
├── app/
│ ├── routes/
│ ├── controllers/
│ ├── services/
│ ├── repositories/
│ ├── ai/
│ ├── utils/
│ ├── schemas/
│ ├── exceptions/
│ └── config/
│
├── ml_models/
│ └── best.pt
│
├── migrations/
├── tests/
├── run.py
└── .env
- Python (Flask)
- PostgreSQL
- psycopg2
- YOLOv8 (Ultralytics)
- OpenCV
- bcrypt
- dotenv
- logging
- User uploads image
- Backend processes image
- YOLO detects damaged parts
- Parts mapped & counted
- Pricing fetched from database
- Cost calculated
- Report stored
- Result returned
POST /api/auth/signup
POST /api/auth/login
POST /api/detect
GET /api/reports?user_id=1
git clone https://github.com/your-username/vehicle-damage-ai-system.git
cd vehicle-damage-ai-system/backendpython -m venv venv
venv\Scripts\activate
pip install -r requirements.txtCreate .env:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=vehicle_ai
DB_USER=postgres
DB_PASSWORD=your_password
SECRET_KEY=your_secret
Run:
python run.py- Reduced inspection time by ~60%
- Eliminates manual bias
- Enables structured analytics
- Modular & scalable backend
- Insurance system integration
- Mobile app (React Native)
- Real-time detection via camera
- Cloud deployment (AWS/GCP)
Vipul Paighan Full Stack Developer | Data Analyst | Applied AI & Data Science