Yolov7 Custom Object Detection in Python Tutorial - Chess Piece Detection

  Рет қаралды 52,878

Rob Mulla

Rob Mulla

Күн бұрын

In this video we use python and object detection packages yolov7 and yolov5 to do custom object detection for chess board pieces. We walk through: How to create a custom object detection dataset, how to train the model, metrics you need to know for object detection, and show how to run predictions on a webcam.
Check out my other videos on yolov5 and object detection: • Object Detection in 10...
Timeline:
00:00 What is YOLO
01:25 Setup
02:54 YoloV5 vs YoloV7 Detection
6:22 Training on Custom Dataset
11:48 Object Detection Metrics
15:50 Detecting using Custom Model
Follow me on twitch for live coding streams: / medallionstallion_
My other videos:
Speed Up Your Pandas Code: • Make Your Pandas Code ...
Speed up Pandas Code: • Make Your Pandas Code ...
Intro to Pandas video: • A Gentle Introduction ...
Exploratory Data Analysis Video: • Exploratory Data Analy...
Working with Audio data in Python: • Audio Data Processing ...
Efficient Pandas Dataframes: • Speed Up Your Pandas D...
* KZfaq: youtube.com/@robmulla?sub_con...
* Discord: / discord
* Twitch: / medallionstallion_
* Twitter: / rob_mulla
* Kaggle: www.kaggle.com/robikscube
#yolov5 #yolov7 #python #machinelearning

