Theme customizer
Revert customizations made in this style
What's new
MakebaJain
Auto Play
  • 1.
    MakebaJain
  • 2.
    JerichoIniko
  • 3.
    Savage Love (Laxed - Siren Beat)Jawsh 685, Jason Derulo
  • 4.
    Savage RemixMegan Thee Stallion, Beyoncé
  • 5.
    Out WestJACKBOYS & Travis Scott feat. Young Thug
  • 6.
    WAPCardi B, featuring Megan Thee Stallion
  • 7.
    Say SoDoja Cat
  • 8.
    Tap InSaweetie
  • 9.
    The BoxRoddy Ricch
  • 10.
    Rags2RichesRod Wave ft. ATR SonSon
  • 11.
    SupalonelyBENEE, featuring Gus Dapperton
  • 12.
    What You Know Bout LovePop Smoke
  • 13.
    Bagaikan Langit (Cover)Karin
  • 14.
    RelationshipYoung Thug, featuring Future
  • 15.
    Lottery (Renegade)K Camp
  • 16.
    Banana (DJ FLe - Minisiren Remix)Conkarah featuring Shaggy
  • 17.
    BailaTampa Curhat Beat and Karl Wine
  • 18.
    CoñoPuri, featuring Jhorrmountain x Adje
  • 19.
    Sunday BestSurfaces
  • 20.
    Death Bed (Coffee for Your Head)Powfu
  • 21.
    Stunnin'Curtis Waters, featuring Harm Franklin
  • 22.
    DreamsFleetwood Mac
  • 23.
    Boss BitchDoja Cat
  • 24.
    Potential BreakupAly & AJ
  • 25.
    Whole Lotta ChoppasSada Baby
  • 26.
    Love StoryTaylor Swift
  • 27.
    PeachesJustin Bieber ft. Daniel Caesar and Giveon
  • 28.
    DiorPop Smoke
  • 29.
    Best FriendSaweetie ft. Doja Cat
  • 30.
    As It WasHarry Styles
  • 31.
    Montero (Call Me By Your Name)Lil Nas X
  • 32.
    Love You SoThe King Khan & BBQ Show
  • 33.
    Monkeys Spinning MonkeysKevin MacLeod & Kevin The Monkey
  • 34.
    RompeDaddy Yankee
  • 35.
    Leave the Door OpenSilk Sonic
  • 36.
    Gimme MoreBritney Spears
  • 37.
    First ClassJack Harlow
  • 38.
    All Too WellTaylor Swift
  • 39.
    My Name IsD Billions
  • 40.
    We Don't Talk About Brunothe Encanto Cast
  • 41.
    We Don't Talk About Brunothe Encanto Cast
  • 42.
    Sneaky SnitchKevin MacLeod
  • 43.
    Dance MonkeyTones and I
  • 44.
    Vibe (If I Back It Up)Cookie Kawaii
  • 45.
    Just a Cloud AwayPharrell Williams
  • 46.
    In My MindNever Dull ft Crystal Waters
  • 47.
    Zou Bisou BisouGillian Hills
  • 48.
    CrazyPatsy Cline
  • 49.
    Oh NoKreepa
  • 50.
    Miami, My ArmyKeith Whitley
  • 51.
    Love Nwantiti (Ah Ah Ah)CKay ft Joeboy and Kuami Eugene
  • 52.
    MoneyLisa

How to write your own detection AI model?

sirius02

Newbie Navigator
Member
Joined
Aug 14, 2024
Messages
8
Reaction score
2
Points
3

Want to automate resource extraction in games? Aimbot on pixels? Make a recognition system? Or do you need to recognize objects on the screen for something else? In any case, in this guide I will try to explain how to do it in a short and simple way.​

First, let's go over the requirements:
- Python
- Account on roboflow
- Video card (I used a 3060 for training)
- Patience

First, you need to install python - You can do it from here
Follow the installing instructions and go to roboflow website, it totally free!
We need this site to make an annotation for our screenshots.
After logging in you need to create a new project
1723737767523.png
YOU MUST CHOOSE OBJECT DETECTION

Tip: if you do not want to public share your annotations just use random project name
After choosing the name we will have the menu like this

1723737930369.png
This is where we can upload our screenshots, videos, youtube videos, gifs, or anything that well represents the item we need to look for on the screen
1723738059894.png
After uploading you will have menu like this - I recommend to try Auto Label, but it mostly ruins the detection, so we press Manual Labeling and then Start Annotating
1723738208895.png
Here is the main menu, here is everything simple, just make a box on the item that you need to teach your AI model
1723738300190.png
In the end it must be like that, do not extend it too much, so recognition in games would work more correctly. To make it more precise just add more photos from any fov and angle that is possible.
Then add images to dataset and go to Generate tab
1723738414417.png
You can look all options, but its not necessary and press continue till it generate training dataset.
1723738569672.png
Press export Dataset and save it in YOLOv8 format. After downloading you can close the tab with roboflow.
Congratulations, you just created the dataset where your future model will be trained!

Training part:
Open cmd and write
Code:
pip install ultralytics
If everything correct than you can unzip the folder with our dataset in any place and create a new file with name "main.py" in the same file directory
After that just open that file with any code/txt editor and write the next code:
Python:
from ultralytics import YOLO

# Loading model
model = YOLO('yolov8n.pt')  # 'n' for small model, you can choose 's', 'm', 'l', 'x'

# Model training
results = model.train(data='path/to/your/data.yaml', epochs=400, imgsz=640)
The model is started training!
If you want to train it with GPU - you need to download driver CUDA for NVIDIA and idk what for AMD
After that you will have the results with file named best.pt, it should be tested on images before involve it in code, so let's make a quick test!

Python:
from ultralytics import YOLO

# Loading model
model = YOLO('path/to/your/best.pt')

# Path to your image for testing
results = model('path/to/test/image.jpg')

# Visualisation
results[0].plot()

If everything is correct - good job, now you can use it any game you would look like!
If something is bad at recognation - make sure you created good database and have enough epochs for training this model, maybe it have too many parameters and tags, you can look how good your dataset on roboflow Live check tab!

 

Attachments

  • 1723738529920.png
    1723738529920.png
    184.9 KB · Views: 0
Yes, I'm tired of writing this towards the end of the post, but I can answer your questions below the post if anything is unclear!
 

Similar threads

Replies
2
Views
354
Replies
0
Views
260
Replies
1
Views
309
Replies
0
Views
12K
Replies
1
Views
392
Back
Top