| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository contains Python scripts showing how you can use Microsoft AirSim to collect image data from a moving vehicle, then use that data to train and test a deep-learning neural net in TensorFlow.
Recommended hardware for running UnrealEngine4, required for AirSim. Although it is possible build AirSim on OS X and Linux, we found it easiest to use the pre-compiled Windows binaries in the Neighborhood example.
Python3 for 64-bit Windows
TensorFlow. To run TensorFlow on your GPU as we and most people do, you'll need to follow the directions for installing CUDA and CuDNN. We recommend setting aside at least an hour to make sure you do this right.
The image_collection script maintains a queue of the ten most recent images and saves them to numbered
files in the carpix folder. The collision_training script converts these color images to
grayscale, then builds a training set in which all images but the final one are labeled as safe (no
collision; code [1 0]), and the final one is labeled as a collision (code [0 1]).
Finally, this training script uses Python's built-in pickle library to
save
the trained network parameters (weights and biases). The collision_testing script uses pickle to
restore
these parameters, then reconstructs the TensorFlow neural net from them. (We found this approach easier than
using TensorFlow's save-and-restore API.)
Finally, the collision_testing script moves the vehicle forward, converting the live
image into grayscale and running it through the network to make a collision/no-collision prediction.
When the value of the “collision bit” exceeds 0.5, the script stops the vehicle by applying the brakes.
Our single-layer logistic regression network provides a simple proof-of-concept example; however, for a more realistic data set involving collisions with different types of objects, a convolutional network would make more sense. AirSim also provides access to depth images (just press the 1 key during the simulation) which, like the Lidar on today's self-driving cars, would provide a valuable additional source of information for avoiding collisions.
This code represents the combined work of two teams in Prof. Simon D. Levy's fall 2017 AI course (CSCI 315) at Washington and Lee University (listed alphabetically):
We thank David Pfaff of the W&L IQ Center for providing the hardware on which we developed this project.
| Back | FazBrowse Home | New Git URL |