Build an Object Detector for Any Game Using YOLO

Ғылым және технология

Welcome to my Object Detection Using YOLO Tutorial! In this video, I'll guide you through the process of creating your own object detection system for gaming from scratch.
You can find the full tutorial and the source code used in the video in my GitHub repository: github.com/moises-dias/yolo-opencv-detector
This tutorial will help you detect objects and obtain their coordinates and class in Python, opening up possibilities for automation in gaming, using libraries like pynput to control your mouse or keyboard based on the detections.
0:00 Introduction
1:46 First part: Image Dataset Creation
6:05 Second part: Labeling the Image Dataset
14:46 Third part: Training the YOLO Model
18:55 Fourth part: Performing Detections
Leave a comment if you have any questions, and I'd love to see your results, if you want to, connect with me on LinkedIn to share your projects based on this tutorial: linkedin.com/in/moisesdias

Пікірлер: 231

  • @alpha-dq5nh
    @alpha-dq5nh5 ай бұрын

    THIS IS THE BEST TUTORIAL ON IN-SCREEN OBJECT DETECTION. PERIOD. Simplified and provides a base from which more things can be explored. Thank you for your efforts. I subbed and liked it. 🍻😊😊

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hey, thank you so much for your comment! It really made my day!

  • @noticiasdelinframundo

    @noticiasdelinframundo

    4 ай бұрын

    @@moisesdepaulodias7980 you can help me pls

  • @HoeLeeFuQQ

    @HoeLeeFuQQ

    4 ай бұрын

    Agreed. This is legendary

  • @tankaccount2990
    @tankaccount29904 ай бұрын

    As a software developer I thank you for how well this was made, it gave me a very good baseline to work with and was overall extremely well thought out, you earned my sub!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Thank you so much for your comment!!!

  • @R4ZZERE
    @R4ZZERE6 ай бұрын

    owwwwwww dude Here is the training that I have been looking for for a year and could not find, you are the only one, please do not give up on the training and I will be waiting for the continuation, I am starting now. thxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

  • @IndioPapaxota
    @IndioPapaxota24 күн бұрын

    Está faltando um desses em português Paulo! 🚀 🔥 Parabéns pelo vídeo.

  • @andreistelian9058
    @andreistelian90582 ай бұрын

    Holy moly, it works. Thank you so much my friend. I did everything you said, exactly as you did and it works for a 3D game. I'm still stoked on how it works, but it's awesome anyway. Thank you so much my friend!!!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hi there, thank you for your comment! A few months ago I was working on a bot for Ragnarok Online, but I was having a hard time finding online content showing how to create a object detector and make the detection results available in Python. So, when I created my one, I decided to try making a video about it (this video), I didn't expect to have such a good reception. I'm very happy that it worked and was useful for you!

  • @andreistelian9058

    @andreistelian9058

    2 ай бұрын

    @@moisesdepaulodias7980 that was what I wanted to do. I started with template matching from OpenCV, but it didn't worked quite good and I started looking through using OpenCV for object detection but couldn't find something so easy as what it is in this video. The only issue that I encountered, is that the model is a bit delussional and makes detection of other objects, but I will train another model after I finish with implementing all the things for my bot. Thank you very much. Also, do you know any resources for learning OpenCV. I'm a programmer, but I haven't looked through a lot of resources, what do you recommend for starting up with OpenCV

  • @pizza88
    @pizza88Ай бұрын

    Thanks buddy, the only one video makes sense for dataset training

  • @diexdiag1098
    @diexdiag10987 ай бұрын

    Thanks for this tutorial and the video, it helped me a lot with open cv and with a lot of problems and things that I didn't understand, thanks again

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    7 ай бұрын

    Thank you so much for the feedback! I'm really glad the tutorial was helpful for you!

  • @gametechtutorial4670
    @gametechtutorial46704 ай бұрын

    This is so clear, i have search tutorial for object detection but didnt get the clear info or maybe im stupid so that i cant understand😅, but not for your tutorial, this is really clear for me, i can digest each of information/step, you really put big effort to make this tutorial man. Thanks alot bro. Subss.....🤜🤛

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Hey man, thank you so much for your comment!!! I wasn't expecting such good feedback, but I am truly happy that my video is helping you out!!!

  • @Ireitsarof
    @Ireitsarof9 ай бұрын

    amazing tutorial, keep bringing more for us

  • @dynodyno6970
    @dynodyno69704 ай бұрын

    Got my sub, thanks for this video my friend. It was truly amazing and very helpful for a noob like me. If your goal was to help people learn, then you should be proud, because this genuinely helped me a lot! Thanks again

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Thank you so much for your comment! It really means a lot to me!!!

  • @dynodyno6970

    @dynodyno6970

    4 ай бұрын

    @@moisesdepaulodias7980 You're welcome. I get a warning message in the last cell when I attempt to train my model, it reads: "Warning: in txt-labels class_id=-1 >= classes=1 in cfg-file. In txt-labels class_id should be [from 0 to 0] Should I Ignore this? Eventually when it is done training i'll be able to see if it worked or not anyways.

  • @user-mw1uf8tf7w
    @user-mw1uf8tf7w5 ай бұрын

    Thank you! This is gold!

  • @blind0ne144
    @blind0ne1442 ай бұрын

    Great tutorial! You are awesome. Please do more projects like this :)

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hey, thanks for your comment! I'm a little busy with my job right now, but I want to make more videos (mostly about other approaches without using machine learning, that use far less computer resources and in some cases they have the same result)

  • @RodrigoPrincipe
    @RodrigoPrincipe8 ай бұрын

    You chose my favorite game! 🤩

  • @NakedSageAstrology
    @NakedSageAstrology2 ай бұрын

    Amazing information, thank you.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hey, thank you so much for your comment!!

  • @pixelmz
    @pixelmz12 сағат бұрын

    Really clear explaination, obrigado!

  • @keplerfall
    @keplerfall4 ай бұрын

    Parça do céu, que video maravilhoso, mto bom msm, parabéns

  • @complationbonanza
    @complationbonanza4 ай бұрын

    amazing tutorial

  • @hycor
    @hycor3 ай бұрын

    You are the best bro

  • @LucasAlves-bs7pf
    @LucasAlves-bs7pf2 ай бұрын

    Ouro puro, irmão. Obrigado pelo conteúdo.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    opa, muito obrigado mesmo pelo comentário mano, de verdade!! Fico muito feliz em saber que vc gostou do vídeo!!

  • @pl9820
    @pl98202 ай бұрын

    i got results and im stoked!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hey!! I am happy to know that it worked for you!!!

  • @xCookiee
    @xCookiee2 ай бұрын

    Subscribed, amazing content. Would love to see further development for this stuff

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hey, thanks for your comment man!!

  • @huelerssey
    @huelerssey2 ай бұрын

    Cara, que tutorial perfeito! Parabéns irmão, espero que continue trazendo mais conteúdos do tipo!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Opa, muito obrigado pelo elogio mano!! De verdade mesmo!! Vou tentar trazer mais tutoriais como esse. Abraço!!

  • @MjRmHaCKEr
    @MjRmHaCKEr4 ай бұрын

    this is the best one for me

  • @NotDead10008
    @NotDead100084 ай бұрын

    Love this.

  • @user-ql7pw7ld1n
    @user-ql7pw7ld1n4 ай бұрын

    Very helpful thank u

  • @piattrocks
    @piattrocks5 күн бұрын

    Thank you for the tutorial. I managed to follow it successfully! Would there be a way to modify it to be able to read and return words or sequences of numbers from what is being identified as well, or is that beyond the scope of YOLO?

  • @MowiWowi
    @MowiWowiАй бұрын

    Nice😊

  • @rodrigoesquinelato9812
    @rodrigoesquinelato9812Ай бұрын

    Vídeo incrível demais! Sério, obrigado

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Muito obrigado pelo comentário Rodrigo!! De verdade!!!

  • @Naggok
    @Naggok5 ай бұрын

    thanks for the video

  • @oilbender
    @oilbender23 күн бұрын

    Quick question? Any particular reason for not using a newer version of yolo?

  • @diegoemmanuel1014
    @diegoemmanuel10145 ай бұрын

    Boa aula.

  • @GhostWareV1
    @GhostWareV1Ай бұрын

    Thank you sooo muchhhhh

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    You're welcome! :D

  • @kruding
    @krudingАй бұрын

    Didn't pass the first step , but liked and subbed. your guide seem promising for me. I got only black screen or sometime the first frame with jupyter window overlapse in it. hope I might make it pass the 1st step someday.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there. I had the opportunity to try to help one person with the same problem in a Discord call, and I believe that this is related to some anti-cheat of your game. Because in this Discord call, the code worked in some games, but in others it generated black screens (I also suspect that games within Steam may generate black screens as well). I suggest you try with other games to see if that is your case. For me, it worked with the games Terraria, Ragnarok Online, Diablo 2, and Fruit Ninja using the BlueStacks emulator. I am trully sorry I can't help any further, but I didn't encounter this problem while creating the tutorial.

  • @felipe-muniz
    @felipe-muniz3 ай бұрын

    Murilo bom 🙌🏻

  • @enryu6503
    @enryu65032 ай бұрын

    Cool tutorial. I wanted to ask, the images that is being captured on the generate dataset notebook only shows black pictures. I am using it on a browser game. Already tried using different browsers, but it still has the same output of only capturing black images. Is there a fix for this? Thank you :D

  • @adnanqadir291

    @adnanqadir291

    Ай бұрын

    same issue

  • @Ppalgang

    @Ppalgang

    Ай бұрын

    same issue, stardew valley, ark, delta force2, spotify... all of them gives black screen

  • @strangeshorts6584

    @strangeshorts6584

    Ай бұрын

    Same 😢

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there. I had the opportunity to try to help one person with the same problem in a Discord call, and I believe that this is related to some anti-cheat of your game. Because in this Discord call, the code worked in some games, but in others it generated black screens (I also suspect that games within Steam may generate black screens as well). I suggest you try with other games to see if that is your case. For me, it worked with the games Terraria, Ragnarok Online, Diablo 2, and Fruit Ninja using the BlueStacks emulator. I am trully sorry I can't help any further, but I didn't encounter this problem while creating the tutorial.

  • @srcuia
    @srcuia2 ай бұрын

    TUTORIAL MT BRABO MEU MANO. Estou a algum tempo tentando fazer um bot pra um rpg pra treinar visao computacional, comecei identificando objetos com pyautogui, e mexi um pouco com opencv mas sem mts resultados nesse ultimo. precisava de um modelo que identificasse varios objetos na tela e creio que este será um bom ponto de partida. muito obrigado.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Opa, muito obrigado pelo seu comentário man, de verdade!! Como falei em algum comentário anteriormente, eu tentei achar um conteúdo assim como nesse vídeo, mostrando a criação de ponta a ponta de um sistema de detecção de objetos disponibilizando as coordenadas em python, mas não achava nada, daí qnd fiz o meu tentei fazer esse vídeo, mas não esperava uma recpção tão boa! Fico muito feliz que vc tenha gostado man!!!

  • @claudiosbc
    @claudiosbcАй бұрын

    Please record a video demonstrating how to click on the identified monsters. Vlw

  • @user-qn7rc9ii7i
    @user-qn7rc9ii7i4 күн бұрын

    Duuude.... God bless openCV...

  • @niloxz3367
    @niloxz336724 күн бұрын

    I hope u can help me but he says something like NameError: name 'WindowCapture' is not defined but i wrote the name from the windows, i tried everything but it didnt work

  • @strangeshorts6584
    @strangeshorts6584Ай бұрын

    The width of detected windows is small how can I adjust that so I can view full area.

  • @ahmetemindx
    @ahmetemindx2 ай бұрын

    The game is a multiplayer FPS game. It doesn't find your window. Could the game developers have blocked it? What could be causing the problem? I changed the code a little, I can take a screenshot of the game when the screen is broadcast, but I think I either wrote the window of the game wrong or the game developers blocked it, I'm not sure.

  • @virno69420
    @virno694204 ай бұрын

    Could you make similar tutorial in C++? Maybe using DirectML library? In a lot of use cases python deployment for inference is just way too slow.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Hi there! Thank you for the suggestion! I will consider it for my next videos.

  • @your1302
    @your1302Ай бұрын

    thank you for your tutorial! i wanna ask what GPU are you using?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there! Thanks for your comment! I am using the integrated GPU of my laptop, it's a Radeon 520 I believe.

  • @Noelnnn
    @Noelnnn2 ай бұрын

    wow that was an amazing video! thank you:D I am a relatively new dev, so I wanted to ask: how can you capture a browser window?, having my problems, it will find the window, but the jpgs are only a small white line, it wont capture the whole browser window.. def subbed, really good stuff:)!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hi there! Thanks for your comment!! Sorry but I didnt understand your question, you need to detect only part of the browser window?

  • @Noelnnn

    @Noelnnn

    2 ай бұрын

    @@moisesdepaulodias7980 Hi! thanks for your reply:D. I already solved it. I had my problems finding the right window_title I think, but then it did work somehow! Finished the whole project, it was amazing, functions perfectly!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    @@Noelnnn Great!! I am happy to know that it worked!!!

  • @user-gb9ug9rb3h
    @user-gb9ug9rb3h3 ай бұрын

    Can I display a labelling box like an open cv screen inside the game screen or is there a way to send keyboard/mouse movement to the game inside the open cv screen

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hello! I dont know how to put the bounding box in the game screen. About the movement automation, that is possible to do! I created a new video where I show how you can automate actions based on the detections, you can see more details on the video: kzread.info/dash/bejne/mZh9uKqdgsXOf9Y.html

  • @mohammedbaig9569
    @mohammedbaig95695 ай бұрын

    Hi I did not get to run the full training because it was taking too long so I just downloaded the last weights file like you suggested. However when I attempt to run the detection cell of the detection code all that's returned is a black screen. Do you have any idea what could be causing it?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hi there, can you send me a message on linkedin with more information about the error? my linkedin profile is in the description, I will do my best to assist where I can.

  • @shenglinjing7350

    @shenglinjing7350

    Ай бұрын

    He is probably running the game in full screen mode, where the winapi is not able to capture since the data is stored internally. If you switch to windowed mode, it probably will work.

  • @user-bf3um8cd6k
    @user-bf3um8cd6kАй бұрын

    Спасибо!

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Пожалуйста!

  • @MetalComment
    @MetalComment4 ай бұрын

    How would you take your finished project and take the code in for your own visual studio code or pycharm for example?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Hi there, you can use the 'Jupyter' extension in VSCode to run notebooks. I used the Jupyter notebook web interface for simplicity.

  • @rulofmg
    @rulofmg2 ай бұрын

    Ragnarok Online !!! feels so nostalgic lmao. its the first game where I learn the botting world and programming.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    me too! I started using some simple detectors (using colors, and shapes) until I needed some more complex detectors for detecting multiple different monsters at the same time (I used diablo 2 in this video but I was actually using this bot in ragnarok!)

  • @wesleypaulo1660
    @wesleypaulo16609 ай бұрын

    Top mano

  • @CodingJournal-pm1tq
    @CodingJournal-pm1tq5 ай бұрын

    Hi, thank you for the amazing tutorial! I am having a problem when after running the box starts "# Run this cell to initiate detections using the trained model." I get the window opening, but it just shows the initial screenshot it has received and does not update, it then shows the same screenshot on subsequent runs.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hello. Did you make any changes to the code in the fourth notebook other than the window name? And did you copy the weights file correctly after training in the third notebook? Also, is there any error message on the output of the cell "# Run this cell to initiate detections using the trained model." ? Please send me a message on Discord so we can investigate together. My discord is moises_dias.

  • @CodingJournal-pm1tq

    @CodingJournal-pm1tq

    5 ай бұрын

    update: I just realized the same is happening for: 1_generate_dataset - Window Capture

  • @CodingJournal-pm1tq

    @CodingJournal-pm1tq

    5 ай бұрын

    Found the problem, for anyone with the same issue: The problem was running the game through steam

  • @fred-em5wx
    @fred-em5wx4 ай бұрын

    Fala mano tudo bem, cara eu vou tentar usar esse seu modelo para fazer um bot de auto-pesca em um jogo, basicamente quando aparecer uma exclamação na tela o bot tem que começar a clicar até pescar o peixe, depois ele bota a vara na agua novamente. A exclamação quase nunca muda, e só quero detectar ela mesma, com 100 imagens no dataset eu já conseguiria um resultado legal?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Opa, tudo bom? Cara, esse modelo serviria sim, mas como você só quer detectar um icone (ponto de exclamação) da pra voce usar formas bem mais simples (usar o Template Matching do OpenCV) e que seriam efetivas e usando muito menos processamento. Da uma olhada nessa playlist, sugiro vc tentar essa abordagem dela, acho que vai super resolver para você: kzread.info/dash/bejne/fZmXr86FhdjPdZc.html e se precisar de alguma ajuda só chamar man, valeu!!

  • @rodrigooliveira8954
    @rodrigooliveira8954Ай бұрын

    Vc é brasileiro né? Obrigado pelo conteúdo kkkkk

  • @MsMineization
    @MsMineization2 ай бұрын

    MT BOM IRMÃO VALEU

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    opa tmj irmão! obrigado pelo comentário!!

  • @TTA-of7yz
    @TTA-of7yz2 ай бұрын

    Hi, I tried your tutorial, but for some reason, when I did the first step, I captured the image of a game in bluestacks. All images came in black, or just the first frame picture. I tried to test the image capture in other applications, even on a notepad, and got the same result. Try to change Windows 11 and 10. Try changing the resolution and nothing. im new on this help plis :) btw, good tutorial, I fellow through the whole process.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hi there, I recently helped another person with the same problem, in his case the problem was the game he was trying to detect objects, but in your case you said you were using bluestacks, so I dont know what is the problem.. can you call me on discord for us to search together? my user is moises-dias

  • @niloxz3367

    @niloxz3367

    24 күн бұрын

    @@moisesdepaulodias7980 ur discord name is not right

  • @yatomi1012
    @yatomi10123 ай бұрын

    Hey! Thank you for this video, it works almost perfectly for me. I just have one issue displaying the window with the detection. The window has the good dimensions (1920×1080), however it displays only a zoomed part of my game (the top left corner, only about 2/3 of the actual game), how can i change it? PS1: the game is not in fullscreen the window is just maximized. I have tried to reduce the size of the game window, and it displays the whole game below a certain size. PS2: i printed the width and height and got 1535*784, which is not the size of the window, and it seems that 1535 784 is the dimension of what is displayed (and zoomed)

  • @yatomi1012

    @yatomi1012

    3 ай бұрын

    found out: my pc had a 125% zoom

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    @@yatomi1012 Hi There! Sorry for the long time to answer, but I am happy that you solved the problem!!

  • @funktionone821
    @funktionone8213 ай бұрын

    I managed to set up everything, however, when I run it on my game the window that opens to display the detections is a still image, I can see the bounding boxes around the objects I trianed my Model for. If I rerun it shows the same image. Note that I run into an error due to this line img = np.fromstring(signedIntsArray, dtype='uint8') The Notebook error message suggested to change it to 'np.frombuffer' so I changed it and is not giving error now, but not working the same way like in yours, The displaying window is still image cant not interact and go around in game like you in that Window.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi there! Hmm, I haven't encountered this problem, but could you call me on Discord so we can try to fix it? My username is moises_dias. I'll do my best to help you.

  • @funktionone821

    @funktionone821

    3 ай бұрын

    @@moisesdepaulodias7980 thank you I will add you on Discord, and contact you.I have the same profile image on Discord

  • @funktionone821

    @funktionone821

    3 ай бұрын

    @@moisesdepaulodias7980 I sent youa friend request on Discord, I have the same profile picture like here. thank you in advance

  • @yamayomi7779
    @yamayomi77798 ай бұрын

    Thank you very much how can I apply this tutorial on local environment and how to use CPU I get GPU limitation and it requires payment

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    8 ай бұрын

    Hi there, thanks for your comment! Only step 3 (Model Training) is performed in Colab, all the other steps are using a local environment. I would not recommend using CPU for training your model for two reasons: first, it will use almost 100% of your CPU while your model is training, and second, it will take far more time than using a GPU. If you are facing GPU limitations, I would suggest that you create a new Google account and access Colab using this new account. This way, you will have a new GPU usage quota. Can you try that and see if it solves your problem?

  • @yamayomi7779

    @yamayomi7779

    8 ай бұрын

    @@moisesdepaulodias7980 Hello, again :) well I managed to pass the model training step, but I got stumbled across the following error while running the detector --------------------------------------------------------------------------- error Traceback (most recent call last) Cell In[20], line 8 5 weights_file_name = "yolov4-tiny-custom_last.weights" 7 wincap = WindowCapture(window_name) ----> 8 improc = ImageProcessor(wincap.get_window_size(), cfg_file_name, weights_file_name) 10 while(True): 12 ss = wincap.get_screenshot() Cell In[19], line 11, in ImageProcessor.__init__(self, img_size, cfg_file, weights_file) 9 def __init__(self, img_size, cfg_file, weights_file): 10 np.random.seed(42) ---> 11 self.net = cv.dnn.readNetFromDarknet(cfg_file, weights_file) 12 self.net.setPreferableBackend(cv.dnn.DNN_BACKEND_OPENCV) 13 self.ln = self.net.getLayerNames() error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:217: error: (-212:Parsing error) Failed to parse NetParameter file: yolov4-tiny-custom_last.weights in function 'cv::dnn::dnn4_v20230620::readNetFromDarknet' Thanks for caring

  • @alvinwee268
    @alvinwee2683 ай бұрын

    Hi, there are some false positives with my trained model. Maybe because I only used 80+ images. To make any amendments, do i have to train it all over again?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi there, well, I think so, depending on the graphics you need far more than 80 images.

  • @alvinwee268

    @alvinwee268

    3 ай бұрын

    @@moisesdepaulodias7980 ok will give it a shot, thanks!

  • @VitinDeltakk
    @VitinDeltakk4 ай бұрын

    valeu cara

  • @chucknorrisfactfr
    @chucknorrisfactfr2 ай бұрын

    hello when i try i get error: CreateCompatibleDC failed at the very first step, the one that screenshot your computer screen can you help me boss

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    hi there, can you send me a screenshot of the error in discord? my user is moises-dias, I will try to help you there

  • @johnyfishborn
    @johnyfishborn6 ай бұрын

    It's amazing tut. But can we draw on our screen? Not in the new window. Cause cv2.imshow drops our FPS to the bottom.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    6 ай бұрын

    Hi there, thanks for your reply! You can only draw the detections on the OpenCV window. But if it's affecting the FPS you can stop showing the OpenCV window by removing the line "self.draw_identified_objects(img, coordinates)". This window is useful only to check if your model is well trained, as you already will have a python dictionary with the coordinates to automate your character.

  • @Jojifans
    @Jojifans3 ай бұрын

    can you make a video showing how to utilize yolov7 or newer?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi there! Right now I am working on a playlist of machine learning on Google Cloud, but in the future I will make a video with a newer version of yolo, thanks for the suggestion!!

  • @efocus08
    @efocus083 ай бұрын

    please help i keep getting coomand error in 'pip' is not recognised as an internal or external. we=hen trying to install the libraries

  • @user-ed4yp6eq5k

    @user-ed4yp6eq5k

    3 ай бұрын

    My new pc did the same thing Download Python i used 3.10.5 make sure you click add to path during the installation

  • @rco413
    @rco4133 ай бұрын

    so how do you avoid being detected, the character will immediately be hit and use an automatic skill?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi there! Sorry, I didn't understand your question.

  • @rco413

    @rco413

    3 ай бұрын

    @@moisesdepaulodias7980 i mean, bot auto attack

  • @brazorya
    @brazorya5 ай бұрын

    Can you make a fully bot for Diablo 2 and the Hammer Paladin buid ? 😆 Or a maybe a game turn by turn like Waven build with Unity

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hi there! I created a continuation for this tutorial where I use pynput to automate actions in the game Fruit Ninja. With the same approach I used in these videos, I believe you can create a bot for these two games! Here's the link to the second video: kzread.info/dash/bejne/mZh9uKqdgsXOf9Y.html If you have any questions you can contact me and I will do my best to assist where I can.

  • @rofus-_-1101
    @rofus-_-11013 ай бұрын

    is it possible to use a .pt file instead of an weight?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi There! Unfortunately, I didn't tested with a .pt file.

  • @InMyLifeOfficiel
    @InMyLifeOfficiel20 сағат бұрын

    I'm encountering a problem at the outset: when attempting to generate a dataset of images from my game, all I'm getting are black screen pictures. I suspect Steam might be causing this issue by blocking certain functions. As a workaround, I tried running the game through Steamless, but unfortunately, I'm still facing the same problem of black screen images.

  • @InMyLifeOfficiel

    @InMyLifeOfficiel

    19 сағат бұрын

    I updated your code and now its working

  • @InMyLifeOfficiel

    @InMyLifeOfficiel

    19 сағат бұрын

    fuck, the window capture at the last step not working :(

  • @ccuuttww
    @ccuuttwwАй бұрын

    In 3D MMORPG games I think is more complicated especially non moving object

  • @Hcma_
    @Hcma_5 ай бұрын

    Capture with win32gui doesn't work on all games such as League of Legends, any ideas to fix the problem?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hello! Some games have software to prevent the use of external programs that interfere with the game (anti-cheats). In the game Ragnarok Online, I couldn't use Pynput, so I had to connect an Arduino to control the mouse and keyboard. I haven't tested it in League of Legends, but in your case, I would suggest you look for another way to capture images that the game doesn't block (using OpenCV instead of win32gui, maybe).

  • @brazorya

    @brazorya

    5 ай бұрын

    @@moisesdepaulodias7980 can you make an example on a game like Waven on steam ? ta show us the game window gestion 😁 you try all my favorite game continue ! 🤟

  • @Hcma_

    @Hcma_

    5 ай бұрын

    @@moisesdepaulodias7980 Thank you for your reply. While doing some research, I found a workaround that involves using the following line for the blackscreen debug "windll.user32.PrintWindow(self.hwnd, cDC.GetSafeHdc(), 3)" instead of "cDC.BitBlt((0, 0), (self.w, self.h), dcObj, (self.cropped_x, self.cropped_y), win32con.SRCCOPY)" in your code.

  • @indieworld462

    @indieworld462

    2 ай бұрын

    Use pygetwindow instead of win32gui

  • @bharanis4109
    @bharanis41095 ай бұрын

    Please upload video about how to make bot in nexus war game. Bot task is gather resources automatically. Thanks in advance

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hi there, for tasks such as collecting resources (assuming that the sprite or the image of the resources does not change), normally using template matching with OpenCV is a good enough approach. It's also less CPU-intensive than a real-time deep learning model. You can see more in this playlist: kzread.info/dash/bejne/fZmXr86FhdjPdZc.html

  • @pedroamaral8583
    @pedroamaral8583Ай бұрын

    the first code only gets black screenshots any ideas?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there. I had the opportunity to try to help one person with the same problem in a Discord call, and I believe that this is related to some anti-cheat of your game. Because in this Discord call, the code worked in some games, but in others it generated black screens (I also suspect that games within Steam may generate black screens as well). I suggest you try with other games to see if that is your case. For me, it worked with the games Terraria, Ragnarok Online, Diablo 2, and Fruit Ninja using the BlueStacks emulator. I am trully sorry I can't help any further, but I didn't encounter this problem while creating the tutorial.

  • @strangeshorts6584
    @strangeshorts6584Ай бұрын

    Hlo sir the images generated in the image folder are full black why .😢 Title bar pixels and border pixels values are correct.how can i fix it.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there. I had the opportunity to try to help one person with the same problem in a Discord call, and I believe that this is related to some anti-cheat of your game. Because in this Discord call, the code worked in some games, but in others it generated black screens (I also suspect that games within Steam may generate black screens as well). I suggest you try with other games to see if that is your case. For me, it worked with the games Terraria, Ragnarok Online, Diablo 2, and Fruit Ninja using the BlueStacks emulator. I am trully sorry I can't help any further, but I didn't encounter this problem while creating the tutorial.

  • @strangeshorts6584

    @strangeshorts6584

    Ай бұрын

    Thanks for your reply I also tried BlueStacks but faced the same problem in my windows 11

  • @KabLah
    @KabLahАй бұрын

    Why use an old version of yolo instead of v8 or so?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there, I only used YOLOv4 because I had experience with it in college 😅

  • @rodrigoesquinelato9812
    @rodrigoesquinelato9812Ай бұрын

    Salve Moises! No meu colab roda tudo menos a parte final. A pasta training fica vazia =/

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    opa, no colab aparece algum erro ao executar o comando !./darknet detector train ... ? e no final do segundo notebook (rotulando imagens), vc gerou a pasta yolov4-tiny e colocou na raiz do seu google drive?

  • @LOGFILEGDmegusta
    @LOGFILEGDmegustaАй бұрын

    is it possible make it using javascript / node?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Well, if there's a way to use a machine learning model using JS/Node, I believe it's possible. But I don't have experience with that language. I suggest you look into how to perform the actions I do using Python (like identifying a window, taking a screenshot of the window, using a YOLO model, etc.) but with Node.

  • @Dz6k
    @Dz6k3 ай бұрын

    ola moises, otimo video, ainda vou ver com mais atencao pois estou implementando reconhecimento de imagem em um script que estou criando para um game tbm, mir4, queria saber se tu sabe como enviar inputs de clicks para uma janela, to tentando e colocando tudo correto porem nao acho muita explicacao para este caso especifico. To usando win32api para se comunicar e enviar inputs com a janela

  • @Dz6k

    @Dz6k

    3 ай бұрын

    resumindo: preciso enviar clicks de mouse em coordenadas relativa a janela alvo e que nao "prenda" meu mouse e que rode em background..... meu objetivo é conseguir isso, ate o momento sei como fazer mas nao sei como fazer dar certo kkk

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    opa, fala man, primeiramente, valeu pelo elogio!! e cara, quanto a enviar inputs a partir das detecções, fiz esse segundo vídeo, uma continuação desse primeiro, da uma olhada lá que tem o que você precisa!! kzread.info/dash/bejne/mZh9uKqdgsXOf9Y.html

  • @Dz6k

    @Dz6k

    3 ай бұрын

    @@moisesdepaulodias7980 vi esse vídeo e a função que eu quero é exatamente dessa maneira porem que eu tenha o mouse "livre" para poder, além de rodar em threads, rodar em segundo plano sem comprometer o uso do mouse em demais ações, no jogo mir4 é estranho, ele recebe input de click porem não na coordenada que pedi e se o jogo não estiver focado o click fica muito superficial, só alguns botões dao realmente ativados....não sei explicar mt bem kk

  • @SigpoPopi-wn3ss
    @SigpoPopi-wn3ss3 ай бұрын

    How to make the bot automatically walk towards that item?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hello! I created another video where I show how to automate actions based on detections, one of the actions can be clicking on the screen to walk toward a detected item, you can see that in more detail in the video: kzread.info/dash/bejne/mZh9uKqdgsXOf9Y.html

  • @RicardoLestayo
    @RicardoLestayo5 ай бұрын

    Ele reconhece mas da pra fazer com que ataque ou clique nesse objeto?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    fala Ricardo, da sim! eu fiz um outro vídeo falando exatamente sobre isso: automatizar ações a partir das detecções, você pode ver nesse link: kzread.info/dash/bejne/mZh9uKqdgsXOf9Y.html

  • @RicardoLestayo

    @RicardoLestayo

    5 ай бұрын

    @@moisesdepaulodias7980 Sensacional! obrigado Moises! você faz bots para jogos por encomenda?

  • @dominicmora2559
    @dominicmora2559Ай бұрын

    On training part the number 7 says no such file or directory

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there! Did you add the "yolov4-tiny" folder (created on the file 2_label_dataset.ipynb) to the root directory of your Google Drive?

  • @dominicmora2559

    @dominicmora2559

    Ай бұрын

    @@moisesdepaulodias7980 i put yolo 3 in colab then yolo4 in google drive and says no such file, i tried a lot is the same

  • @cheekos9478
    @cheekos94783 ай бұрын

    its not detecting the window that is running

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi there! Can you call me on discord? my user is moises_dias, I can try to help you there

  • @kristopherleslie8343
    @kristopherleslie83432 ай бұрын

    why not an outline trace in modern colors? boxes is an old addage.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Hi there, for my goal (detecting the center of the monsters) using bounding boxes was enough. But for more complex applications (like detecting the head of a player in the game counter strike) I believe that an outline trace would be better

  • @kristopherleslie8343

    @kristopherleslie8343

    2 ай бұрын

    @@moisesdepaulodias7980 makes sense buddy

  • @kristopherleslie8343

    @kristopherleslie8343

    2 ай бұрын

    A good reference would be the old Halo game ODDT. One of the best I’ve ever seen.

  • @dsbo1507
    @dsbo15072 ай бұрын

    Quanto vc cobra para fazer um bot para matar Isillas no Ragnarok? Estou tentando aprender a programar, mas acho que não é possível para mim. Se entre em contato comigo, por favor.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Opa, cara, sendo franco, acho que em sites de programadores freelancers vc pode encontrar gente oferecendo esse serviço, eu até poderia vender um bot pra vc mas eu estou com tempo bem limitado, começei um trabalho novo recentemente que ta tomando 101% do meu tempo :(

  • @dsbo1507

    @dsbo1507

    2 ай бұрын

    @@moisesdepaulodias7980 Eu meio que consegui rodar em servidor que tem Gepard Shield 3.0. Porém, ele começa matando normal, mas depois de alguns teleportes ele clicka no monstro e não acontece nada. Eu acho que é por causa do shield. Se vc souber alguém que faça, algum programa bem simples. Por favor, me avisa.

  • @Yve-ro8lf
    @Yve-ro8lf2 ай бұрын

    do tutorial on any website object detector please?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there! I believe that this tutorial can also be used to detect objects in a browser window too!

  • @RoarStaze
    @RoarStazeАй бұрын

    Is yolov4 faster than yolov5?

  • @user-sd6lk2ir5n

    @user-sd6lk2ir5n

    19 күн бұрын

    Yolov4 it's too old, better use yolo V8 from ultralytics they has his oficial Google colab file, it's super Easy to use.

  • @dynodyno6970
    @dynodyno69704 ай бұрын

    What about "seeing" the entire environment, not just obhjects?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Hi there! Short answer: you need to show all the background so your model will know what he should NOT detect. Long answer: Let's say you have two environments: a forest and a cave, and you want to detect birds in both environments. In the forest, aside from the birds, there are trees and flowers, while in the cave, apart from the birds, there are stones and torches. If you use only pictures of one environment (e.g., the forest) by not labeling the trees and flowers, you are implicitly telling that "the trees and flowers are not birds." However, since you didn't provide your model with pictures of the cave, how can the model know if a stone or a torch is not a bird? The model has never saw these elements and doesn't know if they are or are not birds. This is why it's necessary to show not only what you want to detect but also all the possible backgrounds, so your model knows what it should detect and what it should NOT detect.

  • @user-ed4yp6eq5k
    @user-ed4yp6eq5k3 ай бұрын

    Mine is showing the Jupyter browser page instead of the game 😢

  • @villocity5794

    @villocity5794

    2 ай бұрын

    Same let me know if you find a fix for this

  • @user-ed4yp6eq5k

    @user-ed4yp6eq5k

    2 ай бұрын

    @villocity5794 the game doesn't allow window capturing i had to stream it from steam to a different pc. Or you can use a video capture. Or try OBS

  • @mankopooh67778
    @mankopooh677783 ай бұрын

    you can make macro?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hi there! Yes, you can create macros using python after detecting an object in a specific location. You can check more details in this video: kzread.info/dash/bejne/mZh9uKqdgsXOf9Y.html

  • @mankopooh67778

    @mankopooh67778

    3 ай бұрын

    @@moisesdepaulodias7980 can you make for me ?

  • @walessongabriel6484
    @walessongabriel64842 ай бұрын

    não entendo muito de ingles mas tenho interesse enorme em aprender a fazer essas coisas se possivel faz um video em pt br vlw agradeço desde ja tmj

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Opa, fala man, cara, acabei fazendo em ingles por que to tentando treinar meu ingles hahahaha, mas quando eu tiver um tempinho livre eu vou adicionar legendas em pt-br então, beleza? Abraço!!!

  • @walessongabriel6484

    @walessongabriel6484

    2 ай бұрын

    @@moisesdepaulodias7980 vlw mano e seu ingles ta top man tmj

  • @MrDouglax
    @MrDouglax3 күн бұрын

    Teu ingles é bom, mas quando ouvi sabia q era br, olhei teu nome e tive certeza kkkkk

  • @157decocaina

    @157decocaina

    2 күн бұрын

    kkkkkkkkkkkkkkkkkkkkkkk

  • @Helviio
    @Helviio4 ай бұрын

    meu amigo ... faz um em ptbr

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    hahahaha valeu pelo comentário man, faço em inglês pra melhorar o meu ingles mesmo

  • @Rhuts
    @Rhuts3 ай бұрын

    help pls Cell In[22], line 5 1 # Execute this cell to generate a dataset of images for the specified window. 3 window_name = "BlueStacks App Player" ----> 5 wincap = WindowCapture(window_name) 6 wincap.generate_image_dataset() NameError: name 'WindowCapture' is not defined

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hello! I belive the problem is that the cell with the WindowCapture was not run. The cell start with "class WindowCapture:". can you try running it and see if it solves the problem?

  • @Rhuts

    @Rhuts

    3 ай бұрын

    @@moisesdepaulodias7980 thank you!!

  • @user-ed4yp6eq5k

    @user-ed4yp6eq5k

    3 ай бұрын

    Same issue

  • @walessongabriel6484
    @walessongabriel64842 ай бұрын

    vcé br ne ?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    opa sim haha

  • @dominicmora2559
    @dominicmora2559Ай бұрын

    It didn’t work

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    Hi there, can you tell me more details of the error you got?

  • @beknight9877
    @beknight98772 ай бұрын

    only need a RTX 4090 OC 😂🤣

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    2 ай бұрын

    Oh boy, if only I had one! I would run three of these detectors at the same time!

  • @xorkatoss
    @xorkatossАй бұрын

    naaaaaahh broo this looks like too much work lol

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    Ай бұрын

    It is hahaha but it's worth it!

  • @nekomi8412
    @nekomi84125 ай бұрын

    Hello when i'm doing the command jupyter notebook . it said 'jupyter' is not recognized as an internal or external command, operable program or batch file. can it be like that because i'm on widows 11 i try to contact you on linkedin

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    5 ай бұрын

    Hello! If you've executed "pip install -r requirements.txt" without any errors, I imagine the issue might be that the Jupyter executable's path is not included in the system's PATH variable. You can copy this exact error text and search it on Google, and you'll find how to resolve this problem. If the issue persists, please let me know in the comments or send me a message.

  • @nekomi8412

    @nekomi8412

    5 ай бұрын

    @@moisesdepaulodias7980 i found the issue ! thanks for help i was have like two python the one i installed with web site and the one with the widows store soo i deleted both and just take the one on web site i was forgeting to make the path variable directly at the installation of python (case that you need to cross)

  • @atomadeus
    @atomadeus3 ай бұрын

    How did you manage to pass key and mouse messages to the underlying window when clicking on the top-level window generated by OpenCV?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    Hello! In this video, I was clicking on the game window that was on another screen, but I only recorded the window generated by OpenCV. I'm sorry if I gave you that impression, but I didn't perform the action of clicking on the OpenCV window and passing the commands to the game window.

  • @atomadeus

    @atomadeus

    3 ай бұрын

    @@moisesdepaulodias7980 So, how do I implement this, can you give me some instructions? Thanks.

  • @ygg278
    @ygg2784 ай бұрын

    in 17:48 after it's done I checked the training folder and it doesn't show anything else than placeholder.txt. Also when i pressed "!./darknet detector train data/obj.data cfg/yolov4-tiny-custom.cfg yolov4-tiny.conv.29 -dont_show" It ran for 2 seconds and stoppe. I also saw when running it has a different output from what I can see in the video, maybe because I have a small amount of data?

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    Hi there. Probably the folder doesn't have anything else because because the training command didn't work. Please, check if you changed your runtime to use a GPU (I did that at 15:28). Also, compare the outputs of all the commands to my execution in the video. Do you notice any differences in the output, or is it just the last one that's different?

  • @ygg278

    @ygg278

    4 ай бұрын

    @@moisesdepaulodias7980 I compared all the outputs of the earlier commands before the final one and all has exactly the same output in the video. I changed the runtime just like in the video. The last one only has the different output from the video. It doesn't show any of the v3 lines shown in the video. I can show the output in discord.

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    4 ай бұрын

    ​@@ygg278 Hmm.. I just ran it here and I am not getting any error. How many images are you using? Also, are you sure that you uploaded the images AND the text files with the coordinates? (you can check the command before the "!python proccess.py" if the output contains one .txt after every .jpg Please call me on discord, my user is moises_dias, I will try my best to help you

  • @ygg278

    @ygg278

    4 ай бұрын

    @@moisesdepaulodias7980 I used 771 png images. i uploaded both images and text files with the coordinates.

  • @ygg278

    @ygg278

    4 ай бұрын

    @@moisesdepaulodias7980 I don't know why I can't see my reply but I'll just say it again, I used 771 png images. I added you already, daleggy.

  • @maffeisDIVER
    @maffeisDIVER3 ай бұрын

    excelente video irmao! poderia me passar teu contato pra tirar uma duvida apenas??

  • @moisesdepaulodias7980

    @moisesdepaulodias7980

    3 ай бұрын

    opa, obrigado pelo elogio! pode me chamar no discord: moises_dias

Келесі