Пікірлер: 84
@kosmonautofficial296
@kosmonautofficial296 Жыл бұрын
Great video! Thanks I was able to follow along and get the chess board detection working.
@igorkuivjogifernandes3012
@igorkuivjogifernandes3012 11 ай бұрын
That was an amazing video! Keep going, Rob!
@tushartiwari7929
@tushartiwari7929 Жыл бұрын
Thanks for showing this, It was very informative and caught my attention as well. 😅
@jti107
@jti107 Жыл бұрын
nice video! i'm really enjoying these computer vision videos...since i'm not familiar with this field. two quick questions i'm hoping you can address in future videos 1. skills/tools needed to be successful in data science (i.e. calculus, probability, pandas, etc.) in a tier list 2. the best ways to communicate the results of your findings and how to structure the content (slides, blog post, etc.)
@robmulla
@robmulla Жыл бұрын
Glad you liked it! Great ideas for future videos. Regarding #1 have you seen my video on getting started with machine learning? kzfaq.info/get/bejne/f9yWp7uW1NmmioU.html
@jti107
@jti107 Жыл бұрын
@@robmulla oh awesome! i hadnt watched that video, I will check it out. Thanks!
@molmock
@molmock Жыл бұрын
Cristal clear thank you 👍
@rafael.gildin
@rafael.gildin Жыл бұрын
Thank u for this amazing video 🎉
@robmulla
@robmulla Жыл бұрын
Thanks for the feedback. Glad you found it helpful!
@mrmaniac9905
@mrmaniac9905 Жыл бұрын
Getting the data is quite simple. Generate a 3d scene, render a camera from different angles, do a world to screen matrix calculation for each piece, creating bounding boxes from the cameras perspective; randomize, save, and repeat. I have around 3000 label images of chess positions from all kinds of different angles and with different lighting. It works nearly flawlessly.
@saintadel8902
@saintadel8902 10 ай бұрын
Genius advice!
@ar2050
@ar2050 10 ай бұрын
Did you shared your dataset somewhere? And the training weights? It would be great if you could share. 😊
@pedrinhosari
@pedrinhosari Жыл бұрын
what an amazing video, I found this content by chance (I'm not in programming), but I'm trying to marathon and learn about it. Because I work with audiovisual, and I think about how to use this to make a realtime tracking. Like we see in soccer games, racing games, etc, where signs and icons appear following the objects and people. On TV this is all done with several expensive sensors that capture the position of each item, but if somehow I could get those position coordinates of the objects detected with YOLO, it would already be possible to get an extremely close result but in an absurdly cheaper and homemade way. Including, many editing and compositing programs have fields for python programming, allowing the creation of extensions and plug-ins. I am sure this would be absurd inside any of these programs, if you want to talk to me so we can think of practical applications, I am sure it could bring a good financial return.
@robmulla
@robmulla Жыл бұрын
Love this comment. So cool that you found it helpful and are getting started in coding. Check out the Kaggle competition that recently where they used computer vision on soccer video. I covered it in one of my live streams. Not sure about the ideas. Join my discord and ask there.
@keshawnsmith320
@keshawnsmith320 Жыл бұрын
Hey Rob, I love your videos and the overall content that you share. I am a new subscriber and have one question for you. I see that you use a Mac device for your videos? Especially for this video where you are running Yolov7 which runs faster on a GPU why did you decide to use a Mac device over a windows device that has a dedicated GPU?
@robmulla
@robmulla Жыл бұрын
Hey Keshawn! Glad you have you as a new subscriber. I'm actually not using a Mac, my main operating system is Linux (Ubuntu). I go into detail about it in this video. You should check it out: kzfaq.info/get/bejne/isqSmNyeucm9iXk.html&lc=UgwHA_11TkbNahYIJE14AaABAg
@dennispinheiro7966
@dennispinheiro7966 6 ай бұрын
Hi Rob! Amazing stuff. Could you please tell me about a video or source using python that allows body or object detection and returns an alert? Like detect a person who was walking and fell down on the ground. Thank you!
@khenpahilanga9596
@khenpahilanga9596 Жыл бұрын
Hello I found the video really helpful, but i would like to ask how I can do transfer learning or the command used to do so on yolov7, im new to this stuff and I need help adding more dataset to my pre-trained custom weight, I would highly appreciate your assistance thanks!
@sardorabdirayimov
@sardorabdirayimov Жыл бұрын
Awesome 🙌🙌
@robmulla
@robmulla Жыл бұрын
Thank you! Cheers!
@Inspiration_video23
@Inspiration_video23 Жыл бұрын
Very nice. I want to know your working window is jeston nano or laptop window . On which jetson nano / laptop you r working
@robmulla
@robmulla Жыл бұрын
It’s my home made PC no jetson nano. Thanks for watching.
@Athens1992
@Athens1992 Жыл бұрын
amazing, can u train the yolo with the first layers frozen and the latest unfrozen to be more faster for training.
@robmulla
@robmulla Жыл бұрын
If it’s pre-trained weights then training should be relatively quick. You can freeze layers in PyTorch but not sure how to specifically in yolo.
@BangRael99
@BangRael99 2 ай бұрын
after you can do detection object,is it also can sent notification from email? if there is part of chess is missing?
@abhinaveluri3739
@abhinaveluri3739 Жыл бұрын
thanks for the info...I have a small query..how can I get the predicted labels and bounding box information in yolov7 after detection of objects in image
@robmulla
@robmulla Жыл бұрын
Yes. You can have it output to a text file with one of the parameters.
@afifshowkathali9214
@afifshowkathali9214 Жыл бұрын
Hi, first of all thank you for this video, was really helpful. And is it possible to save the data received from the detection as csv file or txt file. I tried the --save-text command but it doesn't specify the type of object detected like "person" or "car" etc. Is there a way to get this info too in the txt file?
@robmulla
@robmulla Жыл бұрын
Hey Afif. That is possible. The save-txt will use the classification ids setup in the dataset config file. So you just need to map those ids to their labels. Hope that helps.
@afifshowkathali9214
@afifshowkathali9214 Жыл бұрын
@@robmulla Okk, will try that. Thank you so much.
@freashyt9451
@freashyt9451 Жыл бұрын
In The setup i had struggels with soft soft and now i can make soft and for my birthday i askd for so Nice speakers and Lets make
@robmulla
@robmulla Жыл бұрын
Are you a real person? This comment is confusing to me.
@thatguycalledjesse
@thatguycalledjesse Жыл бұрын
Are you having a stroke?
@dinanmutamaddin400
@dinanmutamaddin400 Жыл бұрын
how if i want to change thickness bonding box and size of font when predict object
@turaabali1410
@turaabali1410 6 ай бұрын
Hi how can we merge the custom model with yolo5 and use as a part of it?
@YoungMoneyInvestments
@YoungMoneyInvestments 8 ай бұрын
Does everything have to be run with Cuda or is there any other way to do things via the Apple silicon? My new MBP has a 32 core neural engine I believe (don’t quote me on the number). Is it possible to run a model like Yolov7 using the Mac GPU’s?
@robmulla
@robmulla 8 ай бұрын
You can run it on CPU but it just will be a lot slower.
@YoungMoneyInvestments
@YoungMoneyInvestments 8 ай бұрын
@@robmulla How would you go about running it on Apple silicon? Would I have to convert YOLOv7 to Core ML and go from there? Have you tried this on newer Macs? It might also be an interesting video. Thanks for the response.
@idk-qb5gm
@idk-qb5gm 7 ай бұрын
how can i stop the training like you said if theres not much improvement, i know ctrl+c stops it but does it save the trained model ?
@therockriders2759
@therockriders2759 3 ай бұрын
early stopping might help
@nezerbtc6936
@nezerbtc6936 Жыл бұрын
my question is how do you analyse and trained the dataset on YoloV7
@robmulla
@robmulla Жыл бұрын
Yolov7 and yolov5 have almost identical interfaces, so you would follow the same steps with the yolov7 repo. I was able to do both but only showed v5 in the video because it looked better.
@DIGIL.
@DIGIL. Жыл бұрын
Is it possible to detect chart patterns of a stock price using Yolo?
@robmulla
@robmulla Жыл бұрын
That’s not really what it’s designed to do. More general object detection typically. But you could try!
@hwasti
@hwasti 11 ай бұрын
Any of U were able to train on MPS?
@onewhoflutters4866
@onewhoflutters4866 Жыл бұрын
In python detect.py section, I don't have best.pt under weight folder. python detect.py --source data/images/myimage.jpg(it doesn't make customized predictions when I run this command) Do we need to make changes to detect.py file? I couldn't execute the last part. It didn't occur train_batch0.jpg files.
@robmulla
@robmulla Жыл бұрын
If you trained correctly you should have model weights saved in the train folder. Usually there is a best.pt and last.pt - either should work. You shouldn't need to modify the scripts to detect so long as the model weights are linked correctly.
@onewhoflutters4866
@onewhoflutters4866 Жыл бұрын
@@robmulla OK I did it, it working . Thank you very much for all the replies. Can you make a video to run it in real time on android? (with Tensorflow Lite) Thanks a lot :)))) !!!!
@onewhoflutters4866
@onewhoflutters4866 Жыл бұрын
I also need to calculate the total price of the products estimated for the application. Is there an algorithm I should use ?
@robmulla
@robmulla Жыл бұрын
@@onewhoflutters4866 good questions. I’ve never done something like that before. But it might be a fun video for future applications. The cost is definitely going to be dependent on the model size and hardware. Good luck!
@onewhoflutters4866
@onewhoflutters4866 Жыл бұрын
@@robmulla Hello again, I will question a new question. How will we update the model when new data (ex: new images) is added to the yolov5 model trained ? Thanks a lot!!!! :)
@madhura305
@madhura305 Жыл бұрын
Hello sir.. I'm getting the losses as nan after the training process. Can u plz help me out with this.
@robmulla
@robmulla Жыл бұрын
Oh, that's not good. That usually happens if your model fails to converge or if your labels are not correctly setup. Hope you can figure it out!
@madhura305
@madhura305 Жыл бұрын
Oh. Thanks.. Then wt website would u suggest for correct labeling
@syahirahzubair
@syahirahzubair Жыл бұрын
do you know how to deploy and use it in Flutter app?
@robmulla
@robmulla Жыл бұрын
Sorry, I'm not familiar with Flutter.
@ubuntulinux81
@ubuntulinux81 Жыл бұрын
I am getting this kind of error what could be the reason assert mlc < nc, 'Label class %g exceeds nc=%g in %s. Possible class labels are 0-%g' % (mlc, nc, opt.data, nc - 1) AssertionError: Label class 15 exceeds nc=5 in data/custom.yaml. Possible class labels are 0-4
@robmulla
@robmulla Жыл бұрын
I believe this error means that your data configuration yaml file only has 5 labels (0, 1, 2, 3, 4). One of your label files however must have a label of 15. You need to either fix the label file to not have the class of 15 or change your configuration yaml to have more classes defined. Hope that helps!
@ubuntulinux81
@ubuntulinux81 Жыл бұрын
@@robmulla you are saying that one of my txt file has class index of 15 am i right
@robmulla
@robmulla Жыл бұрын
I believe so. Check to see if any of the txt files have a 15 in the first column.
@ubuntulinux81
@ubuntulinux81 Жыл бұрын
@@robmulla Actually i have trained the model on yolo4 which works fine now i am using same data to train on yolov7
@ubuntulinux81
@ubuntulinux81 Жыл бұрын
@@robmulla thank you
@liamsoccerpro3040
@liamsoccerpro3040 Жыл бұрын
how do i load the model if i were making my own version of detect.py
@robmulla
@robmulla Жыл бұрын
The model objects are within the package, but I'd suggest starting by just modifying the existing detect.py
@Team-fh2rr
@Team-fh2rr Жыл бұрын
Good day! Your experience is so cool. Can I contact you about the opportunity to work on my project?
@robmulla
@robmulla Жыл бұрын
Glad you liked my video. I'm not currently seeking extra work.
@Team-fh2rr
@Team-fh2rr Жыл бұрын
​@@robmullaGood day! We have some issues with object detection on custom datasets and would be appreciated any advice. Is it possible to have a 1-hours consultation?
@rutho.6282
@rutho.6282 Жыл бұрын
Rob Mulla 💰💰💰
@robmulla
@robmulla Жыл бұрын
Thanks?!
@karanjotsinghbagga2097
@karanjotsinghbagga2097 Жыл бұрын
Where can i get that git link?
@robmulla
@robmulla Жыл бұрын
Ummm. I need to dig it up. Sorry!
@parassalunkhe6583
@parassalunkhe6583 10 ай бұрын
where is the link to the code.
@kyrellosayman2803
@kyrellosayman2803 Жыл бұрын
excuse me, where is the code for this?
@robmulla
@robmulla Жыл бұрын
All of the code I use is cloned directly from the yolo repo: github.com/ultralytics/yolov5 and github.com/WongKinYiu/yolov7
@kazio13579
@kazio13579 Жыл бұрын
17:08 name of this endgame?
@robmulla
@robmulla Жыл бұрын
Yes, do you know it?
@kazio13579
@kazio13579 Жыл бұрын
​@@robmulla No but i trying find,it too hard. My first think was Anand vs Kasparov 1996 but it's not enough pieces 🙈
@robmulla
@robmulla Жыл бұрын
​ @Krzysztof Honestly at this point I forget :D But I think it was an older game. Maybe fischer?
@DIGIL.
@DIGIL. Жыл бұрын
9:25 what is that software..
@robmulla
@robmulla Жыл бұрын
This is the Linux terminal.
@DIGIL.
@DIGIL. Жыл бұрын
@@robmulla I mean selecting and labelling objects of image. Which software helps to do it?
@Brandon.A.Alvarez
@Brandon.A.Alvarez 10 ай бұрын
@@DIGIL.this is also what I want to know
OpenAI Whisper Demo: Convert Speech to Text in Python
4:59
Rob Mulla
Рет қаралды 98 М.
YOLOv5 training with custom data
20:29
DeepLearning
Рет қаралды 406 М.
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 11 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 82 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 8 МЛН
Official YOLO v7 Custom Object Detection Tutorial | Windows & Linux
13:07
Build an Object Detector for Any Game Using YOLO
22:40
Moises de Paulo Dias
Рет қаралды 36 М.
YOLO-World: Real-Time, Zero-Shot Object Detection Explained
17:49
Object detection Using Detection Transformer (Detr) on custom dataset
18:21
Open Source Face Analysis with Python
15:07
Rob Mulla
Рет қаралды 46 М.
YOLO Object Detection (TensorFlow tutorial)
21:51
Siraj Raval
Рет қаралды 1,3 МЛН
Object Detection in 10 minutes with YOLOv5 & Python!
10:45
Rob Mulla
Рет қаралды 225 М.
TOP-18 ФИШЕК iOS 18
17:09
Wylsacom
Рет қаралды 713 М.
AI от Apple - ОБЪЯСНЯЕМ
24:19
Droider
Рет қаралды 116 М.
DC Fast 🏃‍♂️ Mobile 📱 Charger
0:42
Tech Official
Рет қаралды 482 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 37 МЛН