petercunha / Pine

:evergreen_tree: Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
MIT License
442 stars 76 forks source link

Only 40fps? #47

Open DylanJRoberts opened 3 years ago

DylanJRoberts commented 3 years ago

Currently using a Titan V and a i9 10850k 64gb ram and getting very low fps, i rebuilt opencv with cuda and still no luck. any ideas?

miguel-leal commented 2 years ago

I see that I can play on full screen and aimbot works fine, without fps drops

evan-kolberg commented 2 years ago

Currently using a Titan V and a i9 10850k 64gb ram and getting very low fps, i rebuilt opencv with cuda and still no luck. any ideas?

Weird. I am using a Ryzen 7 CPU and an RX 570 to run CS:GO with an NVIDIA 1660 Ti to process the images and can achieve around 67 fps. What version of OpenCV and CUDA are you using?

I used this tutorial to build an OpenCV lib

Here is a python script test your GPU performance with CUDA against your CPU so you may be able to diagnose an issue

rlewkowicz commented 2 years ago

I just stumbled across this project. @DylanJRoberts try using anaconda.

# 2. Update conda
conda update -yn base -c defaults conda

# 3. Create virtual environment named 'p37'
conda create -y -n p37 python=3.7 anaconda

# 4. Activate
conda activate p37  # conda deactivate

# 5. Install dependencies
conda install -yc anaconda opencv matplotlib tqdm pillow
conda install -yc conda-forge scikit-image pycocotools protobuf numpy 
conda install -yc pytorch pytorch torchvision
pip install onnx onnxruntime 

Install anaconda Google "anaconda python installer" and make sure to set your path. Conda packages pre compiled". I haven't looked at anything yet, but if this is python based, I'll bet that solves 90% of your problems. I'd still be interested to hear more though. @evan-kolberg @miguel-leal

Does this really work work though? Or is it sketchy and weird? It has to be sketchy and weird. I built something similar to whatever this project is in python and it just never felt fast enough.

AdamRoden commented 1 year ago

I just stumbled across this project. @DylanJRoberts try using anaconda.

# 2. Update conda
conda update -yn base -c defaults conda

# 3. Create virtual environment named 'p37'
conda create -y -n p37 python=3.7 anaconda

# 4. Activate
conda activate p37  # conda deactivate

# 5. Install dependencies
conda install -yc anaconda opencv matplotlib tqdm pillow
conda install -yc conda-forge scikit-image pycocotools protobuf numpy 
conda install -yc pytorch pytorch torchvision
pip install onnx onnxruntime 

Install anaconda Google "anaconda python installer" and make sure to set your path. Conda packages pre compiled". I haven't looked at anything yet, but if this is python based, I'll bet that solves 90% of your problems. I'd still be interested to hear more though. @evan-kolberg @miguel-leal

Does this really work work though? Or is it sketchy and weird? It has to be sketchy and weird. I built something similar to whatever this project is in python and it just never felt fast enough.

@rlewkowicz Why would your suggestion improve performance? I had no experience with python but I've learned the basics to experiment with Pine and Lunar Lunar is similar, but runs on yolov5. I have some findings and am interested in your feedback.

  1. I don't use conda. I just open cmd, activate my project's venv, and then run the python program. What advantage would installing conda provide?
  2. It is sketchy and weird. It works sometimes, but the detection model has either many misses or many false positives depending on your confidence setting. It is nothing compared to an average gamer.
  3. I found that limiting my game to 30 FPS frees bandwidth for python to run faster. With a 1000x500 detection window I get 30-40 FPS.
  4. When detection is running smoothly simulated movements lag behind moving targets. Real world you naturally learn to lead the target, but this type of software in its simple form is reactionary rather than predictive.
  5. I'd love to optimize anything possible. I'm thinking of trying yolov8 to get a better detection model.
  6. I run it on a 1080ti using CUDA acceleration.