Train YOLOv5 on CUSTOM DATASET FAST & EASY - Object Detection | Deep learning | Data Science

Поділитися
Вставка
  • Опубліковано 30 вер 2024

КОМЕНТАРІ • 155

  • @VikashKumar-ty6uy
    @VikashKumar-ty6uy 2 роки тому +2

    Hi Karandeep,
    Weights are not there in yolov5 folder...can you plz help me out to resolve it

  • @bryqnstarl2823
    @bryqnstarl2823 Місяць тому

    What you use runtime type? Because your train processing so fast. I use T4 GPU but so slow almsot hours train process

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

    i am working with an instance, i get an error if data_config['path'].startswith(COMET_PREFIX):
    KeyError: 'path'
    COMET INFO: Couldn't find a Git repository in '/home/ubuntu/PPE_kit_Detection/yolov5_ppe' nor in any parent directory. Set `COMET_GIT_DIRECTORY` if your Git Repository is elsewhere.
    COMET WARNING: Comet credentials have not been set. Comet will default to offline logging. Please set your credentials to enable online logging. how to solve it

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

    why do we need --nosave --cache command while training?

  • @yuukichan_
    @yuukichan_ 3 роки тому +2

    Hi sir, my project is focused on a custom dataset but when I tried to implement it by following your step, I stuck in this line !/content/yolov5/weights/download_weights.sh which shows the error of /bin/bash: /content/yolov5/weights/download_weights.sh: No such file or directory. Can sir please guide me on this as I'm still new to this?

    • @karndeepsingh
      @karndeepsingh  3 роки тому +1

      I would suggest clone it properly. Or else check the repo it has that file or not.

    • @ilkinhuseynzade7535
      @ilkinhuseynzade7535 3 роки тому +8

      @@karndeepsingh It is not about cloning properly. In new edition of yolov5, the script is in different folder (/content/yolov5/data/scripts). You can download the weights with following commands:
      !curl -L "github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s.pt" > yolov5s.pt
      !curl -L "github.com/ultralytics/yolov5/releases/download/v5.0/yolov5m.pt" > yolov5m.pt
      !curl -L "github.com/ultralytics/yolov5/releases/download/v5.0/yolov5l.pt" > yolov5l.pt
      !curl -L "github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt" > yolov5x.pt

    • @python_for_life7832
      @python_for_life7832 2 роки тому +1

      @@ilkinhuseynzade7535 Its really worth

  • @abhishekranjan2617
    @abhishekranjan2617 3 роки тому +1

    sir my question is:-- how we label all the items in a dataset at once????????? Please tell me about this......

    • @karndeepsingh
      @karndeepsingh  3 роки тому +1

      You have to go through each and every image to label your data.

    • @abhishekranjan2617
      @abhishekranjan2617 3 роки тому +1

      @@karndeepsingh ok, thankyou👍

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

    hey could you please tell how to train a model on custom handwritten dataset?

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

      If you wanted to extract the handwritten region then you can simply apply the same approach as discussed in the video

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

    Hi bhai i got a task from a company.i tried all the steps mentioned here.But i failed to predict on new dataset.Kindly help.though i got rejected from that company but it would be great if you could guide me.please be kind and help me.Thank you.

  • @Grayando1
    @Grayando1 2 роки тому

    hello... hold on, how did we skip from labeling images to a folder ready to compress? The video was making sense till then... plz help boss! '' }

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

    Thank you so much sir...your explanation was top notch...because of this video i was able to make a project of custom dataset🙏

  • @rushingrifleman5238
    @rushingrifleman5238 2 роки тому

    Good video but the sound of the mouse clicks are way too loud and distracting.

  • @ArunKumar-sg6jf
    @ArunKumar-sg6jf 2 роки тому

    bro during training model it show labels 0 what is it means

  • @ungnomeuser9624
    @ungnomeuser9624 2 роки тому

    Sir can you help me train and test yolo V4,v5 and ssd and compare the results using table like accuracy,speed fps, mAP etc

  • @ranald73
    @ranald73 3 роки тому

    Why have you used that data.yaml file? do we need that? How to create that data.yaml file?

  • @Bushra_bushra99
    @Bushra_bushra99 3 роки тому

    Plz i need a help ... Error no images found?

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

    hi karndeep! i want to ask how we decide the epoch? is that a formula to decide the epoch??

  • @mohaiyedin
    @mohaiyedin 2 роки тому

    thanks for video...very helpful

  • @mohscorpion2
    @mohscorpion2 2 роки тому

    thank you so much , finally a useful , well described tutorial , best regards

  • @meghnarao3397
    @meghnarao3397 2 роки тому

    My .txt file after detecting has 6 columns. What does each of these represent. The first representing the class

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      Others are representing the bounding box information

  • @TLS_Squad
    @TLS_Squad 2 роки тому

    hi karndeep its a very helpful video but can you tell me after I create the the train set how can I detect a video an find a duplicate video using the same trained model

    • @karndeepsingh
      @karndeepsingh  2 роки тому +1

      Thats a total different problem to solve. You may use to embed every frame of video and find the similarity between the two embeddings of the video.
      You can try Siamese Network to do so.

  • @anishkrishnan3979
    @anishkrishnan3979 3 роки тому

    Hi, I trained a model to detect some custom objects. The model is detecting the objects, but when I convert the model to .mlmodel and embed it inside an IOS app it not detecting anything. Any idea why ?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Convert it into TFLite model or using ONNX type then you can make use of it.

  • @prakulsingla7112
    @prakulsingla7112 2 роки тому

    I am encountering quiet a few errors in this. First the weights were not downloading as the weights file have been moved to data folder. Second, when I give the command to train, it says that data cannot be trained without label. I have created labels and have gone over it many times. I don't know what to do next. Please help

    • @venkateshalla5115
      @venkateshalla5115 2 роки тому

      In the dataset that we have uploaded, in test and train folders change the name of the folder of labels from 'label' to 'labels'. After i did that, the error got resolved

  • @johnwhite9906
    @johnwhite9906 3 роки тому +1

    Hi Karndeep. I am glad to say that your tutorial really helped in my own project. Thank you very much. I improved mAP from 0.1 to 0.83. So, now my network works properly. Could you please explain how to do with the video clips in the same tutorial? Thank you in advance. Best regards, John

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      You have train yolo models on images and then inference it on video frames.

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

      @@karndeepsingh Hey , Thank you for this understanding tutorial
      But can you please explain the dataset management little bit
      How the other files are generated?

  • @anime_on_data7594
    @anime_on_data7594 3 роки тому

    You are underrated in this you tube

  • @workandplay717
    @workandplay717 2 роки тому

    Doing it this way will it allow multiple objects to be detected in the same image?

  • @SidharthKaushik
    @SidharthKaushik 2 роки тому

    Can you share your datasets as well

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      Check roboflow dataset. You can find dataset.

  • @shekharkumar1902
    @shekharkumar1902 2 роки тому +1

    Hi Karndeep ! Thanks a lot for such a simple and systematic explanation of Yolo5 implementation on custom dataset. Could you please suggest how to use/apply it on mobile /real-time application . How to use this model while driving a car or running it on a video file?

    • @karndeepsingh
      @karndeepsingh  2 роки тому +1

      You can save the model in tensorflow lite or onxx format or you can also train Yolov5s model for mobile device detection.
      For video you use open cv to load the video and iterate through each frame of the video and pass it to the trained yolov5 model for detection.

    • @shekharkumar1902
      @shekharkumar1902 2 роки тому +1

      @@karndeepsingh i can open the video through OpenCV but not sure how to iterate each frame of the video. Would i have to make labelling again on video frames ? or my separate labeled data can be used for video file ?See if you could share any code source to do so , It would be highly appriciated.

    • @zehra2334
      @zehra2334 2 роки тому

      @@shekharkumar1902 Did you find a solution for that?

    • @shekharkumar1902
      @shekharkumar1902 2 роки тому

      @@zehra2334 actually , no . I didn't explore in recent time but I know there are solutions for every challenges...

    • @zehra2334
      @zehra2334 2 роки тому

      @@shekharkumar1902 yes, I am sure about that :).

  • @luisk6986
    @luisk6986 3 роки тому

    excellent thank you very much

  • @ArunKumar-sg6jf
    @ArunKumar-sg6jf 2 роки тому

    it is mandoratory for label images in test folder

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      Yes. It will help you to understand the performance of model.

  • @sumitkumar-hn7rv
    @sumitkumar-hn7rv 3 роки тому

    Sir, my image size is 2756*4252 pixel...., how can I work with your colab notebook with these dimension. At the training time, It is throwing tcmalloc: large alloc error. Please help to solve this problem.

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Using --img 640 while training.

    • @abdulrahimshihabuddin1119
      @abdulrahimshihabuddin1119 3 роки тому

      @@karndeepsingh i'm facing the same issue . I have a dataset of images with size 1500x1376 pixels. Will the label files work properly if I resize the image because I got the label files from using the original image size ?

  • @Bushra_bushra99
    @Bushra_bushra99 3 роки тому

    Plz i need a help

  • @nimrahjabbin6294
    @nimrahjabbin6294 3 роки тому

    The way you explain .Appreciated

  • @hey_rexayyy
    @hey_rexayyy 2 роки тому

    Amazing and precise tutorial Loved it

  • @chasewithahmad
    @chasewithahmad 3 роки тому

    Love this Video, it was very helpful.

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

    do you have the dataset ??

  • @abderrahmenmelliti9627
    @abderrahmenmelliti9627 2 роки тому

    Hey I can not find the weights folder in yolov5 so im blocked in download all versions of YOLO-V5 Model, can anyone help me please

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      You can checkout ultranalytics github

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

      @abderrahmenmelliti9627 hi please can you help me with the yolov5 weights download ? i have the same problem

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

      You can visit ultranalytics github or download ultranalytics library to use models

  • @ghamandimalla9840
    @ghamandimalla9840 3 роки тому

    Hi Karndeep,
    The detect.py did not generate label.txt files, and it mentioned: 0 labels saved to runs/detect/exp17/labels. Following is the command I used.
    !python detect.py --source ./data/images --weights best.pt --img 416 --conf 0.4 --save-txt
    Any suggestions ?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Check your best.pt model path.

    • @ghamandimalla9840
      @ghamandimalla9840 3 роки тому +1

      @@karndeepsingh I assigned the correct full path also. But still it says: 0 labels saved to runs/detect/exp4/labels.
      This is my full Path:
      !python detect.py --source ./test_unseen_images --weights '/content/drive/MyDrive/yolov5/runs/train/yolo5s_22/weights/best.pt' --img 640 --save-txt --save-conf

  • @pranavrai1762
    @pranavrai1762 3 роки тому

    Thnx man

  • @hamzehrad6870
    @hamzehrad6870 3 роки тому

    thanks

  • @reealtech_xr
    @reealtech_xr 3 роки тому

    sir in my case your command for downloading all versions of yolo model is not working. says no such directory found

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      There has been change in the codes since then. Don't run that particular line of cell.

    • @reealtech_xr
      @reealtech_xr 3 роки тому

      @@karndeepsingh and its also showing cuda error when I am running it with colab gpu

  • @knowledgewithiqra9765
    @knowledgewithiqra9765 2 роки тому

    Sir I want to ask how we can change source code for only person detectiom

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      Its the same process that is shown in the video

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      You can use coco dataset itself to detect the person and yolo was trained on coco data.

  • @joesouaid1924
    @joesouaid1924 2 роки тому

    does the labeled pictures comes with the download ?

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      Yes. Only, If you download the labelled images.

    • @joesouaid1924
      @joesouaid1924 2 роки тому

      @@karndeepsingh thank you

  • @muhammadiqbalbazmi9275
    @muhammadiqbalbazmi9275 3 роки тому

    Thanks!

  • @anime_on_data7594
    @anime_on_data7594 3 роки тому

    Thats really amazing .

  • @PP-fh2mk
    @PP-fh2mk 3 роки тому

    At 14:30
    1) If we want to combine our custom set in default which yolov5 given sets
    is it possible? and how
    2) or can we delete some classes that we doesn't needs?
    I would like to make custom sets with person classes,
    But if I made custom sets in your videos' method
    Maybe i think i have to make person dataset again .
    ( I'd like to add my customs to the existing default datasets. )

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      If you want to only work on with a particular class you have to get the images and respective annotations for it.

  • @arooshmishra234
    @arooshmishra234 2 роки тому

    Hi Kandarp Singh,
    I have trying to train the Yolov5 on a skin dataset with about 2500 images of resolution 1100x800 on average. I am getting an accuracy of only 0.2 max even after adding custom augmentations to increase the train set size. without augmentation the accuracy is merely 0.11. Can you please advise what could be the issue? I can share weights and Biases results if you wish,

    • @ameyamahadevgonal8130
      @ameyamahadevgonal8130 2 роки тому

      maybe you can try increasing the value of epochs...this will take longer to train your model but will give you a good accuracy

  • @krishnachandar3636
    @krishnachandar3636 3 роки тому

    What if I had a single class label to model? Does yolov5 work in that case?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Yes

    • @umarmuhammadi429
      @umarmuhammadi429 2 роки тому

      Please i want to be able to detect pedestrian only in a video
      Do you know how i can do that?

  • @bhagibhargavi3033
    @bhagibhargavi3033 2 роки тому

    Hlo sir i need project on smoke detection and its code will help me please

  • @shuvagota8885
    @shuvagota8885 3 роки тому

    In my data.yaml file i have 33 classes where have also many unused classes.But i need only 18 classes.If train 33 classes(used and unused mixed up),then threre will have any problem to detect??
    and i also want to if use only 18 classes out of 33 what actually needed then what can i do? I should do annotate again??
    Note: for annotate i use roboflow tools.
    thank you sir.

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Are you using the same classes which are being used while training yolov5 ?

    • @shuvagota8885
      @shuvagota8885 3 роки тому

      @@karndeepsingh no

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      If you have already annotated 33 classes then let the model detect those all classes and write a script to only work with the classes you want. Or else train with 18 classes and annotate like how I described in the video( This would take lot of time)

  • @ddididid6046
    @ddididid6046 3 роки тому

    Great job!

  • @egamomusu
    @egamomusu 2 роки тому

    Thank you for the explanation..Excellent tutorial
    During training yolov5 models in Colab, some problem might occurs due to expired session or GPU usage has already reach the limited so that all the content in the colab directory will be erased.. is there any way to continue the training in this case? Thank you

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      Reduce batch size, that way colab wont go down

    • @zehra2334
      @zehra2334 2 роки тому +1

      we can create checkpoints for example at each epoch 2 , you can save the weights. Then upload the weight, and you can keep going where you left..

  • @nusaibaalsulaimani8904
    @nusaibaalsulaimani8904 3 роки тому

    where can I find the data.yaml file?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      You dont have to worry on data.yaml file. I prepared on for my own dataset. You have to prepare it for your own dataset.

    • @nusaibaalsulaimani8904
      @nusaibaalsulaimani8904 3 роки тому

      @@karndeepsingh can you tell me how I can prepare it?

  • @reealtech_xr
    @reealtech_xr 3 роки тому

    why can't we use xml file formate in yolo

    • @karndeepsingh
      @karndeepsingh  3 роки тому +1

      Every type model has different formate to accept. If you go for training any tensorflow model, you need to convert it into TFRecords.

    • @reealtech_xr
      @reealtech_xr 3 роки тому

      sir can you please tell which model supports xml foemate

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      @@reealtech_xr you can use yolo just you need to convert text to xml. In tensorflow as it takes annotations as XML and then convert it into TFrecords. So, you can do the conversion. Just check the source code or google to convert the files into respective format.

    • @reealtech_xr
      @reealtech_xr 3 роки тому

      @@karndeepsingh thanks for your help sir😇

  • @adeelazam5762
    @adeelazam5762 3 роки тому

    Why best.pt is not save in my run folder

    • @rajwaje5819
      @rajwaje5819 3 роки тому

      I was facing the same issue, but the next day when I tried training it again best. Pt was seen, don't know how just give it a try.

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Remove that --no-save flag from the command, it will start saving !

  • @shashidharpatil4899
    @shashidharpatil4899 2 роки тому

    Hi Karndeep, thanks for the tutorial.
    Pls tell about following thing: After passing new images and using detect.py it'll be able to detect and give coordinate but what about output data ..? Where wil be the label and precision wil be stored or is there any method to store that output data containg label name and precision.. please have a look on this

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      You can mention the argument -save-crop to save the detected objects

    • @shashidharpatil4899
      @shashidharpatil4899 2 роки тому

      @@karndeepsingh is there any option to save the predicted precision in text format? For example for any image of car if it's detected as Car_0.87

    • @shashidharpatil4899
      @shashidharpatil4899 2 роки тому

      How can we save this car_0.87 in text format? Pls share your thoughts

    • @karndeepsingh
      @karndeepsingh  2 роки тому

      You can pass -save-text argument. Please explore the functions in the detect.py you will understand.

    • @shashidharpatil4899
      @shashidharpatil4899 2 роки тому

      @@karndeepsingh okay thank you so much

  • @vishalnasre1251
    @vishalnasre1251 3 роки тому

    Hello karan, I want to save the result into csa file with result, confidence and class name.
    do u know, how can we do that..?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Run results.pandas()

    • @vishalnasre1251
      @vishalnasre1251 3 роки тому

      @@karndeepsingh but there is no results file generating from model.
      With --save -- txt, --save -- conf
      Multiple txt file are getting generated, which has, detected class, xmin, xmax, ymin, ymax, confidence .
      Then how can we get results in csv

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Write a code to convert these text files into CSV

    • @vishalnasre1251
      @vishalnasre1251 3 роки тому +2

      @@karndeepsingh is there is any that we can directly CSV file from model...?
      Any link

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Check yolov5 github repository.

  • @motaherhossain5851
    @motaherhossain5851 3 роки тому

    Hello sir. Can you pls tell me why the number of images are same as all images in train result? Such as
    Class Images targets p r
    all 40 40
    Cow 40 20
    Cat 40 20
    Why the images number is same?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Did you train on total 40 images combining Cow and Cat together?

    • @motaherhossain5851
      @motaherhossain5851 3 роки тому

      @@karndeepsingh yes sir

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      So, hope you are getting the point. It is showing total 40 images and out of that it has 20 instances of cow image and cat image respectively.

    • @motaherhossain5851
      @motaherhossain5851 3 роки тому

      @@karndeepsingh sir the picture of cow images 20 and the picture of cats are 20.. both type of images are in one folder. So why they show cat images 40 and cow images 40?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      @@motaherhossain5851 It is total images..you should focus on target.

  • @johnwhite9906
    @johnwhite9906 3 роки тому

    Hi Karndeep. Thank you for this tutorial, some moments are very useful. Could you please explain if, for example, a parameter of mAP@.5:.95: equals 0.0126, P = 0.736, R= 0.118, and mAP@.5 = 0.0653 These values are unacceptable, and something wrong with the created neural network? Your soonest response will be appreciated. Thank you in advance.

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      I can't comment on the stats until I know, how much data you used, whether annotations are done correctly or not. How many epochs number of images you have used..etc

    • @johnwhite9906
      @johnwhite9906 3 роки тому

      @@karndeepsingh Hi Karndeep. Results were obtained by 50 epochs, I would like to use 1000 epochs,

    • @karndeepsingh
      @karndeepsingh  3 роки тому +1

      Train it for 500epochs. Surely you will get better accuracy numbers.

    • @johnwhite9906
      @johnwhite9906 3 роки тому

      @@karndeepsingh Thank you.

    • @abhishekranjan2617
      @abhishekranjan2617 3 роки тому

      @@karndeepsingh sir my question is:-- how we label all the items in a dataset at once????????? Please tell me about this......

  • @shivamprajapati5823
    @shivamprajapati5823 3 роки тому

    sir I want to train 40 + new classes of objects, so i want to train my model in 4 part but i don't find the way to do it .can u help?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Train in 4 part means?

    • @abhishekranjan2617
      @abhishekranjan2617 3 роки тому

      @@karndeepsingh sir my question is:-- how we label all the items in a dataset at once????????? Please tell me about this......

  • @adeelazam5762
    @adeelazam5762 3 роки тому +1

    I always see only one weight last.pt in my test folder

  • @vedantkumar6391
    @vedantkumar6391 3 роки тому

    Trained and tested my model on colab , downloaded weights for the run. I can not do inference with @t on my local machine (set up is complete) with the same weights.

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      How you are trying to do the inference?

    • @marlonmag-isa3500
      @marlonmag-isa3500 3 роки тому

      @@karndeepsingh how did you generate the data.yml?

    • @karndeepsingh
      @karndeepsingh  3 роки тому

      Don't worry about that file. I created it manually on my local machine to just get the details of the number of classes. You can create using simple python code.

    • @vedantkumar6391
      @vedantkumar6391 3 роки тому

      @@karndeepsingh What do you mean created manually ? I have trained my model on google colab with my own data set example : python train.py --batch 16 --epochs 100 --data myconfigfile.ymal --cfg models/yolov5m.yaml --name myexpname . It worked fine on colab. I also did the inference with detect.py
      example : python detect.py --weights pathtothefolder/best.pt --source path to test images.

    • @vedantkumar6391
      @vedantkumar6391 3 роки тому

      Inference worked as well, and object were identified in almost each image. Now I have downloaded these weights to do the inference on my local machine where I have everything setup. When I run detect.py with these weights , It runs but do not generate any results on my test data. I have also pulled the latest yolov5 version.