It is assumed that you already have following things installed on your machine.
- Grand Theft Auto: Vice City game.
- Python 3.x
- TensorFlow 2.x
- OpenCV
- NumPy
If not already, kindly install these first before you move ahead.
To run the object detection inferences on the game, follow the steps below:
-
Clone the repository on your local machine.
-
Install the MSS library using
pip install mss. -
Install the TensorFlow Object Detection API using
pip install tensorflow-object-detection-api. -
Open the
label_map_util.pyfile and Edit Line 132 by replacingwith tf.gfile.GFile(path, 'r') as fid:withwith tf.io.gfile.GFile(path, 'r') as fid:. You will find this file in the following path:C:\Users\<your-username>\AppData\Local\Programs\Python\Python37\Lib\site-packages\object_detection\utils -
Open the GTA: Vice City game. In the display settings of the game, change the screen to windowed mode and preferrably set the resolution to 1024x768.
-
Open command prompt and run
vice_city_detection.pyand enjoy playing GTA: Vice City with real-time object detection.
