Giter VIP home page Giter VIP logo

autonomouscarai's Introduction

AutonomousCarAI

Description

This is a deep learning model for a self-driving car. Neural network has been used to create a self driving car AI . The project consists of three phases:

  • Generating data
  • Training model
  • Self Driving

Generating data

The data for the neural network is generated by playing the game (provided in the link) and running main.py in training mode, the data generated consist of game frames as 30x30x3 array with keys w,s,a,d, both are captured while the user plays the game.

Training

Once the data is gathered this data is feeded to a neural network model model.py the model takes input frames as 1x2700 array and keys 1x4 array. Using the convolutional neural network, the model trains upon the data generated in previous phase.

Driving

Now run the main.py in driving mode. The trained model will predict and automate key-press on running the game in driving mode.

Prerequisites

The python library used to capture frames is Win32api which is only available on windows. As an alteranative Pyscreenshot can be used in linux but it capture frames extremely slow (~ 10fps). Keras with tensorflow backend has been used to train the model. Others: Numpy, Pandas, OpenCV , Pyautogui and Keyboard has been used.

How does it works?

  1. Run game.exe in 512x384.
  2. Once the red screen with the note "Press Space" appears run main.py. Let main.py know the location of the game. So don't press space until it finds the game screen.
  3. main.py will capture the location of the game and will ask whether to train, test or quit.
  4. Choose an option:
    • Training: use w, a, s, d to move the car on the road and press q to stop training. This will collect data and store it to data/ folder. Once data has been collected, run model.py to create a trained model for the self-driving car in the model/ folder. Now this model can be used for testing.
    • Testing: Testing here refers to driving. Once there is a trained model this option can be used. Just select the option and let the car drive itself. To stop testing, put the cursor on the opencv screen window and press esc.

Game Link

The link of the car game to be trained: https://www.dropbox.com/s/ji1ywiaj7s1kin7/Game-Updated.rar?dl=0

Video

Video recorded after accuracy 72.8%. https://www.dropbox.com/s/3a5ygtqumct2huc/carai.mp4?dl=0

autonomouscarai's People

Contributors

aj07 avatar akatsuki06 avatar faisal-zulfiqar avatar helithumper avatar hngouveia01 avatar jessicapaz avatar mukund26 avatar sandysingh avatar skolerst avatar sylveon 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.