This project uses deep neural networks and convolutional neural networks to clone driving behavior. The model is trained, validated and tested using Keras API. The model will output a steering angle to an autonomous vehicle.
For more information about this project visit the Wiki page
The goals / steps of this project are the following:
- Use the simulator to collect data of good driving behavior
- Design, train and validate a model that predicts a steering angle from image data
- Use the model to drive the vehicle autonomously around the track in the simulator.
Download project repository. Open Git Bash and type
git clone main.py https://github.com/cuevas1208/Car_Behavioral_Cloning.git
Open terminal on the project and use this command to train your model:
python main.py
When training is completed you should have two files under the steering_model
folder model.json
and model.h5
Download the simulation from this link
Use drive.py
to run your model.drive.py
requires you to have model.h5
and model.json
file saved under 'steering_model' folder
Once the model has been saved, it can be used with drive.py using this command:
python drive.py
Open your simulation and run your simulation mode. The above command will load the trained model and use the model to make predictions on individual images in real-time and send the predicted angle back to the server via a websocket connection.
Note: There is a known local system's setting issue with replacing "," with "." when using drive.py. When this happens it can make predicted steering values clipped to max/min values. If this occurs, a known fix for this is to add "export LANG=en_US.utf8" to the bashrc file.
The simulator will use the steering angles outs from the model to drive a car around a track. The simulator has a setting to record data to train the model. The data set consists of image data and steering angles to train a neural network and then use this model to drive the car autonomously around the track.
This project requires Python 3.5 and the following Python libraries installed:
runs model with the simulator
trains the data set
contains the model architecture
Splits dataset into validation and training sets
Creates the batch data to be used for training, as well as augmented brightness, and flip image in the left/right direction.