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
441 stars 76 forks source link

Just a note #15

Closed rlewkowicz closed 4 years ago

rlewkowicz commented 4 years ago

Based on a similar project I'm working on, I think you're mistaken about a number of things here (or maybe I am which would be great). With yolov3 tiny, I'm getting at best 7ms a frame and that's on a video. I think most implementations batch frames to achieve this. For real time inference, you're sending single frames captured in real time. I think I see something closer to 12-14ms in this case. All this is with a GTX 1080. I'd be interested to know what repo (if at all) you're basing your work on to get the claimed results.

Then as an aside, most repos seem to function slower on Windows by about 5x. Tensor flow or pytorch. Which means it could be a matter of opencv or numpy etc causing issues

petercunha commented 4 years ago

The limiting factor for speed is the time it takes to capture a screenshot. The neural net itself is very quick, but the screen capture FPS is slower. I'm looking into using Nvidia CUDA API's to extract the raw framebuffer from the GPU (rather than using the pywin32 API, which is much slower).

If you have any other ideas to improve speed, feel free to write the code and open a PR.

xrv0 commented 4 years ago

The limiting factor for speed is the time it takes to capture a screenshot. The neural net itself is very quick, but the screen capture FPS is slower. I'm looking into using Nvidia CUDA API's to extract the raw framebuffer from the GPU (rather than using the pywin32 API, which is much slower). ...

@petercunha I‘ve looked into this and I dont think its possible

Sent with GitHawk

FidgetySo commented 4 years ago

@petercunha I believe why it is not possible because python runs in its own environment kinda like a virtual computer, at least based on my research and my use of python, which means that you can't really get a raw buffer from the GPU. But if anything you can with do it ctypes or something I have not heard of. You also might want to look into this https://github.com/SerpentAI/D3DShot Great Programmer used his SerpentAI Framework in the past,

FidgetySo commented 4 years ago

These are the fps rates:

2560x1440 on NVIDIA GTX 1080 Ti 1920x1080 on Intel UHD Graphics 630 1080x1920 (vertical) on Intel UHD Graphics 630 "pil" 29.717 FPS 47.75 FPS 35.95 FPS "numpy" 57.667 FPS 58.1 FPS 58.033 FPS "numpy_float" 18.783 FPS 29.05 FPS 27.517 FPS "pytorch" 57.867 FPS 58.1 FPS 34.817 FPS "pytorch_float" 18.767 FPS 28.367 FPS 27.017 FPS

Just imagine a 1060 6GB on 1080p

petercunha commented 4 years ago

@AutisticDragon thanks for sharing the benchmarks! I will also look into that library you recommended.