Auto Theft Detection is an intelligent real-time computer vision application that detects stolen vehicles. It utilizes advanced deep learning models to perform object detection, object tracking, and optical character recognition (OCR) on video streams or uploaded files to identify license plates and match them against a database of stolen vehicles.
- Real-time Vehicle Detection: Identifies vehicles (cars, motorcycles, buses, trucks) in video streams.
- License Plate Recognition: Accurately detects and reads license plates using OCR.
- Theft Alertging: Matches recognized plates against a specific registry of stolen plates and instantly logs thefts with timestamped image captures.
- Web Dashboard: A split-stack modern web interface built with Flask (Frontend UI) and FastAPI (Backend API engine).
The system is built on a robust, multi-layered architecture:
- Backend API (FastAPI): High-performance backend handling video uploads, stream ingestion, and inference routing.
- Frontend UI (Flask): User-friendly dashboard to manage uploads, connect live streams (RTSP/HTTP), and view stolen vehicle alerts.
- Object Detection (YOLOv8): Uses two trained YOLO models:
yolov8n.pt: For general vehicle detection.license_plate_detector.pt: For isolated license plate bounding boxes.
- Object Tracking (SORT): The Simple Online and Realtime Tracking (SORT) algorithm is utilized to track specific vehicles consistently across multiple video frames.
- OCR Engine (EasyOCR): Extracts text from the cropped license plate images. A set of customized heuristics and character mapping rules (in
util.py) ensures higher accuracy by correcting common OCR misreadings (e.g., confusing 'O' with '0'). - Data Matching (Pandas): Continuously checks scanned plates against a CSV-based database of stolen plates.
- Deep Learning & Computer Vision: Ultralytics YOLOv8, OpenCV
- Object Tracking: SORT (Simple Online and Realtime Tracking) algorithm
- Optical Character Recognition (OCR): EasyOCR
- Backend Frameworks: FastAPI, Flask, Uvicorn, Werkzeug WSGI
- Data Manipulation: NumPy, Pandas, SciPy
- Programming Languages: Python, HTML/CSS/JS (Templates)
Make sure you have Python 3.8+ installed.
- Clone this repository:
git clone https://github.com/ahmad-bsds/AutoTheftDetection.git cd AutoTheftDetection - Install the required dependencies:
pip install -r requirements.txt
To run the combined FastAPI and Flask server, use the entry point script:
python run.pyThen navigate to http://127.0.0.1:8000/app in your browser.