YOLOV5: How to Train a Custom YOLOv5 Object Detector | Official YOLOv5

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น •

  • @henriklauridsen9686
    @henriklauridsen9686 ปีที่แล้ว +1

    I meant. You are absolutely fantastic at explaining. Very instructive. Big fan already

    • @LearnOpenCV
      @LearnOpenCV  ปีที่แล้ว

      Thank you! 😃 Glad you enjoyed it!

  • @goodtechdoor
    @goodtechdoor 2 ปีที่แล้ว +1

    Glad to get this from you directly. Closing in on the expert bundle, CV has me.

  • @LearnOpenCV
    @LearnOpenCV  2 ปีที่แล้ว +6

    Time Stamps:
    0:00-00:20: Introduction
    00:20-00:29: YOLOv5n (Nano)
    00:29-00:38: YOLOv5s (Small)
    00:38-00:52: YOLOv5m (Medium)
    00:52-01:02: YOLOv5l (Large)
    01:02-01:50: YOLOv5x (Extra Large)
    1:50-02:45: Code Explanation
    02:45-04:19: Imports
    04:19-05:39: Epochs
    05:39-08:39: Download and Prepare Dataset
    08:39-09:55: Dataset Structure of YOLOv5
    09:55-13:59: Helper Function for Logging results
    13:59-17:57: Clone YOLOv5 Repo
    17:57-26:24: Train the model
    26:24-33:20: Training Process
    33:20-36:06: Training Summary and results
    36:06-48:09: Inference

  • @AngusLou
    @AngusLou 2 ปีที่แล้ว +1

    Clearly explained the concepts practically

    • @LearnOpenCV
      @LearnOpenCV  2 ปีที่แล้ว

      Hey! I'm glad you liked the video. Checkout other videos in the YOLO playlist, and do subscribe for more!

  • @atmadeeparya2454
    @atmadeeparya2454 10 หลายเดือนก่อน

    In the earlier video explaining the dataset structure, you mentioned to put the [train, test, val] folder in the images and labels folder respectively. However, in this examples at 9:15, there are train, test and val folders containing images and labels. which one to use?

  • @mikegardner5859
    @mikegardner5859 ปีที่แล้ว +1

    Thanks, consistently high quality advice and guidance

    • @LearnOpenCV
      @LearnOpenCV  ปีที่แล้ว

      Thank you for your kind words.

  • @henriklauridsen9686
    @henriklauridsen9686 ปีที่แล้ว +8

    lutely fantastic at explaining. Very educational. Big fan already

  • @israelraultininialvarez100
    @israelraultininialvarez100 2 ปีที่แล้ว +1

    [Q&A-8:00] Because the dataset contains duplicate files of the images and labels, the referred code removes the doubles (images and labels)

  • @iramarshad700
    @iramarshad700 2 ปีที่แล้ว +4

    This function is added to download the dataset from the provided URL and duplication check.
    Once the dataset is downloaded the for loop iterate the whole folder and displays the images and labels name.
    So it means that the directory is created successfully and the files are added. This code is added to show that files are extracted and we can see the image's names and label names. The inner loop (j%==2) is showing that if the image is repetitive then remove them.

  • @omerfarukguzel4972
    @omerfarukguzel4972 2 ปีที่แล้ว +1

    Just great, thank you!

  • @mohamadrezageranmayeh1605
    @mohamadrezageranmayeh1605 ปีที่แล้ว +2

    It was really helpful thank you

    • @LearnOpenCV
      @LearnOpenCV  ปีที่แล้ว

      Glad we could be of help! Please subscribe to our channel to never miss out on the YOLO series!

  • @Jjjj24971
    @Jjjj24971 ปีที่แล้ว +1

    Thank you so much teacher

  • @ChirawatNg
    @ChirawatNg ปีที่แล้ว +1

    Very informative…
    Thank you

    • @LearnOpenCV
      @LearnOpenCV  ปีที่แล้ว

      Glad it was helpful! :)

  • @kvnptl4400
    @kvnptl4400 2 ปีที่แล้ว

    7:40 We use that code block to go into each directory (train, valid, test) and remove images and labels at the even number places. The reason is to remove all duplicated files from the dataset.

  • @QuarktaschemitSenf
    @QuarktaschemitSenf 2 ปีที่แล้ว +6

    Hi there, you deserved your like for the introduction alone. Good overview and detailed explanation. Liked and subbed

  • @sedonghwang9566
    @sedonghwang9566 11 หลายเดือนก่อน +1

    I'm running this notebook through VSCode and I'm on the section where the model trains. I'm on the first epoch and around 11 minutes in. Is this the expected behavior? You said in your video that training 25 epochs took 0.096 hours (which equals around 6 minutes). I'm using an m1 macbook, so performance shouldn't be an issue. Do you know what the issue may be?

    • @LearnOpenCV
      @LearnOpenCV  11 หลายเดือนก่อน

      The bottleneck could depend on the dataset, the device, or the training configuration. In this case the issue could be due to M1 MacBook, because it does not have a dedicated GPU.

  • @rajkkapadia
    @rajkkapadia 2 ปีที่แล้ว +1

    I think the code section after where you download the zip file, is there to make sure that only one image exists, actually, there are two images of a sample, so we remove one image and the label as well.

  • @ghassenjridi4910
    @ghassenjridi4910 8 หลายเดือนก่อน

    For transfer learning, how many layers are there in total , so if the you froze the first 15, how many are being trained ?

  • @AhmedFarhan-jg6br
    @AhmedFarhan-jg6br ปีที่แล้ว +1

    Hey, how can we use live video from webcam to test the model?

  • @eduardmart1237
    @eduardmart1237 2 ปีที่แล้ว +2

    can YOLO detect smal objects? like taken from the plane or something like google earth? Or is there a model that id better suited for this role?

    • @Pranavm6778
      @Pranavm6778 ปีที่แล้ว

      Same que did you get the answer

  • @Raul-pf8il
    @Raul-pf8il 9 หลายเดือนก่อน +1

    Is there any way to make the model color the objects detected instead of putting them in a box?

    • @LearnOpenCV
      @LearnOpenCV  8 หลายเดือนก่อน

      Hey, drawing bounding boxes is an object detection problem, while colouring the objects is a segmentation problem. Please check out our segmentation playlist to know more: th-cam.com/play/PLfYPZalDvZDI9jLmgXgUgBOz7YCNlT8DP.html

  • @murcuschimaawaloyi6619
    @murcuschimaawaloyi6619 4 หลายเดือนก่อน

    Very good explanation. Hi Sir. I have been following your tutorial on how to train a custom Yolov5 object detector as I am doing a school project on vehicle detection. I am having an error on training my model. Is it ok if you can help on this please.

  • @venkatahungurge7483
    @venkatahungurge7483 8 หลายเดือนก่อน

    Hi sir, the yolov5 confusion matrix does not match the precision rate and recall rate

  • @kalifardiansyah5863
    @kalifardiansyah5863 2 ปีที่แล้ว

    well how to recognize yolov5 training when overfits? is that from Precission when it reach values : 1 ?

  • @zy.r.4323
    @zy.r.4323 2 ปีที่แล้ว

    Thanks for the video. How is the best way to prepare dataset of multiple classes passing conveyor belt ? static Ip camera

  • @merzaguiboumedienabdelouhe2435
    @merzaguiboumedienabdelouhe2435 9 หลายเดือนก่อน +1

    this is a great video, how can we use this model on a pythone or rasberi machine without internet

    • @LearnOpenCV
      @LearnOpenCV  9 หลายเดือนก่อน

      No, we cannot train YOLOv5 on Raspberry Pi. However, we can run inference using an optimized YOLOv5 model on the device.

  • @fayezalhussein7115
    @fayezalhussein7115 2 ปีที่แล้ว +1

    Dear how i could use yolov5 in two phases object detection ?

    • @LearnOpenCV
      @LearnOpenCV  2 ปีที่แล้ว +1

      Hi! YOLOv5 itself is a single stage object detector. In case you want to go for two stage detectors, Faster RCNN models are some of the best ones. Further, if you want to use any component of YOLOv5 in two stage detection, you can take the YOLOv5 CSP backbone and attach it two the Faster RCNN head. That will also work as a two stage detector.

  • @trivialisa8570
    @trivialisa8570 2 ปีที่แล้ว +1

    How i can use the model to run yolov5 for real time inject detection

    • @LearnOpenCV
      @LearnOpenCV  2 ปีที่แล้ว

      Yes, you can! You'll have to train the model using custom insect dataset.

  • @rajatbansal6902
    @rajatbansal6902 ปีที่แล้ว

    I have to integrate the trained model in my project

  • @kmashal2
    @kmashal2 2 ปีที่แล้ว

    The code Added after downloading the data is there to check for duplicates and remove them.

  • @leenanesamani547
    @leenanesamani547 2 ปีที่แล้ว +3

    Hi excellent explanation. Love your videos. Can I use this video to prepare a research paper? please confirm

    • @LearnOpenCV
      @LearnOpenCV  2 ปีที่แล้ว

      Thank you and you may go ahead! Please give us credit for the same. :)

  • @AliNauman-w9c
    @AliNauman-w9c ปีที่แล้ว

    is it possible to count the objects after the detection

    • @LearnOpenCV
      @LearnOpenCV  ปีที่แล้ว

      Hi, yes. You can checkout this code: github.com/ultralytics/yolov5/issues/2696#issuecomment-815061140 and update it as per your liking.

  • @rajatbansal6902
    @rajatbansal6902 ปีที่แล้ว

    Hi I want to export the trained model and use it in my local machine

  • @LearnOpenCV
    @LearnOpenCV  ปีที่แล้ว

    Get expert guidance, insider tips n tricks and Create stunning images, learn to fine tune diffusion models, advanced Image Editing techniques like In-Painting, Instruct Pix2Pix and many more.
    Join our Kickstarter campaign now! bit.ly/3JYh7A6

  • @stefangrandl8623
    @stefangrandl8623 2 ปีที่แล้ว +1

    The code block (mentioned in "Imports") is to delete every second image and label correspondingly, because they occur twice in their folders.

  • @rakeshkumarrout2629
    @rakeshkumarrout2629 2 ปีที่แล้ว

    Love your content .I guess you are from revenshaw.My gf sister everybody from their

  • @LearnOpenCV
    @LearnOpenCV  ปีที่แล้ว

    📚 LINK TO BLOGPOST: learnopencv.com/custom-object-detection-training-using-yolov5/
    ▶ LINK TO YOLO MASTERCLASS PLAYLIST: th-cam.com/play/PLfYPZalDvZDLALsG9o-cjwNelh-oW9Xc4.html

  • @najwasla5139
    @najwasla5139 2 ปีที่แล้ว +1

    Hello thank you for this good video , but the code is does not work for me , If you can help me and thank you again

  • @irfanzafar120
    @irfanzafar120 ปีที่แล้ว

    where is ipynb ?

    • @LearnOpenCV
      @LearnOpenCV  ปีที่แล้ว

      Hi, you can find the notebook here: github.com/spmallick/learnopencv/tree/master/Custom-Object-Detection-Training-using-YOLOv5

  • @rickykhairulfaza3436
    @rickykhairulfaza3436 ปีที่แล้ว

    pake model jangan pretrained

  • @__________________________6910
    @__________________________6910 2 ปีที่แล้ว

    #each folder has duplicate images and labels
    dirs = ['train', 'valid', 'test']
    #loop through 'train', 'valid', and 'test'
    for i, dir_name in enumerate(dirs):
    #store all images name in from each folder and store it temp variable all_image_names
    all_image_names = sorted(os.listdir(f"{dir_name}/images/"))
    #loop through all_image_names
    for j, image_name in enumerate(all_image_names):
    #because we have duplicate images and lavel so delete only even number image or you can say store first one delete second one
    if (j % 2) == 0:
    #because label file extenstion is .txt not job so grab the file name
    file_name = image_name.split('.jpg')[0]
    #direct remove the every images 2'nd duplicate
    os.remove(f"{dir_name}/images/{image_name}")
    # using the file name delete the 2'nd label file
    os.remove(f"{dir_name}/labels/{file_name}.txt")

  • @rishabhgupta2428
    @rishabhgupta2428 ปีที่แล้ว

    Hey nice video, but I am not able to understand how to run train.py file successfully on my colab.
    Below is the error i am getting again and again. even after pasting the correct path of yaml file.
    This is the code i have written in my colab.
    ! python train.py --img 640 --batch 16 --epochs 3 --data '/content/drive/MyDrive/DL_unzipdata_files/Vehicle_object_detection/data.yaml' --weights yolov5s.pt
    This is the msg I am getting
    Dataset not found ⚠, missing paths ['/content/yolov5/valid/images']
    Traceback (most recent call last):
    File "train.py", line 634, in
    main(opt)
    File "train.py", line 528, in main
    train(opt.hyp, opt, device, callbacks)
    File "train.py", line 111, in train
    data_dict = data_dict or check_dataset(data) # check if None
    File "/content/yolov5/utils/general.py", line 542, in check_dataset
    raise Exception('Dataset not found ❌')
    Exception: Dataset not found ❌

    • @sovitrath4735
      @sovitrath4735 ปีที่แล้ว

      Can you please check that the dataset has been downloaded and extacted correctly?

    • @rishabhgupta2428
      @rishabhgupta2428 ปีที่แล้ว

      @sovitrath4735 Hey, thanks for replying, as i am new to object detection, i had no idea that we could edit the yaml file.
      So i have sorted the issue.
      Just a suggestion please make videos as the users are entirely beginners, not just read out the code.
      As the person from the video has not mentioned many things which i have to take help through other coders and took me 5 days to implement the code from scratch.