Self Driving Car Sandbox
Use Unity 3d game engine to simulate car physics in a 3d world. Generate image steering pairs to train a neural network. Uses comma ai training code with NVidia NN topology. Then validate the steering control by sending images to your neural network and feed steering back into the simulator to drive.
You need to have Unity installed, and all python modules listed in the Requirements section below.
- Start the prediction server with the pre-trained model.
cd sdsandbox/src
python predict_server.py usc
-
Load the Unity project sdsandbox/sdsim in Unity. Double click on Assets/Scenes/UnityStandardCar to open that scene.
-
Hit the start button to launch. Then the "Use NN Steering".
#To create your own data and train
-
Load the Unity project sdsandbox/sdsim in Unity.
-
Create a dir sdsandbox/sdsim/log.
-
Hit the start arrow in Unity to launch project.
-
Hit button "Generate Training Data" to generate image and steering training data. See sdsim/log for output files.
-
Stop Unity sim by clicking run arrow again.
-
Run this python script to prepare raw data for training:
cd sdsandbox/src
python prepare_data.py --clean
- Repeat 4, 5, 6 until you have lots of training data. 30gb+ is good. On your last run, prepare a validation set:
python prepare_data.py --validation --clean
python train.py mymodel
Let this run. It may take 12+ hours if running on CPU.
- Start the prediction server. This listens for images and returns a steering result.
python predict_server.py mymodel
-
Start Unity project sdsim
-
Push button "Use NN Steering"
python 2.7 64 bit
tensorflow-0.9
keras-1.0.6
h5
pillow
Unity 5.5+
Tawn Kramer, Riccardo Biasini, George Hotz, Sam Khalandovsky, Eder Santana, and Niel van der Westhuizen