Sequoia:CounterStrike的神经网络

  • n5_610540
    了解作者
  • 28MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-26 01:21
    上传日期
红杉-CS:GO AI检测机器人。 用于CounterStrike:GlobalOffensive字符检测和分类的神经网络。 建立在由软件提供支持的。 这个项目是在指导下开发的。 该项目结合了的微调版本,同时还使用辅助辅助神经网络来辅助分类任务。 推断后,边界框由yolo_inference.py文件处理,并根据从十字准线(目标)到敌人位置的距离来计算鼠标的移动。 免责声明:此软件的开发仅作为私人比赛的目的,作为概念证明,不会对其他玩家的体验造成损害。 如果您想在在线比赛中作弊,请注意还有许多其他更实际,更有效的方法。 先决条件 带有附加库的 所需库列表: ahk> = 0.11.1 Cython matplotlib> = 3.2.2 mss> = 6.1.0 numpy> = 1.18.5 opencv-python> = 4.1.2熊猫> = 1.1.5枕头PyYAML
Sequoia-main.zip
  • Sequoia-main
  • utils
  • google_app_engine
  • Dockerfile
    821B
  • additional_requirements.txt
    105B
  • app.yaml
    173B
  • __pycache__
  • datasets.cpython-38.pyc
    27.3KB
  • google_utils.cpython-38.pyc
    2.7KB
  • torch_utils.cpython-38.pyc
    8.5KB
  • __init__.cpython-38.pyc
    122B
  • general.cpython-38.pyc
    41.1KB
  • evolve.sh
    747B
  • general.py
    53.2KB
  • datasets.py
    38.3KB
  • __init__.py
    0B
  • google_utils.py
    4.9KB
  • activations.py
    2.1KB
  • torch_utils.py
    8.7KB
  • models
  • hub
  • yolov5-panet.yaml
    1.4KB
  • yolov5-fpn.yaml
    1.2KB
  • yolov3-spp.yaml
    1.5KB
  • __pycache__
  • yolo.cpython-38.pyc
    9.5KB
  • common.cpython-38.pyc
    8.6KB
  • __init__.cpython-38.pyc
    123B
  • experimental.cpython-38.pyc
    6.5KB
  • yolov5m.yaml
    1.4KB
  • export.py
    3.6KB
  • yolov5x.yaml
    1.4KB
  • experimental.py
    5.7KB
  • __init__.py
    0B
  • yolo.py
    12KB
  • yolov5s.yaml
    1.4KB
  • yolov5l.yaml
    1.4KB
  • common.py
    7.1KB
  • readmes
  • sketch.jpg
    700.2KB
  • sequoiabang.png
    181.6KB
  • light_classifier_diagram.png
    30.3KB
  • sample.gif
    12.5MB
  • sequoia-sketch2.jpg
    132.6KB
  • sequoia_samplebanner.gif
    14.3MB
  • __pycache__
  • light_inference.cpython-38.pyc
    1.8KB
  • strektref.cpython-38.pyc
    810B
  • csgodata.cpython-38.pyc
    4.8KB
  • yolo_detect.cpython-38.pyc
    4.4KB
  • fastercnn.cpython-38.pyc
    5.9KB
  • light_classifier.cpython-38.pyc
    5.4KB
  • datasetcsgo.cpython-38.pyc
    6.3KB
  • yolo_source.cpython-38.pyc
    3.7KB
  • .gitattributes
    49B
  • light_inference.py
    1.9KB
  • datasetcsgo.py
    6.4KB
  • compare_light_yolo.py
    9.1KB
  • light_classifier_v1.th
    26.4KB
  • findmeanstd.py
    3.6KB
  • light_classifier.py
    6.4KB
  • detect.py
    9.5KB
  • requirements.txt
    275B
  • yolo_source.py
    6.2KB
  • light_classifier_train.py
    9.6KB
  • strektref.py
    719B
  • LICENSE
    34.3KB
  • sequoiaV1.pt
    133B
  • README.md
    7.9KB
  • sequoia.code-workspace
    204B
  • .gitignore
    61B
  • models_info.txt
    34B
  • light_interpreter.py
    1KB
内容介绍
![Sample Gif](/readmes/sequoia_samplebanner.gif) # Sequoia - a CS:GO AI detection bot. [![C++](https://img.shields.io/badge/language-python-blue)](https://www.python.org/) [![CS:GO](https://img.shields.io/badge/game-CS%3AGO-yellow.svg?style=plastic)](https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/) [![Windows](https://img.shields.io/badge/platform-Windows-0078d7.svg?style=plastic)](https://en.wikipedia.org/wiki/Microsoft_Windows) [![x86](https://img.shields.io/badge/arch-x86-red.svg?style=plastic)](https://en.wikipedia.org/wiki/X86) [![License](https://img.shields.io/badge/license-GPL--3.0-brightgreen)](LICENSE) <br>![Windows](https://github.com/danielkrupinski/Osiris/workflows/Windows/badge.svg?branch=master&event=push) A neural network for CounterStrike:GlobalOffensive character detection and classification. Built on a custom-made dataset, powered by the [csgo-data-collector](https://github.com/IgaoGuru/csgo-data) software. This project was developed by [me](http://igorl.xyz), mentored by [Paulo Abelha](https://github.com/pauloabelha/). The project incorporates a fine-tuned version of [Ultralitic's YOLOv5](https://github.com/ultralytics/yolov5), while also using a secondary helper-NN for aiding in the classification task. After inference, the bounding boxes are processed by the **yolo_inference.py** file, and the mouse movement is calculated based on the distance from the crosshair (aim) to the enemy's location. **DISCLAIMER: This software was developed with the intention of only being used in private matches, as a proof of concept, causing no harm to other player's experiences. If you wish to cheat in online matches, be aware that there are many other much more practical and efficient ways of doing so.** ## Prerequisites * [Python 3.8.x](https://python.org) with additional libraries <details> <summary> list of required libraries:</summary> ahk>=0.11.1 Cython matplotlib>=3.2.2 mss>=6.1.0 numpy>=1.18.5 opencv-python>=4.1.2 pandas>=1.1.5 pillow PyYAML>=5.3 scipy>=1.4.1 tensorboard>=2.2 torch>=1.6.0 torchvision>=0.7.0 tqdm>=4.41.0 </details> After installing python, you can install all the necessary libraries with the following command: ``` pip install -r requirements.txt ``` * **strongly recommended**: [CUDA Toolkit 10.2](https://developer.nvidia.com/cuda-10.2-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal): CUDA is Nvidia's framework for high performance GPU computing. This software uses it to run the AI inside the GPU, instead of relying on the CPU, which is much slower. This means **you need an Nvidia GPU** to get the best possible performance out of the software. ## Neural Network Structure I've drawn this sketch/diagram to illustrate the high-level structure of the AI. ![](readmes/sketch.jpg) First, the screenshot is taken from the `detect.py` file. After being reshaped into the appropriate dimensions (1, 3, 512, 512), it first goes into the fine-tuned YOLO v.5. After YOLO's processing, the 512x512 image is cropped using the coordinates given by the first NN. From there, the cropped image is resized into a 32x32 image enclosing only the player to be classified. The second NN (Light_Classifier) then returns the final classification results, and the coordinates from YOLO are combined with Light's classification to form the final, complete output. ![](readmes/sequoia-sketch2.jpg) This slightly more professional-looking diagram illustrates the architecture of the Light_Classifier. The input is a 32x32 image that encloses the player to be classified. It then passes through three convolutional blocks, each containing a 2d convolutional layer, followed by 2d Batch Normalization and a reLU function. In these three blocks, the network "decomposes" the original image into many smaller matrices that represent learned features of the original frame. These could be edges, colors, shapes and dimensions that the NN finds to be important for the task. The outputs of the last convolutional block are then flattened into a one dimensional array, and fed through a sequence of three linear layers, which will "condense" the information grasped by the convolutions into a single digit at the end, representing the acessed probability that the image analyzed is a CounterTerrorist (in this case, if the probability is < 50%, the NN believes the character to be a Terrorist). ## Setting up for inference If you want to test out the model, you can do so using the `detect.py` file. The default resolution for the game is **1280x720**, but you can change that by adding the "-x" and "-y" flags, then specifying the desired resolution by its x (e.g. 1280) and y (e.g. 720) components. **Remember to always keep your game in the top-left corner of your monitor** If you notice that the window's window bar is getting captured in the screenshot, you can change the y_offset of the capture by specifying the height of you window bar in pixels with the "-off" flag. ### YOLO's and Light's pretrained weights YOLO was trained on **Google Cloud's compute engine** with a **12gb Tesla K80**. The dataset contained approximately **60k images**, and training took **15 epochs**. The YOLOv5-S pretrained model was used as the basis for finetuning. Light was trained on my local computer, with a **3gb gtx 1060**. The dataset contained approximately **60k images** (same as YOLO's), and training took **25 epochs**. The network was randomly initialized with seed **42**. > If you leave the `-w` and `-wl` flags on `detect.py` empty, the standard weights will be loaded ### using the auto-shooting mechanic [WIP] By default, auto-shooting is disabled because it is still in development, it's very slow and laggy at the moment. On the other hand, it's functional, so you might want to toggle it using the "-shoot 1" argument. This function has not been tested on other resolutions other than 1280x720, and if you know of a library/method that will emulate mouse movement faster than AHK, please reach me so I can implement it on the project. ## Training on custom data ### Obtaining data You will need a lot of data in order to fine-tune these models. Luckily, I've already taken care of that for you. You can use my [CS:GO Data-Collector](https://github.com/IgaoGuru/csgo-data) program. Everything about the dataset construction can be found in its own documentation. ### Training YOLOv5 and applying weights If you wish to train YOLOv5 on your own dataset, you can follow [Ultralytics own tutorial](https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data). After obtaining your custom weights, you can specify the path to them with the "-w [insert path here]" argument when running `detect.py`. ### Training Light_Classifier and applying weights The Light_Classifier takes advantage of the csgo-data dataset for training. After obtaining a dataset, you can specify its root path with the argument "-rp [path]" when calling the `light_classifier_train.py` file. You can run `light_classifier_train.py -h` to get a list of all the variables you may want to configure, and its respective flags - such as batch_size, dataset length, number of epochs, learning rate and others. ## Acknowledgments * [Paulo Abelha](https://github.com/pauloabelha/), for lending me his experience and knowledge, and for enabling this project to exist. * [All of the team at Ultralytics](https://github.com/ultralytics), for developing such an awesome Neural Network, that was the backbone AI for the project. * [Daniel Krupiński](https://github.com/danielkrupinski), for developing and maintaining the open-source software that was used as the basis for my [CS:GO data collection program](https://github.com/IgaoGuru/csgo-data), which was crucial for the development of the project's dataset. ## License > Copyright (c) 2020-2021 Igor Rocha This project
评论
    相关推荐
    • opencv汽车分类训练正负样本
      opencv汽车分类训练正负样本,其中正样本516张,负样本1045张,从视频上手工抠图下来的,可以用来做车辆分类训练测试,低分提供给大家,欢迎实验
    • opencv 分类
      OPCV分类,可以做图片分类参考。
    • googlenet图像分类opencv源码.rar
      里面保护全部东西,bvlc_googlenet.caffemodel,bvlc_googlenet.prototxt,synset_words.txt, 还有源码
    • OpenCV人检测分类
      opencv中haar+Adaboost已经训练好的分类器。有双目、身体等等,出自专家之手,必属精品,CV 1.0版本。
    • opencv人眼检测分类
      opencv 人眼检测 分类器 harropencv 人眼检测 分类器 harropencv 人眼检测 分类器 harropencv 人眼检测 分类器 harropencv 人眼检测 分类器 harropencv 人眼检测 分类器 harropencv 人眼检测 分类器 harr
    • opencv内置各种分类
      opencv内置人脸识别分类器,对于个人进行人脸检测,更换不同的分类器可得到不同的效果
    • OpenCV - 训练分类
      OpenCV - 训练分类
    • Opencv和图像分类
      使用Opencv进行图像分类的应用程序,对图像的区分程度不错。
    • OpenCV分类训练器
      用窗口界面形式运行OpenCV分类器,参数只需设置即可, 此文件为源码
    • OpenCV
      OpenCV 特征检测,分类器图像