https://github.com/luickk/gta_self_driving
CNN that is trained to drive vehicles in GTAV
https://github.com/luickk/gta_self_driving
gta5 python36 tensorflow
Last synced: 10 months ago
JSON representation
CNN that is trained to drive vehicles in GTAV
- Host: GitHub
- URL: https://github.com/luickk/gta_self_driving
- Owner: luickk
- Created: 2017-09-05T09:09:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-30T10:12:09.000Z (over 2 years ago)
- Last Synced: 2025-04-10T20:25:23.596Z (10 months ago)
- Topics: gta5, python36, tensorflow
- Language: Python
- Homepage:
- Size: 23.8 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](media/demo.mp4)
----------
Realization
-------------
The Agent is programmed in python and trained with a [CNN](https://www.tensorflow.org/tutorials/wide_and_deep) which is based on [TensorFlow](https://www.tensorflow.org/).
#### 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 .whl`
> - re