explaingit

chiguayeshao/obs-snap-detector

16PythonAudience · developerComplexity · 3/5ActiveSetup · moderate

TLDR

Windows learning project that captures the screen with DXGI, runs YOLOv8n to find people, and draws boxes through a click-through tkinter overlay.

Mindmap

mindmap
  root((obs-snap-detector))
    Inputs
      Screen frames via DXGI
      yolov8n.pt model
      config.py parameters
    Outputs
      Bounding boxes on overlay
      FPS measurement
    Use Cases
      Study DXGI capture
      Study YOLO inference
      Learn click-through overlay
    Tech Stack
      Python
      YOLOv8
      DXGI
      tkinter
      Windows API

Things people build with this

USE CASE 1

Study how OBS-style screen capture works on Windows via DXGI Desktop Duplication

USE CASE 2

Learn single-stage YOLOv8 person detection on live screen frames

USE CASE 3

Build a transparent click-through overlay window with tkinter

USE CASE 4

Prototype a producer-consumer frame loop with FPS counters

Tech stack

PythonYOLOv8DXGItkinterNumPyWindowsAPI

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Windows 10/11, Python 3.10+, administrator terminal for the global hotkey, and downloads a 6 MB model on first launch.

In plain English

obs-snap-detector is a Windows learning project that demonstrates how a so-called OBS-attached screen detector works under the hood. The README is clear that the code is for studying computer vision and Windows API techniques only. It deliberately does not include aim assistance or mouse control, and the author asks readers not to use it against other players in real games. The pipeline has three stages. First, capture.py reads the screen using the DXGI Desktop Duplication API, the same Windows interface that the OBS streaming software uses for its Display Capture source. Each frame comes back as an RGB numpy array. Second, detector.py runs the captured frame through YOLOv8n, a small object detection model, and asks it to find instances of the COCO dataset person class. The result is a list of bounding boxes. Third, overlay.py draws those boxes on a transparent tkinter window placed on top of the screen, using the Windows WS_EX_TRANSPARENT style so the mouse passes through the overlay instead of getting trapped by it. The runtime needs Windows 10 or 11, Python 3.10 or newer, optional NVIDIA GPU for faster inference, and the terminal must be started as administrator because the program registers a global hotkey. Installation is git clone, pip install of requirements.txt, then python main.py. On first launch the project downloads yolov8n.pt, a roughly 6 MB model file. F9 toggles the overlay on and off, and ESC quits the program. A config.py file collects the tunable parameters in one place: a confidence threshold of 0.5, an optional capture region instead of full screen, the highlight box color, the YOLO model size, and a target frame rate of 30. The README points readers at the four source files as study material, calling out the DXGI capture path, single-stage YOLOv8 inference, the transparent click-through overlay technique, and a producer-consumer main loop with FPS measurement.

Copy-paste prompts

Prompt 1
Walk me through obs-snap-detector's capture.py and explain how DXGI Desktop Duplication returns frames as numpy arrays
Prompt 2
Show me how detector.py wires YOLOv8n to filter for the COCO person class and return bounding boxes
Prompt 3
Explain the WS_EX_TRANSPARENT trick in overlay.py and how the mouse passes through the tkinter window
Prompt 4
Modify config.py to lower the confidence threshold and limit capture to a 800x600 region
Prompt 5
Add a CSV logger to obs-snap-detector that records detection counts and FPS over time
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.