DriveAI
DriveAI copied to clipboard
🏎️ Teaching a car how to drive using the NEAT algorithm in Python.
Car Learns to Drive "DriveAI" using NEAT
A.I. Learns to Drive built in Python using Pygame and NEAT Algorithm! 🏎️
Show support:
Star 🌟 the Project:
Follow 🤝 on GitHub:
Made by maxontech
Table of contents
- Description
- YouTube Videos
- Installation
- Controls
- Libraries
- FAQ
- Contact
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
- A.I. Learns to DRIVE #1 - Setup & Display Car
- A.I. Learns to DRIVE #2 - The Driving Car
- A.I. Learns to DRIVE #3 - Radars
- A.I. Learns to DRIVE #4 - Adding the A.I.
Installation
Requirements: You must have Python installed and preferably a code editor like PyCharm.
- Clone the repository
- In the terminal, navigate to the directory where the repository was cloned, e.g.,
C:\Users\Max\PycharmProjects\DriveAI - 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 - 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.
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.
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
- How to Open GitHub Projects in PyCharm? Explained Here
- How to use Virtual Environments? Explained Here
- How to install PyCharm and Python? Explained Here
- How to set PyCharm Config. and Interpreter? Explained Here
Contact
Feel free to reach out to me on Twitter if you have any questions or feedback! Hope you find this useful!