How to do it...

  1. Download the dataset, as follows (the code file is available as Traffic_signal_detection.ipynb in GitHub). The dataset is available through the paper: J. Stallkamp, M. Schlipsing, J. Salmen, C. Igel, Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition:
$ wget http://benchmark.ini.rub.de/Dataset/GTSRB_Final_Training_Images.zip$ unzip GTSRB_Final_Training_Images.zip
  1. Read the image paths into a list, as follows:
from skimage import ioimport osimport globroot_dir = '/content/GTSRB/Final_Training/Images/'all_img_paths = glob.glob(os.path.join(root_dir, '*/*.ppm'))

A sample of the images looks as follows:

Note that certain images have a smaller shape when compared to others and also that ...

Get Neural Networks with Keras Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.