- First, we import all libraries as follows:
import pandas as pdimport numpy as npimport cv2import mathfrom keras.models import Sequentialfrom keras.layers.core import Dense, Dropout, Activation, Lambdafrom keras.layers import Input, ELUfrom keras.optimizers import SGD, Adam, RMSpropfrom keras.utils import np_utilsfrom keras.layers import Conv2D, MaxPooling2D, Flattenfrom keras import initializersfrom keras.callbacks import ModelCheckpoint
- Next, we load the training data as follows:
data_path = 'Data/SDC/training.csv'data = pd.read_csv(data_path, header=None, skiprows=[0], names=['center', 'left', 'right', 'steering', 'throttle', 'brake', 'speed'])
- We need to define some image parameters before proceeding:
img_cols = ...