Giter Site home page Giter Site logo

udacity-self-driving-car-simulator's Introduction

Udacity-Self-Driving-Car

CNN based Behavioral Cloning of Self-driving Car in Udacity’s Unity Simulation. Trained the model using the Keras API.

Getting Started

Clone the repository to your local directory

git clone https://www.github.com/dipampatel18/Udacity-Self-Driving-Car.git

Install the Dependencies

Run the following command to install the dependencies

sudo pip3 install -r requirements.txt

Download the Simulator

Download

Training

To train your own model, first, data collection is required. If you wish to collect your own data, delete all the files from the folder named data inside the src folder. Now, run the simulator from the beta simulator using the following command-

Make it executable

chmod a+x beta_simulator.x86_64

Running the application

./beta_simulator.x86_64

  • The simulator will start running
  • Select the desired scene and start the training mode
  • Press r to start the recording and navigate to the Udacity-Self-Driving-Car/src/data folder
  • Press r again and start driving the car around
  • The simulator is continuously recording center, left and right images, along with the steering angle, speed, throttle and brake
  • All the collected data will be stored in the data folder with the images in IMG folder and the data in driving_log.csv format

Begin training using the following command

python3 train.py

After every epoch, the trained model would be saved in the same directory in the format model-00#.h5. Rename the latest (or preferable) model as model.h5 for ease of use.

Testing

The trained model has its weights saved in the model.h5 file which can be directly loaded during the testing phase

Now, just like before, launch the simulation. Only this time, select the Autonomous Mode and then run the following command to start the testing of our trained model.

python3 test.py model.h5

Saving Test Run

In order to save the FPV frames of the agent and later convert it to a video, run the following command with the desired name of the folder-

python3 test.py model.h5 test_run

To convert those frames into a video, run the following command-

python3 video.py test_run

This will save a video in the current directory with the name test_run.mp4 at 60 fps. To change the fps, feed the above command with an argment-

python3 video.py test_run --fps 30

References

udacity-self-driving-car-simulator's People

Contributors

dependabot[bot] avatar dipampatel18 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.