How to do it...

Go through the following the steps for training a deep neural net on the GTSRB images for traffic sign classification:

  1. Load the pickle files corresponding to the training, validation, and test datasets:
training_file = "traffic_signs/train.p"validation_file = "traffic_signs/valid.p"testing_file = "traffic_signs/test.p"with open(training_file, mode='rb') as f: train = pickle.load(f)with open(validation_file, mode='rb') as f: valid = pickle.load(f)with open(testing_file, mode='rb') as f: test = pickle.load(f)
  1. Extract the features (the images) and the labels (the traffic signs) from the training, validation, and test images using the following code snippet:
X_train, y_train = train['features'], train['labels']X_valid, y_valid ...

Get Python Image Processing 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.