How to train YOLOv8 Object Detection on Custom Dataset | step by step Tutorial | Google Colab

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 146

  • @dikshagoyal1000
    @dikshagoyal1000 14 днів тому +1

    Thanks a lot man ....❤
    The best video on yolov8 through Google colab🙌🏻

  • @Permian777
    @Permian777 11 місяців тому +8

    Thank you. Thank you. Thank you Mr. Coder Zero. I have spent a year and a half trying to figure out this stupid ass YOLO object detection and finally, courtesy of your video, I have now managed to figure it out. Hot dog! I am now a happy camper. I can now expire in peace!

  • @DikshithaKV
    @DikshithaKV 9 місяців тому +1

    Thank you so much literally searched so many videos, finally found your video, it was a really great help, thank you😄

  • @vimalsolanki870
    @vimalsolanki870 Рік тому +5

    i tried many tutorial but this tutorial is best and briefly explain each terms thank you very much

  • @jonesin9579
    @jonesin9579 10 місяців тому +2

    Thank youuuuu thank youuuu very much Mr... You helped me a Lot !!! May God Bless you

    • @coder_zero
      @coder_zero  10 місяців тому

      Glad to hear that😀

  • @yiksengtee8402
    @yiksengtee8402 Рік тому +18

    For those who had the issue of not being able to save the files to "runs/detect/predict" after finish generating at the inferencing section (regardless its for images or videos), try adding "save=True" at the end of the prompt.

  • @shailendralowanshi1016
    @shailendralowanshi1016 Рік тому +2

    Very good vedio, everything is in detail. Thankyou for that. Keep helping

  • @justavrilm
    @justavrilm 8 місяців тому +1

    thank you so much for being so clear and concise

    • @coder_zero
      @coder_zero  8 місяців тому

      Glad it was helpful! 🤠

  • @sowmiyas2729
    @sowmiyas2729 Рік тому +3

    Thank you so much, sir, for the excellent explanation. It really helped me in my project. Again thank you, sir.

  • @dorianxjz4070
    @dorianxjz4070 6 місяців тому +1

    Thank you for the tutorial. I'm having trouble on seeing the results on a video. I followed the exact code from your tutorial, and uploaded a test mp4 file. When I infer on the video, the program shows that the video is actually being tested on frame by frame, but when it finishes, it doesnt show up on my drive
    edit:
    leaving my comment up in case anyone has the same problem. The issue was that it takes a while to upload a video to the drive. I used a 30 second video but it took about 10 minutes. Its doesn't upload as quick as an image

    • @coder_zero
      @coder_zero  6 місяців тому

      Use save= True to save video. Find this output path. Then you can use Linux copy command cp to copy this output video to your drive.

  • @carlos.sousa.7070
    @carlos.sousa.7070 Рік тому +1

    I have a huge dataset and after running it 10-15 epochs I always get an error message saying an image was not found but in reality it was always there in the dataset.
    Can you help?
    In my local environment I never had that error message, but I tried Google Colab because it has more resources.

  • @muhammadkry9499
    @muhammadkry9499 Рік тому +2

    Thank sir for the explanation

  • @AachalGupta-m9x
    @AachalGupta-m9x 8 місяців тому +1

    I have one doubt..we are passing image paths of training and validation in yaml file.what about labels?we are not passing anything related to labels.Then how does the model know

    • @coder_zero
      @coder_zero  8 місяців тому

      In the algorithm, it will replace 'images' with ''labels' and take care of labels 🙂

    • @AachalGupta-m9x
      @AachalGupta-m9x 8 місяців тому

      @@coder_zero okay thanks a lot for this tutorial

  • @shreyaspatil5536
    @shreyaspatil5536 Рік тому

    one doubt i had the video after testing is getting saved in form of frames and not mp4 what to do

  • @positiveaura3290
    @positiveaura3290 Рік тому +3

    thank you for the tutorial. May i please know why i get this error (FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/yolov8/data/download_images.py.jpg') when i run the codes to split the dataset?

    • @seanolivieri4829
      @seanolivieri4829 Рік тому

      Getting the same error

    • @carlos.sousa.7070
      @carlos.sousa.7070 Рік тому

      Im also getting the same error

    • @sharathsnair3798
      @sharathsnair3798 Рік тому

      Have you got that

    • @MrJeopold
      @MrJeopold Рік тому

      inside data.yaml file, try these:
      path: C:\**yourprojectfoldername**\dataset # dataset root dir
      train: images\train # train images (relative to 'path')
      val: images\validation # val images (relative to 'path')

    • @safira604
      @safira604 Рік тому

      I had the same error, turns out that if you upload files to drive you need to unselect automatic conversion (Settings > Uploads > Untick convert uploads) so that the format is right for the script. (If it's wrong, you might be getting, for example, ..jpg instead of .jpg. easy to miss)

  • @somasekhar3731
    @somasekhar3731 7 місяців тому

    can you tell me where didi you downloaded the 8 videos in the drive

  • @RahulVimalkanth
    @RahulVimalkanth 10 місяців тому +1

    Thanks tons sir!

  • @reaze4977
    @reaze4977 Рік тому +1

    bravo thx for the tutorial sir

  • @bLack-hf6qm
    @bLack-hf6qm 6 місяців тому

    Where I will gets the videos???? They are not in kaggle dataset

  • @xinloongfoo2951
    @xinloongfoo2951 7 місяців тому

    I would like to ask what if i would like to detect some other objects like resistor, inductor and capacitor which is the electrical component how would i do that?

    • @coder_zero
      @coder_zero  7 місяців тому

      Hi, steps are : data creation, model training. You have to collect images of all required items in various conditions, then annotate in yolo format to create data. Then you can follow this tutorial to train and test the model

  • @kadiravcii
    @kadiravcii Рік тому +2

    Thank you for the video, sir. However, what I want from you is this: In the last part, I want to open a webcam instead of a video and test whether it recognizes it that way. What can I write?

    • @coder_zero
      @coder_zero  Рік тому

      Hi, you can follow this tutorial ua-cam.com/video/O9Jbdy5xOow/v-deo.htmlsi=jgSZRk7ZjyuCt9o8

  • @lightning00769
    @lightning00769 9 місяців тому +1

    if I have only one class to detect, I have to make changes in the dataset.yaml file right?

    • @coder_zero
      @coder_zero  9 місяців тому

      Yes

    • @lightning00769
      @lightning00769 9 місяців тому

      @@coder_zerothanks!! and hey if you could also help with one more thing please, how can I train this model with videos instead of images?

    • @coder_zero
      @coder_zero  9 місяців тому

      @@lightning00769 have a look at this github.com/ultralytics/ultralytics/issues/7206

  • @gandharvathite6181
    @gandharvathite6181 9 місяців тому +1

    Nice tutorial man, just one question, how to get the locations (coordinates) of the boxes that are drawn in test images

    • @coder_zero
      @coder_zero  9 місяців тому

      Hi, have a look github.com/ultralytics/ultralytics/issues/7719
      This looks promising.

  • @ge440
    @ge440 11 місяців тому +1

    Thank you very much for your video.

    • @coder_zero
      @coder_zero  10 місяців тому

      You are welcome😀

  • @2102-ts1ed
    @2102-ts1ed 8 місяців тому +1

    Thank you so much my bro my love

  • @kasamrohithreddy2679
    @kasamrohithreddy2679 11 місяців тому +2

    Did you Manually kept some images in test or by division of code

    • @coder_zero
      @coder_zero  10 місяців тому

      Yes, I did. It's a best practice to keep some images for testing. Make sure that model has not seen these during training and validation.

  • @alfibima4247
    @alfibima4247 Рік тому +1

    Thank you for sharing.
    I want to ask something. I have trained data on colab. But the color of the bounding box between class 1 and the others is almost the same. how to change bounding box color?

    • @coder_zero
      @coder_zero  Рік тому

      We can use the python version of inference codem it will give the bboxes. Then we can use cv2 for custom color 😃

  • @ramanathreddyg7212
    @ramanathreddyg7212 10 місяців тому +1

    how many epochs and images is better to use for good object detection

    • @coder_zero
      @coder_zero  10 місяців тому

      Hi, it depends on your dataset and project. Also, don't focus on number of images. Focus on the distribution of data. Example: if you take 20000 images of cars in day time and train the model. It will struggle in night time or rainy days or during foggy weather.

  • @allea-zb7kl
    @allea-zb7kl 7 місяців тому

    hi, I have a question. if I divide the dataset into training and testing only, is it necessary to run the validation part? and if not, during inference how to find out the mAP?

    • @coder_zero
      @coder_zero  7 місяців тому

      You can create a custom function for this.

    • @allea-zb7kl
      @allea-zb7kl 7 місяців тому

      @@coder_zero If I split the data into train, validation, and test sets, is the mAP calculated based on the validation part, or do we need to create a custom function to determine the mAP from the test data?

  • @lorenzoleongutierrez7927
    @lorenzoleongutierrez7927 Рік тому +1

    Great work !

  • @rryann088
    @rryann088 2 місяці тому +1

    thanks a lot!

  • @sheicodes7393
    @sheicodes7393 Рік тому +1

    is it advisable to use jupyter nb in vscode than google colab to train more than 10k images? suppose i have a ryzen 7 laptop

    • @coder_zero
      @coder_zero  Рік тому

      Hi you can use jupyter nb. Change the directories accordingly and then set the batch size to 8

  • @andresbuitront2564
    @andresbuitront2564 Рік тому +1

    hi, nice video, i have a trouble the predict model runs well but doesnt create /runs/detect/predict folder in yolo 8.0.46 maybe you know why?

  • @bushrabazai4062
    @bushrabazai4062 Рік тому +1

    Thank you so much :)

    • @coder_zero
      @coder_zero  10 місяців тому

      You're welcome!😀

  • @shakilsyed
    @shakilsyed Рік тому +1

    My dataset is consisting 500 images but it only training 51 images why? what would be the problem?

    • @ajarivas72
      @ajarivas72 Рік тому +1

      Are the 500 images anotatted?

    • @coder_zero
      @coder_zero  Рік тому +1

      Hi, please make sure you annotate all images. Splitting of data should be done carefully. And ensure you give the correct path to the model during training.

  • @drushtinagarkar362
    @drushtinagarkar362 5 місяців тому +1

    greattt

  • @jibrilisah1
    @jibrilisah1 Рік тому

    please i'm having a problem with the spliting, how dont see where the code reads the dataset folder

    • @jibrilisah1
      @jibrilisah1 Рік тому

      i couldnt get the automation of spliting

    • @coder_zero
      @coder_zero  Рік тому

      Hi, it's a simple function. It creates a list of all image dirs and split into 80 : 20. Then copies the images and their label files into specific folders. You can create your own custom function for this train-val split.

  • @anyhow8174
    @anyhow8174 Рік тому +1

    For some reason, when I tried to use the .yaml, it says that dataset could not be found, any thoughts on why that happened?

    • @coder_zero
      @coder_zero  Рік тому

      Please ensure that you have created data folder structure as we have discussed in the tutorial. Then you have put the correct directory in the dataset.yaml

    • @anyhow8174
      @anyhow8174 Рік тому

      @@coder_zero ay yes it's done, thanks
      is there any way for this model to be fine-tuned? if yes, then what kind? and what exactly are the parameters within the model?

  • @streamovie5601
    @streamovie5601 Рік тому +2

    thanks man

  • @kemalkartal366
    @kemalkartal366 Рік тому

    hello,
    Can we add the object trained with the custom dataset to the other 80 object YOLO weights? As a single weight of 80+1. Can we increase the weight of the existing 80 objects?
    thanks.
    normally yolo weight consists of 80 objects.
    Can we add new objects to objects of this weight by training with custom datasets?

    • @coder_zero
      @coder_zero  Рік тому +1

      Hi, I have never tried this. But, theoretically you can try creating new weights by taking average of your pre- trained weights.

  • @ArifHussain-fs5jz
    @ArifHussain-fs5jz Рік тому +1

    Please make a video Yolov8 for semantic segmentation; I'm working on it but getting errors.

    • @ArifHussain-fs5jz
      @ArifHussain-fs5jz Рік тому

      RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 107 but got size 0 for tensor number 1 in the list.

    • @coder_zero
      @coder_zero  Рік тому

      hi, working on it. Will release soon :)

    • @ArifHussain-fs5jz
      @ArifHussain-fs5jz Рік тому

      @@coder_zero thanks

    • @rachakondasaiswaroop8993
      @rachakondasaiswaroop8993 Рік тому

      ​@@ArifHussain-fs5jz hey, i am getting the same error please let me know if you solved it.

  • @obaidulhasansouhag985
    @obaidulhasansouhag985 6 місяців тому +1

    Hey, Your video is very good and easy to understand. Could you make an tutorial how to install YOLO V8 for amd in windows 11? There is a tutorial in amd youtube channel about this but it is too hard to understand. Looking for your quick response.

    • @coder_zero
      @coder_zero  6 місяців тому

      Thank you. I am sorry 😔 I can't help you with this as I have a nvidia system.

  • @Eren-jq1sk
    @Eren-jq1sk 3 місяці тому

    can we do for this real time pc web cam and identify?

  • @vikashkumar-cr7ee
    @vikashkumar-cr7ee Рік тому

    Hi Deepak I couldn't find any video for inferencing on kaggle . Where did you get that ?

    • @coder_zero
      @coder_zero  Рік тому

      Hi, its a good practice to follow the notebook but work with your own data according to your own project.

  • @PrincePH
    @PrincePH 9 місяців тому

    Where can we find the test_images dataset? same with the videos

    • @coder_zero
      @coder_zero  9 місяців тому

      Hi, You can take videos and images from internet. I have done that only. The main process of this video is to show the training process. You can follow the tutorial with your own dataset. 😀

    • @PrincePH
      @PrincePH 9 місяців тому

      @@coder_zero it is working ty

    • @PrincePH
      @PrincePH 9 місяців тому

      @@coder_zero Hello! Is there other way to not purchase GPU in the colab?

    • @PrincePH
      @PrincePH 9 місяців тому

      @@coder_zero Hello, can i implement this in the GUI? And which one

  • @georginobaltazar
    @georginobaltazar 9 місяців тому

    olá, muito bom o contiúdo, baixei para aprender. vc poderia me passar o link para fazer o download dos arquivos das pastas output, video, vid2, training result e a test imag, não consigo encontrar. agradeceria

    • @coder_zero
      @coder_zero  9 місяців тому

      Sorry I couldn't share output videos.

  • @marthagichuki9539
    @marthagichuki9539 Рік тому +3

    Great video and explanation. How do we get the test images? are they part of the content in data folder?

    • @coder_zero
      @coder_zero  Рік тому +2

      Hi, you can keep some images from the data set for testing purpose.

  • @javovichluqsman5492
    @javovichluqsman5492 Рік тому

    Thanks for the video sir, but what about datasets that does not have any annotated box?

    • @coder_zero
      @coder_zero  Рік тому

      Hi, you can create your own dataset. Have a look at this video ua-cam.com/video/v-HIYfOqQeU/v-deo.html

  • @bayoleems
    @bayoleems Рік тому +1

    Thank you so much

  • @MARTINKWESIMAWUSI
    @MARTINKWESIMAWUSI Рік тому

    Where is the google colab code? I'm new to YOLO. I have downloaded the dataset but I can't follow the tutorial. Can you please share the Google colab code so I can follow the tutorial.
    Thank you.

    • @coder_zero
      @coder_zero  Рік тому

      Hi, you can find the notebook at github.com/deepakat002/yolov8

  • @sevenkliccs
    @sevenkliccs Рік тому +1

    what a great explanation. I'm wondering how can i generate the labels from images into those format? again thank you sir

    • @coder_zero
      @coder_zero  Рік тому +1

      Hi, you can use labelImg for annotation

    • @ajarivas72
      @ajarivas72 Рік тому

      @@coder_zero
      Is there a labeling software not restricted to boxes ?

  • @tonysiu8562
    @tonysiu8562 Рік тому

    Is the GPU instant provided by google colab free to use?

    • @coder_zero
      @coder_zero  Рік тому +1

      Hi, yeah, GPU instance is free upto some usage limit. After that you can wait for 24 hr to get the free version again.

  • @Anutosh13
    @Anutosh13 Рік тому

    why my results are not getting saved after executing inferencing step???

    • @Anutosh13
      @Anutosh13 Рік тому

      hey help bro I'm stuck

  • @IshiKag-v7i
    @IshiKag-v7i 11 місяців тому

    what about the accuracy of the model?

    • @coder_zero
      @coder_zero  10 місяців тому

      In detection model we focus on mAP value. This gives a good sense on model performance.

  • @Anutosh13
    @Anutosh13 Рік тому

    after inferencing code no run directory created ????

    • @Anutosh13
      @Anutosh13 Рік тому

      help bro
      this was the easiest video on yt and im stuck

    • @chiragubnare2944
      @chiragubnare2944 Рік тому

      @@Anutosh13 add another argument save=True in the inferencing cell

    • @Anutosh13
      @Anutosh13 Рік тому

      @@chiragubnare2944 yupp did that, thank you

  • @zainnaveed2196
    @zainnaveed2196 9 місяців тому

    Sir from where we find these 8 video

    • @coder_zero
      @coder_zero  9 місяців тому

      Hi, you don't need these videos. You can follow the tutorial with your own dataset 😃

  • @afriquemodel2375
    @afriquemodel2375 Рік тому +1

    HOW TO CONVERT MODEL TO TENSORFLOW MODEL?

    • @coder_zero
      @coder_zero  Рік тому

      hi, you can use yolo export model=yolov8n.pt format=pb
      for details about supported models, have a look at github.com/ultralytics/ultralytics/blob/16639b60ebc63111d0283edf9cf37f4b5ce479b9/ultralytics/engine/exporter.py

  • @hamzawi2752
    @hamzawi2752 Рік тому +1

    Thank you so much, but you did not talk about the annotation.

    • @coder_zero
      @coder_zero  Рік тому +1

      Hi, you can use labelImg for annotations. I will be creating a short video on annotations soon.

  • @kishoreg8835
    @kishoreg8835 Рік тому

    please train paddle ocr on colab

  • @manisharya2138
    @manisharya2138 Рік тому

    can provide drive link of video dataset

    • @coder_zero
      @coder_zero  9 місяців тому

      Sorry, I don't have that anymore. Please follow this tutorial with your own dataset. In this way it will be very helpful 😃