Skip to content

RUN this code on NVIDIA 1060 and above gpu with tensorflow-gpu installed

Notifications You must be signed in to change notification settings

hemanth2410/Self-Driving-Agent-GTA-5

Repository files navigation

Self-Driving-Agent-GTA-5

Author S. Sai Hemanth

Author M.L. Vihari

Author G. RaviTeja

A python program that can drive a car in GTA V

Requirements

  1. Vjoy
  2. Xbox Vbus for Vjoy (Installaion documentation will be provided in the website)
  3. open IV
  4. GTA V (Very imortant)
  5. Nvidia GTX 1060 and above with a minimum of 6 GB Vram.
  6. YOLO v2 weights file https://pjreddie.com/media/files/yolov2.weights download it and put it inside root directory of project
  7. Simple trainer for GTA V https://www.gta5-mods.com/scripts/simple-trainer-for-gtav

Python Requirements

  1. Python >= 3.5
  2. opencv, Installation comman => pip install opencv-python
  3. tensorflow GPU, Installation command pip install tensorflow==1.14, pip install tensorflow-gpu==1.14
  4. darkFlow "https://github.com/thtrieu/darkflow" Detailed installation procedure is mentioned in this repo.
  5. keras
  6. Cython
  7. shapely
  8. 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

Should be something like this

now select hit "Edit mode" on the top menu then select x64a -> textures -> "right click" on "graphics.ytd" choose "Edit"

Should be something like this

now a window will open then search for radarmaskm and replace it with the provided one in this repo

Should be something like this

then close after replacing and in main window hit edit mode again to come out of edit mode and close OpenIV

Should be something like this

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 Should be something like this

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.

see output here

About

RUN this code on NVIDIA 1060 and above gpu with tensorflow-gpu installed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages