Aim python cs go

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

AI based aimbot used for CS:GO. Uses python and darknet with custom YOLO_v4_tiny weights for CS:GO.

RenarsKokins/darknet_aimbot

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Darknet based aimbot (python 3)

AI based aimbot (mainly used for CS:GO) for testing purposes. This aimbot uses darkflow port to windows (darknet) and coco_v3_tiny coco_v4_tiny weights. Of course it isn’t as good as a human in games, but it works as a concept preety well! It runs fast enough to detect in real-time, but lacks accuracy at range. I have created a custom dataset using images for T’s and CT’s and trained weights. It works better than before, but sometimes mistakes random objects as heads or enemies (because I trained it with only ~550 images). I should have labeled ~2000 images instead (in the future I will).

I was testing it in CS:GO and it ran pretty well, but it doesnt recognize people in the distance and sometimes mistakes random objects (as guns, dead bodies, blood, etc.) as humans. As of update v0.6, it runs on custom CS:GO dataset and recognizes T from CT, but needs more labeled images. I also created a labeling program for this specific job in C#.

  1. Install Python 3!
  2. Make sure you have installed CUDA and CUDNN (must be v10.0 and requires NVIDIA GPU)!
  3. Install all necessary libraries(mss, d3dshot, cv2, keyboard, etc.). Just check the aimbot_v2.py file imports.
  4. Try to launch aimbot_v2.py and if it runs, good job!
  5. If you use it for CS:GO, run the game on «windowed fullscreen» mode and disable «raw input» in the mouse settings.
Читайте также:  Пересечение двух массивов java

To toggle the aimbot, press ‘c’ and it should start aiming, press it again to disable. To switch which enemies will be shot at, press ‘p’ and look at python console (it will show T or CT). To switch recoil, press ‘v’ and check the console. To close it, press on the open window and then press ‘q’ on keyboard.

  1. Create Improve CS:GO character dataset and train weights based on this dataset to improve accuracy and target only CT or T.
  2. Improve aiming accuracy (it often misses the shot when character is moving, because there is a small delay between screen capture and real game. Needs some sort of prediction I guess).
  3. Create a GUI.
  4. Create a faster screen capture (if even possible).
  5. Code optimisation.
  1. Upgraded from yolo_v3_tiny to yolo_v4_tiny with custom labels.
  2. Detection speed upgrades.
  3. Small code optimizations.

Источник

TensorFlow Object Detection CS:GO aim bot

In this part, we’re going to change our code, that we could detect enemies, move our mouse and shoot them.

The Most Advanced Data Science Roadmaps You’ve Ever Seen! Comes with Thousands of Free Learning Resources and ChatGPT Integration! https://aigents.co/learn/roadmaps/intro

Welcome to part 7 of our TensorFlow Object Detection API tutorial series. First, you can download the code on my GitHub page. In this part, we’re going to change our code, that we could find the center of detected rectangles on our enemies, move our mouse to the center and shoot them.

In this tutorial, we are working with the same files as we used in the 6th tutorial. To achieve desired goals for this tutorial, we’ll need to add several lines to the code. At first, we start with importing pyautogui library:

This library will be used to move our mouse in the game. But some games may not allow you to move the mouse, and then you will need to start a python script with administrator rights, the same as I am doing for CSGO in my YouTube video tutorial.

Next, we are changing the defined monitor size line to the following below. We are doing this because we will use our window width and height in other places to calculate the right coordinates for our game. So to avoid mistakes and not to write the same values in many places, we are defining our window size accordingly:

width = 800 height = 640 monitor =

Before moving to our main while loop, we define a new function, which we’ll use to aim and shoot enemies. As you can see in the following function, we are calculating y differently from x. In my YouTube tutorial, we’ll see that we are shooting above the head when we calculate y in the same way as x. So we are removing that difference by dividing our desired screen height by 9 and adding it to standard y height.

def Shoot(mid_x, mid_y): x = int(mid_x*width) y = int(mid_y*height+height/9) pyautogui.moveTo(x,y) pyautogui.click()

Next, we are improving our code while working in our main while loop. So we create the following for loop. At first, we initialize the array_ch array, where we will place all our ch objects. Then we are going through the boxes[0] array, and if we find our needed classes, we check it for detection percentage. For example in our case classes[0][i] == 2 is equal to ch and if scores[0][i] >= 0.5 of this class is equal or more than 50 percent we assume that we detected our object. In this case, we are taking boxes array numbers, where:

boxes[0][i][0] – y axis upper start coordinates boxes[0][i][1] – x axis left start coordinates boxes[0][i][2] – y axis down start coordinates boxes[0][i][3] – x axis right start coordinates 

While subtracting the same axis start coordinates and dividing them by two, we receive the center of two axes. This way, we can calculate the center of our detected rectangle. And at the last line, we are drawing a dot in a center:

