luogan129 / Yolov8-CS2-detection

This project is for self-study about the Yolo object detection algorithm in real-time gaming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yolov8-CS2-detection

This project is for self-study about applying the Yolo object detection algorithm in real-time gaming CS-2.

Table of Contents

Features

  • Detecting the two classes of characters(T, CT) in the game
  • Detecting the head positions(Th, CTh) from two type of classes Example Image

Getting Started

This project Ensure you have the following dependencies installed before running the project:

You can use the following command to manually install all required libraries.

# requires your device support cuda11.8
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Pip install ultralytics
pip install pywin32
# Then downgrade the pillow lib to 9.5
pip install "Pillow==9.5"

OR

You can also use the requirements file to check your env:
When I was using the reuqirements file, this cuda install is giving me most of the headache, so you may want to manually check your supported cuda version and download it first from here: https://pytorch.org/

# Install the pytorch packages manually first
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# Rest are easy
pip install -r requirements. txt

Usage

When trying to reproduce the result of this project, it is important to set the config.yaml file first.
After changing the root directory pointing to your data directory, you are good to go.

# Train the model
python yolo_train.py

# Validate the model
python yolo_val.py

# Run the model against real-time CS-2 game
python yolo_detect.py

About

This project is for self-study about the Yolo object detection algorithm in real-time gaming

License:MIT License


Languages

Language:Python 100.0%