This project is designed to detect vehicles, recognize license plates, and track vehicles using a combination of YOLO object detection and DeepSORT tracking. The system is capable of recognizing Swedish license plates and fetching relevant vehicle data from an external source.
demo.mp4
- Vehicle Detection: Detects cars, motorcycles, buses, and trucks using the YOLOv8 model.
- License Plate Recognition: Recognizes license plates using OCR and verifies Swedish license plates.
- Vehicle Tracking: Tracks vehicles across frames using the DeepSORT tracking algorithm.
- Data Fetching: Fetches vehicle-related data from a website based on the recognized license plate.
- Vehicle Detection: The YOLO model detects vehicles in the video feed.
- Tracking: The detected vehicles are tracked with unique IDs.
- License Plate Detection: The system detects license plates within the vehicle bounding boxes.
- License Plate Recognition: OCR is used to recognize and validate the text on license plates.
- Data Fetching: If a valid license plate is found, vehicle information and owner is fetched from Biluppgifter.se and Ratsit.
ultralytics
: For YOLO-based object detection.cv2
: OpenCV for video processing.deep_sort_realtime
: For vehicle tracking.paddleocr
: For license plate text recognition.requests
&BeautifulSoup
: For scraping vehicle data from a website.
- Follow the steps bellow or use INSTALL.bat to install automatically.
- Install python (3.10.0 to 3.10.15)
- Download and install Cuda 11.7
- Install Torch
pip3 install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/test/cu118
pip3 install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/test/cpu
- (If you selected Option 1) Install paddlepaddle-gpu:
python -m pip install paddlepaddle-gpu==2.6.1.post117 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
- Install dependencies:
pip install -r requirements.txt
- Run the main script to process a video file:
python main.py
- main.py: Core logic for detecting, tracking, and recognizing vehicles and license plates.
- utils.py: Helper functions for OCR, data fetching, and license plate validation.
This project is licensed under MPL 2.0.