Better Programming

Advice for programmers.

Follow publication

Member-only story

Detect Roads and Vehicles With YOLOPv2 In Grand Theft Auto 5

Install and set up YOLOPv2 so you can use it for drivable surfaces, lane lines, and vehicle detection with the video game GTA V

Jes Fink-Jensen
Better Programming
Published in
6 min readOct 16, 2022

--

Below, I will show you how to install and set up the YOLOPv2 project from GitHub. In addition, I'll show you how to test the installation. After that, I'll review the code for using YOLOPv2 with the video game Grand Theft Auto 5. Finally, I'll show you the results of running the code with the game.

Installing and setting up YOLOPv2

You can find a description of YOLOPv2 on Github here.

To install the project files, you can do the following:

git clone https://github.com/CAIC-AD/YOLOPv2.git
cd yolopv2
pip install -r requirements.txt

The directory layout of the project looks like this:

D:.
├───data
│ ├───demo
│ ├───log
│ └───weights
└───utils

Download the yolopv2.pt model file from here and place it in the weights directory.

You can run the demo to check that the installation was performed correctly:

python demo.py

--

--

No responses yet

Write a response