Code Monkey home page Code Monkey logo

self-driving-car-demo's Introduction

Self Driving Car Demo

Overview

A project that trains a virtual car to how to move an object around a screen (drive itself) without running into obstacles using a type of reinforcement learning called Q-Learning. More information can be found on the writeup about this project in part 1, part 2, and part 3. This the code for 'Build an Self Driving Car in 5 Min' on Youtube

Dependencies

Use pip to install any missing dependencies

Basic Usage

  1. Update pymunk to python3 by CDing into its directory and running 2to3 -w *.py

  2. First, you need to train a model. This will save weights to the saved-models folder. You may need to create this folder before running. You can train the model by running python3 learning.py It can take anywhere from an hour to 36 hours to train a model, depending on the complexity of the network and the size of your sample. However, it will spit out weights every 25,000 frames, so you can move on to the next step in much less time.

  3. Edit the nn.py file to change the path name for the model you want to load. Sorry about this, I know it should be a command line argument. Then, watch the car drive itself around the obstacles! Run python3 playing.py

  4. Once you have a bunch of CSV files created via the learning, you can convert those into graphs by running: python3 plotting.py

This will also spit out a bunch of loss and distance averages at the different parameters. That's it!

Credits

Credit for the vast majority of code here goes to Harvitronix. I've merely created a wrapper around all of the important functions to get people started. Below are a few sources he cited.

self-driving-car-demo's People

Contributors

llsourcell avatar testbounty avatar

Watchers

James Cloos 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.