WaylandGod / DriveAI

🏎️ Teaching a car how to drive using the NEAT algorithm in Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Car Learns to Drive "DriveAI" using NEAT

Preview

A.I. Learns to Drive built in Python using Pygame and NEAT Algorithm! 🏎️

Show support:
Star 🌟 the Project: GitHub stars
Follow 🀝 on GitHub: GitHub followers

Made by maxontech

Table of contents

Description

A Race Car that learns to drive! Built using NEAT and Pygame written in Python. NEAT stands for neuro evolution of augmenting topologies and is a genetic algorithm that creates artificial neural networks.

YouTube Videos

  1. A.I. Learns to DRIVE #1 - Setup & Display Car
  2. A.I. Learns to DRIVE #2 - The Driving Car
  3. A.I. Learns to DRIVE #3 - Radars
  4. A.I. Learns to DRIVE #4 - Adding the A.I.

Installation

Requirements: You must have Python installed and preferably a code editor like PyCharm.

  1. Clone the repository
  2. In the terminal, navigate to the directory where the repository was cloned, e.g., C:\Users\Max\PycharmProjects\DriveAI
  3. Create a virtual environment, activate it, and install pygame by running the following commands in the terminal:
    python -m venv venv #This creates a virtual environment
    venv\Scripts\activate #This activates the virtual environment
    pip install -r requirements.txt #This installs the required libraries
  4. Run the game by running the following command in the terminal:
    python main.py

Note on PyCharm: Often PyCharm detects the requirements and asks you to install them and create a virtual env. Preview Afterwards, the interpreter will be set to the virtual environment, and you can run the game by clicking the green play button in the top right corner. Preview

Controls

  • You don't need to control the car. The AI will do that for you :)

Libraries

  • pygame: Pygame is a cross-platform set of Python modules designed for writing video games.
  • NEAT: NEAT is a method developed by Kenneth O. Stanley for evolving arbitrary neural networks.

FAQ

Contact

Feel free to reach out to me on Twitter if you have any questions or feedback! Hope you find this useful!

About

🏎️ Teaching a car how to drive using the NEAT algorithm in Python.


Languages

Language:Python 100.0%