*F.A.Q. : below you'll find my reply to your most requested questions* *1) Train YOLO for multiple classes?* This specific tutorial I've created is for just one class. I wanted to make it as simple as possible for beginners to just get the hands on object detection. If you want to train YOLO for multiple classes do consider buying my Object Detection Course: pysource.com/object-detection-opencv-deep-learning-video-course/ You fill find also a dedicated lesson and python notebook to train your detector for multiple classes. *2) Why does your output stop here: "608 x 608 create 6 permanent cpu-threads"?* This error is difficult to debug, because it might be for a series of errors. Just make sure that you followed the tutorial correctly, that there are no typos on the folder names you've created and most importante, make sure that all the images are ".jpg" format. *3) Weights file are not added to google drive?* First of all make sure that that the training reached at least 100 iterations, after that weights file will be saved each 1000 iterations. *4) Cuda out of memory error?* Probably you have a big dataset of images and the GPU can't fid them all, so your dataset should be smaller, at least to work with these specific settings.
Salve Sergio, sono nell'ultima fase nel mio progetto, non ho più tanto tempo e ho avuto un po di problemi nel mio training, voglio che mi daresti una mano o un piccolo aiuto per favore , il tuo tutorial è il migliore di tutti quelli che ho visto grazie.
This is so so helpful Thank you so much Literally no other video on RUclips has a tutorial like this which shows how to save the custom trained yolo model and use it in your own project
If your execution stops with "608 x 608 create 6 permanent cpu-threads"... Check: - all image files are .jpg, no .png - all image files have corresponding .txt labels - the class of your label is what's in the colab notebook, not 'Koala' (i.e if you're using something else)
Also, if your zipped folder "images" contains another folder that contains the actual image files (jpg,txt), then I get the same 608X608 message. So, I had to make sure my zipped images.zip folder didn't contain any nested folders and only contained the data (images and text files)
I have one question here. How can we use preprinted model and add our newly trained model with that. For example i have 80 classes in coco names but now i trained model with 2 new classes and i want that 80 and also 2 new classes. So in result my model is able to detect total 82 object. Please Help me for this...
you can freeze the model till the last convolution layer, add 82 units in the next layer with softmax activation, and then retrain this last layer with the input of the frozen layer on the new dataset with 82 classes.
Great tutorial! Useful content for sure. Thank you very much. Could you let me know the changes which need to be performed for multiple object detection?
Thank you very much Sergio this is a great tutorial. I would be interested in knowing how to extend the code for detecting more classes. Would you give an update?
Hi Sergio, great tutorial! I have one quick question though which I'm sure a lot of people are wondering about. I keep getting disconnected from colab which prevents me from finishing the training. Instead of training the model from scratch again, is it possible to load latest weights instead of pretrained ones and continue training from there in new session? Many thanks!
Hey man! Nice video I really enjoy it, easy to follow and everything but when I get to the last step on the image processing instead of learning it takes only a few seconds and then a message pops up saying "Create 6 permanent CPU-threads ". Any Idea what could be the problem?
@@dicharjachkson8003 Ye I did, it is important that you have the right file format... I had .JPG files but it only accepts .jpg files... Ye, it doesn't accept .JPG with capital letters...
What a great tutorial, I really learned a new thing. I have one question, how can I train this yolov3 and save the model in h5 and cfg files, I am really struggled here ://
Hey, nice tutorial. Thanks a lot. I did the same thing, but suddenly got an error like this one: output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()] IndexError: invalid index to scalar variable. Do you have an idea what is wrong with this? I see taht opencv.dnn.readNet( ) doesnt have any response. But I can't understand why. Can you give me a tip?!
Do images in the dataset have to be of some specific size in pixels? also, do all of them have to be of the same type e.g. all of them landscape or square, or it doesn't matter?
Hi I would like to ask why does it prompt "'sed' is not recognized as an internal or external command, operable program or batch file." when I try to run the program
Traceback (most recent call last): File "yolo_object_detection.py", line 8, in net = cv2.dnn.readNet("yolov3_training_last(1).weights", "yolov3_testing.cfg") cv2.error: OpenCV(4.2.0) /io/opencv/modules/dnn/src/darknet/darknet_importer.cpp:214: error: (-212:Parsing error) Failed to parse NetParameter file: yolov3_training_last(1).weights in function 'readNetFromDarknet'
Do we need to change the image sizes before uploading and do we need to resize the x, y labels in the .txt file according to the input 416 size that the yolo takes? Please help pysource.
Hey! great video i just want to know if we were training for multi classes so what changes to be made in this line: !echo "Apple Orange Banana Bread Carrot Grape Juice Lemon Pizza Tomato" > data/obj.names like this ? or this is wrong can u pls help!
Hi sir, I have tried using my own images which I am detecting melon fruit. However, it is not giving me the exact position when i tested it on Python. Perhaps you could explain what may cause it to be inaccurate? Thank you so much sir
There are some stupid mistakes I have made. Sorry for my poor English. 1. Do the exact same way to zip all the files and images. (It means that we should ctrl+A to select all the files and right-click to zip them so that the files will right be inside the zip file.) 2. Be sure that your class.txt should only have one class, and all of the text files should start with 0, which means that it belongs to class 0. (I labeled my data "car", but I selected the one provided by labelImg , so it turned out to be multiple classes.)
Hi! Excellent video! I've also watched the workshop... Awesome... One question... If I have a "moving" background, not fixed, the only way to track one exclusively item is by Yolo? I was trying but it's very heavy for mobile, isn't it?
Thanks for this, the hardest part appears to be setting the parameters in the yolo config file. Yolo's default of 20 - 80 objects is not helpful. 1 class is much easier to start with.
hey, great video! I was going to create a video about building a koala bear detector and found you already did it! lol, I will just choose a diferent marsupial : P
Hi! Thanks for the tutorial, can you explain a bit what happens after the image extractions? It is not very clear to me! I'm trying to make a "heads" detector, so I trained the network in images where there are many different heads (in the .txt file I have many rows with the various bounding boxes present in an image). As the camera is on top, it is a very difficult task, indeed, some heads look more like black circles... So I tried to do Data Augmentation, but this time the iteration stops around 1000 instead of 2000, I have no idea why...
here you using your label images to test can it work without labeled one for example we give image without labelling and check weather it works or not ?
nice work. I'm confused does the training you did on the koala dataset happen on a yolo model with all weights initialized randomly or are the weights of the inner model locked during training? or do you need to import pre trained weights if you want transfer leaning some custom datasets are very small how is it able to fit such a huge model??
Hi,thanks alot for such awesome tutorial,I want to ask one thing that if I want to train Yolov3-tiny what changes I have to made to train my custom model.waiting for your reply.
Hi Sergio,O have a huge dataset so when i training it the Google colabs time is out and it suggest me to use colab pro which I have to pay for it.My question is can I train a dataset which i already trained? Please answer,thank you for your videos.
i have installed opencv still getting these error Traceback (most recent call last): File "C:/Users/Aditi Khandewale/yolo_object_detection.py", line 1, in import cv2 ModuleNotFoundError: No module named 'cv2'
hi,, Error: l.outputs == params.inputs filter= in [convolutional]-layer does not match class= or mask= in [yolo]-layer magsut from error mentrain data, why?
I have a dataset with image and yml folder but for the training ı have to made the yml folder to txt folder. İn my yml folders there is xmin, xmax, ymin, ymax , depth, width,height which numbers did ı have to write in the txt folder?
Hello, thanks for this tutorial. Will this generate a coco.name classes file according to your customized dateset, or should i create it self after manualy?
🔥Learn how to build your own AI vision solutions: pysource.com/community
This is the most beginner/pro friendly tutorial i've ever seen.
608 x 608 create 6 permanent cpu-threads help this
True
@@kishore3785 did you get the solution to it?
@@kishore3785 same here. How do you fix it?
Please make a video tutorial for multiple class object detection, would be very helpful. Thanks
*F.A.Q. : below you'll find my reply to your most requested questions*
*1) Train YOLO for multiple classes?*
This specific tutorial I've created is for just one class. I wanted to make it as simple as possible for beginners to just get the hands on object detection.
If you want to train YOLO for multiple classes do consider buying my Object Detection Course: pysource.com/object-detection-opencv-deep-learning-video-course/
You fill find also a dedicated lesson and python notebook to train your detector for multiple classes.
*2) Why does your output stop here: "608 x 608 create 6 permanent cpu-threads"?*
This error is difficult to debug, because it might be for a series of errors. Just make sure that you followed the tutorial correctly, that there are no typos on the folder names you've created and most importante, make sure that all the images are ".jpg" format.
*3) Weights file are not added to google drive?*
First of all make sure that that the training reached at least 100 iterations, after that weights file will be saved each 1000 iterations.
*4) Cuda out of memory error?*
Probably you have a big dataset of images and the GPU can't fid them all, so your dataset should be smaller, at least to work with these specific settings.
Salve Sergio, sono nell'ultima fase nel mio progetto, non ho più tanto tempo e ho avuto un po di problemi nel mio training, voglio che mi daresti una mano o un piccolo aiuto per favore , il tuo tutorial è il migliore di tutti quelli che ho visto grazie.
Hello sergio if you can make a tutorial about SSD custom object detection please
yes, very interested.
thanks, I'm really looking forward for more course from you
thank you for the tutorial, it was very helpful ... what I asked was how I got the testing.cfg file for my custom object detection??
This is so so helpful
Thank you so much
Literally no other video on RUclips has a tutorial like this which shows how to save the custom trained yolo model and use it in your own project
Wombat in the 4th picture: "Am I a joke to you ?"
If your execution stops with "608 x 608 create 6 permanent cpu-threads"... Check:
- all image files are .jpg, no .png
- all image files have corresponding .txt labels
- the class of your label is what's in the colab notebook, not 'Koala' (i.e if you're using something else)
My code stops at 608x608
And my images are png , And the weight files are not uploading on my gdrive yolov3 folder :(
hello Doken, can you explain the detail about third point?
Also, if your zipped folder "images" contains another folder that contains the actual image files (jpg,txt), then I get the same 608X608 message. So, I had to make sure my zipped images.zip folder didn't contain any nested folders and only contained the data (images and text files)
Thanks for your tutorial about YOLO..
Helping student finished their Tasks 🙏👍👍
this tutorial is super easy! thank you for this, I'm training my own yolo weights at the moment
You earned my subscription, too (someone said this below). Great work. Keep it up!
Thank you soo much bro, very good and clear lectures , no biting about the bushes.
You saved my weekend holiday, thank you!
Sir. It was great to see your video and the way each part was explained was great Thank You and keep up the great work.
I have one question here. How can we use preprinted model and add our newly trained model with that. For example i have 80 classes in coco names but now i trained model with 2 new classes and i want that 80 and also 2 new classes. So in result my model is able to detect total 82 object. Please Help me for this...
hi, did you find any way ?
Can you share
you can freeze the model till the last convolution layer, add 82 units in the next layer with softmax activation, and then retrain this last layer with the input of the frozen layer on the new dataset with 82 classes.
khushboo priya transfer learning
Great tutorial! Useful content for sure. Thank you very much.
Could you let me know the changes which need to be performed for multiple object detection?
Thank you... Awesome... It worked properly for my dataset...
Thank you very much Sergio this is a great tutorial. I would be interested in knowing how to extend the code for detecting more classes. Would you give an update?
can I use this same code for multiple object detection?
let me know if you find the answer please
Yeah please let me know too
yes plz let me know too becoz i m also working on same kind of project.
Thank you, It's working very well. Please teach how to train multiple animals.
You’re a master Sir, I had no idea about this and I could do it! Thank u very much!!
where u get dataset?
How can i train for more than 1 classes
this is the very good video for beginners, I have ever seen...thnk you so much
you are awesome and ,something to the point and exactness!
Great Video!! When it is possible, could you make a video considering 2 classes? Like cats and dogs... or Koalas and Bears? Tks!!!
Hi Sergio, great tutorial! I have one quick question though which I'm sure a lot of people are wondering about. I keep getting disconnected from colab which prevents me from finishing the training. Instead of training the model from scratch again, is it possible to load latest weights instead of pretrained ones and continue training from there in new session? Many thanks!
simply and easy understanding tutorial, thanks
thank you so much!! can you please tell the changes we need for multiple classes
any changes required? i am trying for 3 classes
Great video brother, simple and crisp. Also, it would be great if u cud tell me how to implement this for real-time object detection.
Hello, I don't see the image when I execute the programm. Can you help me ?
super, waiting for next video
Amazing tutorial, everything works
but I did not get the updated weights
I can't get the cnfg file
Hey man! Nice video I really enjoy it, easy to follow and everything but when I get to the last step on the image processing instead of learning it takes only a few seconds and then a message pops up saying "Create 6 permanent CPU-threads ". Any Idea what could be the problem?
Hey! i have same problem, do you solved the problem?
@@dicharjachkson8003 Ye I did, it is important that you have the right file format... I had .JPG files but it only accepts .jpg files... Ye, it doesn't accept .JPG with capital letters...
Thanks! I think my brain just exploded....
This is exactly what i expected since i had amd ryzen laptop i cant use cuda but this helped me!! Thank you!!
Great tutorial! Thank you very much for this.
Can you please make a detailed video on how to detect a custom object in live stream?
Thank You
What a great tutorial, I really learned a new thing.
I have one question, how can I train this yolov3 and save the model in h5 and cfg files, I am really struggled here ://
Stunned by your work.
Love from Pakistan
From where you have find colab notebook?
Hey, nice tutorial. Thanks a lot.
I did the same thing, but suddenly got an error like this one:
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.
Do you have an idea what is wrong with this?
I see taht opencv.dnn.readNet( ) doesnt have any response. But I can't understand why.
Can you give me a tip?!
Change i[0] to i
@@hienongxuan3588 Thank you.
@@hienongxuan3588 Hello, for me changing i[0] to i only gives the image as it is. It's not identifying the image. What could be the problem?
Do images in the dataset have to be of some specific size in pixels? also, do all of them have to be of the same type e.g. all of them landscape or square, or it doesn't matter?
did you know what is the best image resolution?
Hi Thank you for this fantastic video! May I know how to change the code if we train in local computer GPU instead of Google colab? Thanks!
Precise and very informative
Hi I would like to ask why does it prompt "'sed' is not recognized as an internal or external command,
operable program or batch file." when I try to run the program
Thank you. Excellent video!!!!
great video , please tell ..can we use the same method for multiple classes??
Hi Sergio, Thanks for the tutorial. I have a question is the process same for yolov4 ?
Very informative tutorial - thanks!
you are the best!!! thank you again!!!
does anyone knows why i don"t find the model and weights on the yolov3 after training ?
Traceback (most recent call last):
File "yolo_object_detection.py", line 8, in
net = cv2.dnn.readNet("yolov3_training_last(1).weights", "yolov3_testing.cfg")
cv2.error: OpenCV(4.2.0) /io/opencv/modules/dnn/src/darknet/darknet_importer.cpp:214: error: (-212:Parsing error) Failed to parse NetParameter file: yolov3_training_last(1).weights in function 'readNetFromDarknet'
Do we need to change the image sizes before uploading and do we need to resize the x, y labels in the .txt file according to the input 416 size that the yolo takes? Please help pysource.
Hey! great video
i just want to know if we were training for multi classes so what changes to be made in this line:
!echo "Apple Orange Banana Bread Carrot Grape Juice Lemon Pizza Tomato" > data/obj.names
like this ? or this is wrong can u pls help!
Hi sir, I have tried using my own images which I am detecting melon fruit. However, it is not giving me the exact position when i tested it on Python. Perhaps you could explain what may cause it to be inaccurate? Thank you so much sir
Great video! Can we take input as a video rather than an image and work the same way?
There are some stupid mistakes I have made. Sorry for my poor English.
1. Do the exact same way to zip all the files and images.
(It means that we should ctrl+A to select all the files and right-click to zip them so that the files will right be inside the zip file.)
2. Be sure that your class.txt should only have one class, and all of the text files should start with 0, which means that it belongs to class 0.
(I labeled my data "car", but I selected the one provided by labelImg , so it turned out to be multiple classes.)
I have the problems 2) Why does your output stop here: "608 x 608 create 6 permanent cpu-threads"? at first.
You can also check out the Extract Images part, print(images_list) shouldn't just print []
, it means that it doesn't detect our images.
@@lawrencechen0215 I am getting this problem where it prints [], how can I resolve this?
You earned my subscription. Thanks.
Great tutorial, many thanks!!
Hi! Excellent video! I've also watched the workshop... Awesome... One question... If I have a "moving" background, not fixed, the only way to track one exclusively item is by Yolo? I was trying but it's very heavy for mobile, isn't it?
is there any way on how to put the training result on a graph?
Nice video loved ..and excellent explanation
Thanks for this, the hardest part appears to be setting the parameters in the yolo config file. Yolo's default of 20 - 80 objects is not helpful. 1 class is much easier to start with.
nice tuto !! is't the same for yollov5 ?
Why getting ( process finished with exit code 0) on pycharm without any output?!
I am using python 3.7
How did you solved this problem?
How did you solved that problem??? Please
Unfortunately no solution i found, giving "exit code 0" is good thing giving indication that the code working fine but no output
El mejor curso, un excelente maestro, gracias por compartir.
Hey, I am not getting the file in my drive after training. What should I do?
that is because you did not save the file in yolo format while using labelImg, you probably saved it with pascal formal.
hey, great video! I was going to create a video about building a koala bear detector and found you already did it! lol, I will just choose a diferent marsupial : P
By the way, great channel!
scores = detection[5:] why we did this and why we multiply the width center_x = int(detection[0] * width) ?
i try to badminton racket but didnt work, i have 200 images. Can you help my problem?
I can't find the ipynb file at all
Anyone understand the numbers: 0; 0.4; 0.461 in 7:23?? can somebody explain for me, please?
Hey man great video! I'm working on a project which also requires detecting koalas. Is there any chance I could borrow your dataset? Thanks!
Hi! Thanks for the tutorial, can you explain a bit what happens after the image extractions? It is not very clear to me!
I'm trying to make a "heads" detector, so I trained the network in images where there are many different heads (in the .txt file I have many rows with the various bounding boxes present in an image).
As the camera is on top, it is a very difficult task, indeed, some heads look more like black circles...
So I tried to do Data Augmentation, but this time the iteration stops around 1000 instead of 2000, I have no idea why...
Hi. Can i use this in video?
Can u explain pls what is Yolo and what is the diff between it and OpenCV ? and which python code editor do u use ?
After training no files in drive are created
I try to train in linux on GPU but idk how to enable GPU. But now i can fix it. thanks this VDO
Thank you very much, it's the best tutorial today
here you using your label images to test can it work without labeled one for example we give image without labelling and check weather it works or not ?
Thanks. It's a great tutorial and super easy. How to show loss training loss and accuracy anyway?
i cannt find the model weight at my drive yolov3 after training session, how to solve it?
same error....how to solve ?????
thank youuuuuu !!!
so glad that I have you
thank you, but i have question. how to display graph loss?
Great video , thank you
Thankyou for this! Can you post a code snippet for linking this to a live video feed such as a webcam or drone feed?
Thank you so much for the turorial but i a have a question What changes i have to make for more than one class. like koala and snake etc?
This is amazing. Thanks a ton !!
nice work. I'm confused does the training you did on the koala dataset happen on a yolo model with all weights initialized randomly or are the weights of the inner model locked during training? or do you need to import pre trained weights if you want transfer leaning some custom datasets are very small how is it able to fit such a huge model??
Did Anyone solve the transfer learning with previous weights??
@@queenelozabeth can you plaese send the source code
Great tutorial. But where can I find your colab notebooks?
Hi,thanks alot for such awesome tutorial,I want to ask one thing that if I want to train Yolov3-tiny what changes I have to made to train my custom model.waiting for your reply.
hi, did you find solution ?
Hi Sergio,O have a huge dataset so when i training it the Google colabs time is out and it suggest me to use colab pro which I have to pay for it.My question is can I train a dataset which i already trained? Please answer,thank you for your videos.
i have installed opencv still getting these error
Traceback (most recent call last):
File "C:/Users/Aditi Khandewale/yolo_object_detection.py", line 1, in
import cv2
ModuleNotFoundError: No module named 'cv2'
just change "import cv2 "to "from cv2 import cv2"
Make sure you execute it in the command line as python3 and then the name of the file rather than python
Got to learn some new things. Informative video, not like boring style Videos.
How do you evaluate the model using metrics such as mAP and recall
hi,,
Error: l.outputs == params.inputs
filter= in [convolutional]-layer does not match class= or mask= in [yolo]-layer
magsut from error mentrain data, why?
Hello sir, may I ask does using raspberry pi 4 model B 8gb is enough to make the same mechanism but using it for detecting cats only.
After training no files in google drive are created. Need help 😁
wait is this tutorial can use for mutliclass? or just one class?
Hello, does including negative photos to my dataset improve the detection of custom object?
I have a dataset with image and yml folder but for the training ı have to made the yml folder to txt folder. İn my yml folders there is xmin, xmax, ymin, ymax , depth, width,height
which numbers did ı have to write in the txt folder?
Model is not getting created after the training. No error is found after Training. What might be the issue ?
How can I plot training and validation accuracy?
Hello, thanks for this tutorial. Will this generate a coco.name classes file according to your customized dateset, or should i create it self after manualy?