Skip to content

TaehoSamLee/inGameYolo

Repository files navigation

YOLOv4 Object Detection ReShade Addon

A ReShade addon that adds real-time object detection using YOLOv4 to any game. This addon displays bounding boxes and labels for detected objects directly in your game.

Features

  • Real-time object detection using YOLOv4
  • Displays bounding boxes around detected objects
  • Shows object labels with confidence scores
  • Customizable detection threshold and appearance
  • Support for 80 COCO dataset classes (people, vehicles, animals, etc.)

Current Status

  • Object detection currently runs on CPU
  • Compatible with ReShade 6.4.1+ using the addon system
  • Future updates will implement GPU acceleration for better performance

Requirements

  • ReShade 6.4.1 or newer (using the addon system)
  • Windows 10 or newer
  • DirectX 11/12 supported games
  • OpenCV 4.x (included in release)

Installation

  1. Install ReShade in your game following the official ReShade installation guide
  2. Download the latest release from the Releases page
  3. Extract the contents to your game directory where ReShade is installed:
    • ReShade_YOLOv4.addon → place in your game's executable directory
    • opencv_world4110.dll and other OpenCV DLLs → also place in your game's executable directory
    • Shader files → place in the reshade-shaders/Shaders/YOLOv4/ directory
  4. Download the YOLOv4 model files:
  5. Place the model files in the reshade-shaders/YOLOv4/ directory in your game folder
  6. Start your game and enable the "YOLOv4Detection" effect in the ReShade overlay

Required DLLs

Make sure the following files are in your game's executable directory:

  • ReShade_YOLOv4.addon (the addon itself)
  • opencv_world4110.dll (main OpenCV library)
  • opencv_videoio_ffmpeg4110_64.dll (video codec support)
  • opencv_videoio_msmf4110_64.dll (media foundation support)

Usage

  1. Toggle the effect on/off using ReShade's overlay (default key: Home)
  2. Adjust settings in the ReShade UI:
    • Detection Threshold: Controls the minimum confidence level to display detections
    • Show Bounding Boxes: Toggle displaying boxes around detected objects
    • Show Labels: Toggle displaying object class names
    • Box Thickness: Adjust the thickness of bounding box lines
    • Box Color: Change the color of the bounding boxes
    • Show Debug Info: Toggle debug overlays in the corners

Troubleshooting

  • Addon not loading (error code 126): Make sure all required OpenCV DLLs are in the game executable directory
  • No detections appear: Verify model files are in the correct location (reshade-shaders/YOLOv4/)
  • Performance issues: Try lowering the game resolution or adjusting the detection threshold

Building from Source

Prerequisites

  • CMake 3.12 or newer
  • Visual Studio 2019 or newer with C++17 support
  • OpenCV 4.11.0
  • ReShade Include files (from ReShade SDK)

Steps

  1. Clone the repository
  2. Place ReShade include files in the reshade/include directory
  3. Set OpenCV path in CMakeLists.txt if needed
  4. Configure CMake:
mkdir build
cd build
cmake ..
  1. Build the project:
cmake --build . --config Release
  1. Rename the compiled DLL from the build/bin/Release directory to ReShade_YOLOv4.addon
  2. Copy it and the required OpenCV DLLs to your game directory

How It Works

This addon uses the YOLOv4 (You Only Look Once) deep neural network to detect objects in the game frame in real-time. The detected objects are displayed as bounding boxes overlaid on the game with labels showing the object class and confidence score.

The current implementation:

  1. Runs on CPU using OpenCV's DNN module
  2. Performs detection at reduced frequency (every 200ms by default) for performance
  3. Renders detection results using ReShade shaders

Future Plans

  • GPU-accelerated object detection to improve performance
  • Support for multiple YOLOv4 model sizes (tiny, standard, etc.)
  • Custom class filters to show only objects of interest
  • Better visual integration with game rendering
  • Support for recording detection statistics

Credits

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published