/AimAide

Object Detection-based external aim aiding for CSGO

Primary LanguagePython

AimAide for CSGO and soon CS2

*UPDATE!
as long as raw input can not be disabled in CS2 the mouse mover does not work.
models seem to work tho

External realtime object detection-based aim aiding powered by YOLOv8, CUDA and TensorRT
Twitter for further development updates


Video Demo here

Latest changes/additions


13/09/23
fixed initial TensorRT engine building when starting for the first time from webui launcher
changed ultralytics version to required 8.0.58, cause there are some issues with newer versions

25/07/23
-added a webui launcher for comfortably changing settings
just run launcher.py from your command line



16/05/23
-new model which is optimized on heads on mirage (high headshot rate, --minconf 0.6 recommended)
models/yolov8s_csgo_mirage-320-v62-pal-gen-bg-head.pt
-added flickieness argument to control how fast the mouse mover should flick to target

09/05/23 - bug in d3d_np grabber fixed (mixed up color channels), code improvements, removed engines from repo (engines will built locally),
d3d_gpu is disabled and needs to be rewritten
16/04/23 - engine builder added to circumvent TensorRT incompatibilities
(by https://github.com/triple-Mu/YOLOv8-TensorRT)
15/04/23 - introduced 320x320 input models which drastically increase fps with YOLO and TensorRT

Supported Maps

* Mirage

Road Map

Models for CS2 and support for additional maps
Human-like aim methods (like windmouse or ai-based)

Features

YOLOv8 Models trained on mirage with various CT and T agents (body and head).
Simple smooth linear mouse mover locking onto target closest to crosshair.

Hardware Requirements

To get this to work the detector has to run at 30fps at least.
NVIDIA GTX1070 runs at 30fps on a 640x640 model or 60fps on a 320x320 model with TensorRT.
NVIDIA RTX4090 should max out at ~120fps on a 640x640 model. (also TensorRT)

Installation

1) NVIDIA CUDA Toolkit >= 11.7
2) Python 3.10.6 environment
3) Corresponding PyTorch CUDA Package -> https://pytorch.org/get-started/locally/
4) pip install -r requirements.txt

Optional but recommended:
5) NVIDIA TensorRT >= 8.4 -> https://developer.nvidia.com/tensorrt -> https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html

Speedup for bigger models with TensorRT is significant.
Thats why all models bigger than medium will only be released as TensorRT engines.
Models will be released as YOLO weights and locally built as TensorRT engines on first start up.
This is due to TensorRT version incompatibilities.

Usage

I) Disable windows mouse acceleration
II) Disable raw input in CSGO
III) Cap max_fps in CSGO at your native display refresh rate

1) Run either run_tensorrt.py or run_yolo.py
2) Selective detection can be activated by running with argument -side 'your side' (t, ct or dm for detecting all)
If you want to change the detection mode while the script is running, simply write 't', 'ct' or 'dm' into the console and hit enter


3) Depending on your hardware choose from 3 different models (nano, small, medium)
nano (highest framerate, lowest detection performance),
medium (lowest framerate, best decetion performance)
4) Run in benchmark mode first to see what framerate you get (over 60fps increase sensitivity mode)
5) Adjust mouse sensitivity in CS and/or sensitivity mode of AimAide

Benchmark mode

Run run_tensorrt.py or run_yolo.py with argument --benchmark to start in benchmark mode.
This is going to run the detector in view-only- and detect-all mode for 300 iterations.
Switch to CSGO and run/look around. At the end the average fps of the detector during that time will be displayed.

Arguments

arg default Description
--input_size 320 dimension of the input image for the detector
--grabber 'win32' select screen grabber (win32, d3d_gpu, d3d_np)
--model models/yolov8s_csgo_mirage-320-v41-al-gen-bg selected engine (TensorRT) or weights (YOLOv8)
--side 'dm' which side your are on, 'ct', 't' or 'dm' (deathmatch)
--minconf 0.75 minimum detection confidence
--sensitivity 1 sensitivity mode, increase when having a high framerate or chaotic aim
--flickieness 4 how flicky the mouse mover behaves (4 is slow, 16 is very flicky)
--visualize False show live detector output in a new window
--view_only False run in view only mode (disarmed)
--benchmark False launch benchmark mode
--no_engine_check False skips engine checking and building (run_tensorrt.py only)

FAQ

Q: Why does AimAide seem to be stuck on launch?
A: This is a known issue with the YOLO class, run your command line as administrator.

Q: Why is the aiming is so chaotic and unnatural?
A: Probably due to high detector framerate. Increase the sensitivity mode by running with arg -sensitivity (default is 1)

Q: Why is the aiming is so slow and laggy?
A: Probably due to low detector framerate. Run benchmark mode and check if you get an average fps of at least 30 while being ingame.


Feel free to fork this repo and/or use the models for your own projects. :)