Twizy project
is an Maven project that uses OpenCv and YOLOv5 to detect and recognize traffic signs. Twizy project
is inspired by the driver aid systems found in many modern cars that help the drivers keep the speed of their cars under the limit required by the law.
demo.mp4
This software allows the user to detect and recognize traffic signs in both images and videos. There are two options for detection and recognition:
- Detection and recognition using ML algorithms coded in OpenCV
- Detection and recognition using DL algorithms and Yolov5 models
You need Maven to run this software.
You need to clone the YOLOv5 repo and install its requirements
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
mvn compile
mvn exec:java -Dexec.mainClass=ImageProcessing.Main
Before using the traffic sign detection and recognition DL feature, you need to seperately run the server that loads the model into memory and waits for requests from Java to run inference on images.
cd DeepLeaning
python server.py
Our OpenCv algorithms detect and recognize traffic signs
- Detection algorithms
- We convert the images from RGB to HSV
- We extract red pixels from the images and remove the rest
- We detect contours in the red image
- We assume that contours with a circular shapes are traffic signs and
- Recogntion algorithms
- We use template matching to recognize the different traffic signs
We used the GTSDB and screenshots from Google Maps Street View to create a traffic sign dataset.
We also used Roboflow to annotate our Google maps screenshots.
The dataset can be found here.
We decided to train a YOLOv5 model since our OpenCv algorithms were having trouble detecting signs under bad lighting.
To train our model we used Custom Training with YOLOv5 Jupyter notebook running on Google Colab.
Our algorithms detect these types of signs :
- 30km/h
- 50km/h
- 70km/h
- 90km/h
- 110km/h
- no overtaking
- no entry
Unfortunately, the software in its current configuration is not capable of running videos because of a licencing issues with the library loaded by Maven. You can read more about the issue here.
For the time being, we are not yet aware of a permanent fix. You can however follow these steps in you wish to run video.
If you encounter a problem, want to ask for help, or want to suggest a feature, feel free to open an issue.
This project was created by Maha Gaied, Oumnia Anouk, Moad Benslimane, Salma Maghraoui, Mahdi Chaari and Ali Chouchene
Twizy Project is licensed under the MIT license.