e-mail : saihemanth.s@outlook.com
A python program that can drive a car in GTA V
Requirements
- Vjoy
- Xbox Vbus for Vjoy (Installaion documentation will be provided in the website)
- open IV
- GTA V (Very imortant)
- Nvidia GTX 1060 and above with a minimum of 6 GB Vram.
- YOLO v2 weights file https://pjreddie.com/media/files/yolov2.weights download it and put it inside root directory of project
- Simple trainer for GTA V https://www.gta5-mods.com/scripts/simple-trainer-for-gtav
Python Requirements
- Python >= 3.5
- opencv, Installation comman => pip install opencv-python
- tensorflow GPU, Installation command pip install tensorflow==1.14, pip install tensorflow-gpu==1.14
- darkFlow "https://github.com/thtrieu/darkflow" Detailed installation procedure is mentioned in this repo.
- keras
- Cython
- shapely
- pywin32 (Not available via pip directly, Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/ and search for pywin32 and download the compatible wheel, then do pip install xxx.wheel)
Running procedure
Important step
(You have to mod GTA V to change one texture)
open OpenIV and select GTA V for windows and browse for GTA V root folder
now select hit "Edit mode" on the top menu then select x64a -> textures -> "right click" on "graphics.ytd" choose "Edit"
now a window will open then search for radarmaskm and replace it with the provided one in this repo
then close after replacing and in main window hit edit mode again to come out of edit mode and close OpenIV
then change these settings in GTA V
Resolution = 800 x 600
Mode = windowed
now open digits_collect.py and edit values in vis = image[568:577, 600:699, :]
then make sure that the code outputs image
make sure that output image dimensions are 8 x 19 (h x w)
now put hese values in img_process.py and put the values in numbers = process(screen[568:576, 681:700, :]) this finishes the setup process for gta v and code
now set a location on the map then the output window should say "press T to start self driving"
Sample output click on the image to see the video.