AI-Powered Road Change Detection Platform
VisionX is an advanced computer vision system that compares two road surveillance videos (base and present) to automatically detect and analyze infrastructure changes, including new or removed traffic signs, road markings, potholes, and other road conditions.
- Dual Video Comparison - Upload base (reference) and present videos for intelligent comparison
- Real-Time Detection - Live frame-by-frame analysis with WebSocket updates
- Change Analytics - Comprehensive dashboard with charts, metrics, and insights
- Infrastructure Focus - Detects traffic signs, road markings, potholes (excludes vehicles)
- AI-Powered - Uses YOLOv8 deep learning model with custom detection algorithms
- Key Metrics - Total additions, removals, and change severity assessment
- Data Visualizations - Bar charts and pie charts for change distribution
- Top Changes Table - Detailed breakdown of detected changes
- Intelligent Insights - Auto-generated findings and recommendations
- Export Results - Download complete analysis reports
Backend (Python)
- FastAPI - High-performance async web framework
- Uvicorn - ASGI server with WebSocket support
- PyTorch - Deep learning framework
- Ultralytics YOLOv8 - Object detection model
- OpenCV - Computer vision processing
Frontend (React)
- React 18.2 - Modern UI framework
- Vite - Fast build tool
- Recharts - Data visualization library
- Axios - HTTP client
road-safety/
βββ api_server.py # FastAPI backend server
βββ comparison_worker.py # Video comparison engine
βββ detection_worker.py # Object detection worker (optional)
βββ yolov8n.pt # YOLOv8 trained model
βββ requirements.txt # Python dependencies
βββ frontend/ # React frontend application
β βββ src/
β β βββ App.jsx # Main application component
β β βββ ResultsAnalytics.jsx # Analytics dashboard
β β βββ styles.css # UJET-inspired minimalist design
β β βββ main.jsx # React entry point
β βββ index.html
β βββ package.json
β βββ vite.config.js
βββ api_jobs/ # Temporary job storage (auto-created)
- Python 3.10 or higher
- Node.js 16 or higher
- CUDA 11.8 (optional, for GPU acceleration)
- 8GB+ RAM recommended
git clone https://github.com/Abhishekmishra2808/road-safety.git
cd road-safety# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On Linux/Mac:
source .venv/bin/activate
# Install Python dependencies
pip install -r requirements.txtcd frontend
npm install
cd ..# Activate virtual environment first
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
# Start FastAPI server
uvicorn api_server:app --reload --port 8000 --host 0.0.0.0Backend will be available at: http://localhost:8000
cd frontend
npm run devFrontend will be available at: http://localhost:3000
Open your browser and navigate to: http://localhost:3000
- Select Base Video - Choose your reference/baseline road footage
- Select Present Video - Choose the current road footage to compare
- Click "START COMPARISON" button
- Watch real-time change detection feed
- Track progress with live frame count and percentage
- View quick stats of detected changes
Once comparison is complete, you'll see:
- Key Metrics Dashboard - Total additions, removals, change severity
- Bar Chart - Category-wise breakdown of changes
- Pie Chart - Overall distribution of additions vs. removals
- Top Changes Table - Detailed list of significant changes
- Insights & Recommendations - AI-generated findings and action items
Click "DOWNLOAD RESULTS" to get the complete analysis report with:
- Frame-by-frame comparison data
- Annotated detection images
- JSON data export
Edit api_server.py to customize:
PORT- Default: 8000CORS_ORIGINS- Allowed frontend originsUPLOAD_DIR- Job storage directory
Edit comparison_worker.py to adjust:
CONFIDENCE_THRESHOLD- Default: 0.3SKIP_FRAMES- Frame sampling rate (default: process 2 fps)SPATIAL_THRESHOLD- Object matching distance (default: 50px)
Edit frontend/src/App.jsx to change:
API_URL- Backend server URL- Chart colors and styling
- Severity thresholds
VisionX follows a minimalist design language inspired by UJET:
- Clean black and white color palette
- Bold typography with Inter font
- Wide letter spacing for branding
- Subtle animations and hover effects
- Focus on content and functionality
β
Traffic Signs - Stop signs, traffic lights, regulatory signs
β
Road Markings - Lane lines, crosswalks, road paint
β
Potholes - Road damage and surface defects
β
Infrastructure - Poles, barriers, road furniture
β Vehicles (cars, trucks, buses, motorcycles)
β Boats
β Persons and bicycles
Focus is exclusively on static infrastructure and road conditions
Upload two videos for comparison
- Parameters:
base_video(file) - Reference videopresent_video(file) - Current video
- Returns:
{ job_id: string }
Real-time status updates
- Sends: Progress, frame count, detected changes
- Format: JSON messages
Download comparison results
- Returns: ZIP file with analysis data
- Ensure Python virtual environment is activated
- Check if port 8000 is available
- Verify all dependencies installed:
pip list
- Clear node_modules:
rm -rf node_modules && npm install - Check if port 3000 is available
- Verify Node.js version:
node --version(should be 16+)
- System will automatically fall back to CPU if CUDA unavailable
- Check CUDA installation:
python -c "import torch; print(torch.cuda.is_available())" - For CPU-only: Remove
--index-urlline from requirements.txt
- Ensure backend is running on port 8000
- Check CORS settings in
api_server.py - Verify firewall isn't blocking WebSocket connections
# Backend with auto-reload
uvicorn api_server:app --reload --port 8000
# Frontend with hot-reload
cd frontend && npm run dev# Frontend production build
cd frontend
npm run build
# Output will be in frontend/dist/
# Serve frontend build
npm run previewThis project is licensed under the MIT License.
Abhishek Mishra
- GitHub: @Abhishekmishra2808
- Ultralytics - YOLOv8 object detection model
- UJET - Design inspiration
- FastAPI - Modern Python web framework
- React - UI library
- Historical trend analysis
- Multi-camera support
- Custom object training
- Email notifications
- Cloud deployment guide
- Mobile responsive improvements
- Batch processing support
VisionX - Intelligent Infrastructure Monitoring