This is a project to detect traffic lights in images and videos as well as the state of the traffic light (red, red-yellow, yellow, green, off), to be used in driver-assistance systems and autonomous vehicles. In order to achieve this, we split our Pipeline into multiple separate steps, which are described in the following sections.
We have used the DTLD datset provided by driveU, which is a large dataset of traffic scenarios in Germanys cities, from a point of view of a car. Further Information can be found in the Dataset Readme. To aquire the data from the images, we then created a Annotation Tool to label the traffic lights in the images. For further information, please visit the Annotation Tool Readme.
The first step in our pipeline is to detect where the traffic lights are in the images. We have used and finetuned the YOLO NAS Object Detection Model, which is a state-of-the-art model for object detection. For further information, please visit the Object Detection Readme.
The second step in our pipeline is to detect the state of the traffic lights. We have implemented our own ResNet 10 State Detection Model and trained it on our data, to detect the state of the traffic lights. For further information, please visit the State Detection Readme.
The final step in our pipeline is to visualize the detected traffic lights and their states in the images and videos. We have created another Graphical User Interface to input images, videos and live camera streams and visualize the detected traffic lights and their states. This takes in the output of the Object Detection and State Detection Models and visualizes the results. For further information, please visit the Visualization Readme.
To install and use this project, follow these steps:
- Clone the repository:
git clone https://github.com/FridtjofS/TrafficLightDetection.git
- Navigate to the project directory:
cd TrafficLightDetection
- Install the required dependencies (the most important packages can be found in the requirements_manual.txt file):
pip install -r requirements.txt
- Follow the installation and usage instructions in the individual README files for each component of the pipeline:
- Annotation Tool Readme
- Dataset Readme
- Object Detection Readme
- State Detection Readme
- Visualization Readme
- Once all the dependencies are installed and the individual components are set up, you can run all the parts of the pipeline.