Traffic light detection and classification for self-driving car
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.2 KiB

Self-Driving Car Traffic Light Detection and Classification

Overview

This repository contains a simple TensorFlow implementation of traffic light detection and classification task for Udacity annotated self-driving dataset.

Method

In order to detect traffic lights, a pre-trained model is used (Single Shot Multibox Detector (SSD) with Inception v2 from the TensorFlow Zoo on MS-COCO dataset). The object detector is lightweight. However, the detection accuracy is not high under some conditions such as occlusion. More complex object detectors can perform better.

After the traffic light is detected in an image, a simple method is exploited to classify the color of the traffic light. To classify the color of the traffic light, brightness feature that uses HSV color space is employed. This method cannot achieve very accurate results. However, it is a fast method for real-time inference. For better accuracy, a deep learning based method could be used.

An output video is generated after detection and classification. Find the output video under out/ directory.

Dataset

The dataset is taken from https://github.com/udacity/self-driving-car/tree/master/annotations#dataset-2.

Files

model/ - Model files folder
object-dataset/ - Dataset images folder
out/ - Result folder
detectRecognize.py - Loads the model file and detect and recognize traffic light(s) for given input image(s).

Dependencies

Tests are performed with following version of libraries:

  • Python 3.5
  • Numpy 1.15.2
  • TensorFlow 1.5.0
  • OpenCV-Python
  • Pillow

Ubuntu 14.04 LTS is used for the tests.

Running

License

The source code is licensed under GNU General Public License v3.0.