array_ch = [] for i,b in enumerate(boxes[0]): if classes[0][i] == 2: # ch if scores[0][i] >= 0.5: mid_x = (boxes[0][i][1]+boxes[0][i][3])/2 mid_y = (boxes[0][i][0]+boxes[0][i][2])/2 array_ch.append([mid_x, mid_y]) cv2.circle(image_np,(int(mid_x*width),int(mid_y*height)), 3, (0,0,255), -1)

These few lines of code were only for one object, and we do this for all four objects:

for i,b in enumerate(boxes[0]): if classes[0][i] == 2: # ch if scores[0][i] >= 0.5: mid_x = (boxes[0][i][1]+boxes[0][i][3])/2 mid_y = (boxes[0][i][0]+boxes[0][i][2])/2 array_ch.append([mid_x, mid_y]) cv2.circle(image_np,(int(mid_x*width),int(mid_y*height)), 3, (0,0,255), -1) if classes[0][i] == 1: # c if scores[0][i] >= 0.5: mid_x = (boxes[0][i][1]+boxes[0][i][3])/2 mid_y = boxes[0][i][0] + (boxes[0][i][2]-boxes[0][i][0])/6 array_c.append([mid_x, mid_y]) cv2.circle(image_np,(int(mid_x*width),int(mid_y*height)), 3, (50,150,255), -1) if classes[0][i] == 4: # th if scores[0][i] >= 0.5: mid_x = (boxes[0][i][1]+boxes[0][i][3])/2 mid_y = (boxes[0][i][0]+boxes[0][i][2])/2 array_th.append([mid_x, mid_y]) cv2.circle(image_np,(int(mid_x*width),int(mid_y*height)), 3, (0,0,255), -1) if classes[0][i] == 3: # t if scores[0][i] >= 0.5: mid_x = (boxes[0][i][1]+boxes[0][i][3])/2 mid_y = boxes[0][i][0] + (boxes[0][i][2]-boxes[0][i][0])/6 array_t.append([mid_x, mid_y]) cv2.circle(image_np,(int(mid_x*width),int(mid_y*height)), 3, (50,150,255), -1)

After this, we are making shooting function. So as a team = «t» we choose who we will be shooting at. In this case, we are trying to shoot terrorists. So at first, we check if we have detected terrorist heads. We call Shoot(mid_x, mid_y) function with needed coordinates if we have detected at least one head. If we don’t have heads detected, we check maybe we have detected terrorist bodies. If we did, we call the same shooting function. Otherwise, we don’t call the Shooting function.

team = "t" if team == "c": if len(array_ch) > 0: Shoot(array_ch[0][0], array_ch[0][1]) if len(array_ch) == 0 and len(array_c) > 0: Shoot(array_c[0][0], array_c[0][1]) if team == "t": if len(array_th) > 0: Shoot(array_th[0][0], array_th[0][1]) if len(array_th) == 0 and len(array_t) > 0: Shoot(array_t[0][0], array_t[0][1])

Note that we change «t» to «c» at the first line if we would like to shoot at counter-terrorists.

Читайте также:  Python week in month

This was only a short explanation of code, full code you can download from the above files. In my YouTube video, you can see how my CSGO aimbot model is working. For now, I am really disappointed about our FPS because no one can play at these numbers. But I am glad that our bot can target enemies quite accurate and shoot them. So maybe for the next tutorial, I will think about what we could do to make it work faster.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

🎯 An aimbot that uses Yolov5 and PyTorch to play CS:GO

daniabib/csgo-aimbot

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

Читайте также:  Javascript как увеличить блок

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

An aimbot that uses Yolov5 and PyTorch to play CS:GO. It is able to identify the characters from both teams and their heads. It uses pyautogui to handle the aim movement and mouse click.

Currently, only Linux is supported.

You have to turn OFF the Raw Input option in the game. Otherwise, the mouse signal goes straight to the game engine without passing through the operating system and pyautogui can’t handle it properly.

Alt-test

This setting is under the Mouse & Keyboard tab:

To clone and install this application you will need Git and Python>=3.9.0.

# Clone this repository git clone https://github.com/daniabib/csgo-aimbot.git # Go into the repository cd csgo-aimbot # Install required libraries pip install -r requirements.txt 

I suggest that the game is already open in the background before launching the model.

To run the app just execute the main script:

The model will be running in the background. As soon as it detects a CS:GO character it will activate the pyautogui engine to move the mouse and shoot.

The intent of this repository is exclusively educational. It has no intention of being a way of cheating in the game. I advise that you use it only on your own server. If you use it in a Valve server it will probably detect suspicious activities and your account can be banned.

About

🎯 An aimbot that uses Yolov5 and PyTorch to play CS:GO

Источник

Оцените статью