Skip to content

Self-driving simulation using CNN to avoid obstacles as well.

License

Notifications You must be signed in to change notification settings

ratansingh98/Self-Driving-Car

Repository files navigation

Self Driving Car

Use git lfs clone https://github.com/ratansingh98/Self-Driving-Car.git to fetch all files.

Overview

This repository contains starting files for the Behavioral Cloning Project.

In this project, you will use what you've learned about deep neural networks and convolutional neural networks to clone driving behavior. You will train, validate and test a model using Keras. The model will output a steering angle to an autonomous vehicle.

We have provided a simulator where you can steer a car around a track for data collection. You'll use image data and steering angles to train a neural network and then use this model to drive the car autonomously around the track.

We also want you to create a detailed writeup of the project. Check out the writeup template for this project and use it as a starting point for creating your own writeup. The writeup can be either a markdown file or a pdf document.

To meet specifications, the project will require submitting five files:

  • model.py (script used to create and train the model)
  • drive.py (script to drive the car - feel free to modify this file)
  • model.h5 (a trained Keras model)
  • a report writeup file (either markdown or pdf)
  • video.mp4 (a video recording of your vehicle driving autonomously around the track for at least one full lap)

This README file describes how to output the video in the "Details About Files In This Directory" section.

Dependencies

You can install all dependencies by running one of the following commands

You need a anaconda or miniconda to use the environment setting.

# Use TensorFlow without GPU
conda env create -f environments.yml 

# Use TensorFlow with GPU
conda env create -f environment-gpu.yml

Or you can manually install the required libraries (see the contents of the environemnt*.yml files) using pip.

Usage

Run the pretrained model

Start up the Udacity self-driving simulator, choose a scene and press the Autonomous Mode button. Then, run the model as follows:

For driving using modelv1

python drive.py model.h5

For driving using modelv2

python drive.py modelv2.h5

Note : Modelv2 work for both sim v1 and sim v2, whereas in Modelv1 car crashes for simv2

To train the model

You'll need the data folder which contains the training images.

python model.py

This will generate a file model-<epoch>.h5 whenever the performance in the epoch is better than the previous best. For example, the first epoch will generate a file called model-000.h5.

About

Self-driving simulation using CNN to avoid obstacles as well.

Resources

License

Stars

Watchers

Forks