Skip to content

luickk/gta_self_driving

Repository files navigation

GTA self driving Agent

The goal is to program a self-driving agent, that is capable of driving a car in gtaIV. Since the project aims on a approach which excludes every other data source except for the view of the driver the car is only ment to drive down a car way with no complex turning or overhaul maneuvers.

Demonstration video can be watched here


Realization

The Agent is programmed in python and trained with a CNN which is based on TensorFlow.

Installation

> - Clone Repository
> - Install Dependencies

Capture data

To collect data use collect_data.py.
Gta window has to be shrunk down to a resolution of 800x600
and moved to the left upper corner.

Set path variable to your prefered location.
Files will be saved in approximately 300KB .npy files(uncompressed).

To start collect_data.py several arguments can be used.
> - -s can be a number to define starting step manualy or "forward" to 
use existing files as step indicator.

Training

To train your model use train.py.
Set path variable to location where training data is saved.
Name your model by setting MODEL_NAME variable to your most preferred name.

Testing

To test your model use test_model.py.
Choose your already trained model by setting MODEL_NAME variable to your best trained one.

To test the agent the Gta window has to be shrunk down to a resolution of 800x600
and moved to the left upper corner.

Now, everything is ready to be tested.

Prefabricated models

Prefabricated models will be provided as far as I can produce them myself and 
as far as they fit my own requirements.

Dependencies

  • numpy
  • TensorFlow
  • tflearn
  • cv2
  • sys
  • glob
  • optparse
  • threading
  • keyboard
  • win32gui, win32ui, win32con, win32api
    If you get this error: ImportError: DLL load failed: The specified module could not be found., move pythoncom36.dll and pywintypes36.dll from Python36\Lib\site-packages\pywin32_system32 to Python36\Lib\site-packages\win32
    If you get this error: ImportError: No module named win32gui, after installing win32 and you are using 64 bit python install 64 bit win32 wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32 by using pip install <name>.whl
  • re

About

CNN that is trained to drive vehicles in GTAV

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages