/traffic-sign-recognition-2

Detection and recognition of traffic signs on public roads using the GTSRB dataset.

Primary LanguagePythonMIT LicenseMIT

Traffic sign recognition

Detection and recognition of traffic signs on public roads.
The recognition model was trained using fastai and the GTSRB dataset, with the best result of 99.99% accuracy for Resnet-50.
To get the bounding boxes coordinates, the code uses a pre-trained model which you can find in this repository.
The detected signs are then classified using the recognition model.

Example

Requirements

If you want to run it locally, it's recommended to have at least 16GB of RAM and a GPU with 6GB of VRAM. If your computer does not meet the requirements, you can adapt the code for a Google Colab notebook.

  • fastai 2.1.7
  • Python 3.7.x (or later)
  • OpenCV 4.4.0
  • Pytorch 1.7.0
  • matplotlib 3.3.3
  • numpy 1.19.3
  • tesnorflow 2.2.0
  • Object Detection API with TensorFlow 2
  • CUDA 10.0.0 or 10.0.1 (Depends on your Tensorflow version, if it asks for dynamic library x_10.dll, it's 10.0.0, if it asks for x_101.dll, it's 10.0.1)
  • cudNN 7

Dataset

Running the code

  1. Download the detection model and extract the frozen graph to models/detection
  2. Download the recognition model from this repository or run python src/recognition.py to train a new model
  3. Run python src/detection.py to detect and classify traffic signs from the test images.