bakoushin / self-driving-car-javascript

Run a self-driving car using JavaScript and TensorFlow.js
https://medium.com/p/run-a-self-driving-car-using-javascript-and-tensorflow-js-8b9b3f7af23d?sk=549ee7230aa2b05fead0e68210982cf8
MIT License
64 stars 15 forks source link
cnn self-driving-car steering tensorflow

Run a self-driving car using JavaScript and TensorFlow.js

This project demonstrates how to train a self-driving car to steer and to drive autonomously in Udacity Self-Driving Car Simulator using TensorFlow.js.

Featured on TensorFlow YouTube channel:

See also detalied explanation of this project in a Medium publication: Run a self-driving car using JavaScript and TensorFlow.js.

Usage

  1. Clone this project.
  2. Download Udacity Simulator for Term 1.
  3. Record data using the simulator.
  4. Train the model using recorded data.
  5. Run the simulator in autonomous mode.
  6. Drive the car using the trained model.

Cloning and initialization

git clone https://github.com/bakoushin/self-driving-car-javascript.git
cd self-driving-car-javascript
npm install

Note: the code in this project is expected to run on Node.js 12 or greater.

Training a model

node train.js [--data DATA_DIRECTORY] [--model [MODEL_DIRECTORY] [--epochs NUMBER_OF_EPOCHS]

# Example:

node train.js --data ~/Documents/track1 --epochs 3

Default values:

Driving a car

node drive.js [--model MODEL_DIRECTORY] [--speed SPEED_LIMIT]

# Example:

node drive.js --speed 20

Default values:

Author

Alex Bakoushin

License

MIT