Train YOLO-NAS - SOTA Object Detection Model - on Custom Dataset

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 มิ.ย. 2024
  • Discover the power of YOLO-NAS, Deci's next-generation object detection model, in this comprehensive guide. We'll walk you through the Python setup, installing YOLO-NAS, running inferences with the pre-trained COCO model, and even training YOLO-NAS on your custom dataset. Dive into the superior real-time object detection capabilities of this game-changing model and learn how to use it to optimize your own AI projects.
    Chapters:
    00:00 Introduction and Model Overview
    01:57 Python Environment Setup and Installing YOLO-NAS
    04:56 Inference with pre-trained COCO model
    07:21 YOLO-NAS Inference Output Format
    09:06 Finding Open-source Datasets
    10:19 Training YOLO-NAS on Custom Dataset
    16:34 Evaluate Trained Model
    17:28 Inference with Trained Model
    18:39 Conclusion
    Resources:
    🌏 Roboflow: roboflow.com
    🌌 Roboflow Universe: universe.roboflow.com
    📚 Roboflow Notebooks Repository: github.com/roboflow/notebooks
    📚 How to Train YOLO-NAS on a Custom Dataset blog post: blog.roboflow.com/yolo-nas-ho...
    📓 How to Train YOLO-NAS on a Custom Dataset notebook: colab.research.google.com/git...
    ❓ Why do we need to restart Google Colab? github.com/obss/sahi/discussi...
    🎬 YOLOv8: How to Train for Object Detection on a Custom Dataset: • YOLOv8: How to Train f...
    Stay updated with the projects I'm working on at github.com/roboflow and github.com/SkalskiP! ⭐
    Don't forget to like, comment, and subscribe for more content on AI, computer vision, and the latest technological breakthroughs! 🚀
    #YOLO_NAS #Deci #ObjectDetection #NeuralArchitectureSearch #Python #COCO #MachineLearning #ArtificialIntelligence #CustomDataset #Inference #ModelEvaluation #OpenSource #Datasets
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    error ImportError Traceback (most recent call last)
    in ()
    ----> 1 from super_gradients.training import models
    2
    3 model = models.get(MODEL_ARCH, pretrained_weights="coco").to(DEVICE)
    13 frames
    /usr/local/lib/python3.10/dist-packages/PIL/ImageFont.py in
    36 from . import Image
    37 from ._deprecate import deprecate
    ---> 38 from ._util import is_directory, is_path
    39
    40
    ImportError: cannot import name 'is_directory' from 'PIL._util' (/usr/local/lib/python3.10/dist-packages/PIL/_util.py)

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

      solution install at first !pip install --upgrade pillow==6.2.2

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

      @@elbaz_afandy ir just restart the environment :) Does that fix with pillow==6.2.2 work? I tried that and it didn't :/

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

      @@Roboflow you maybe correct, just restating is the problem solution

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

      @@elbaz_afandy I'll pin your comment. I expect others may face similar issues.

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

      restart runtime

  • @TheEBcodkings
    @TheEBcodkings ปีที่แล้ว +9

    please make a video on model selection, its a great idea!

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

      That’s what I wanted to hear 🙏🏻

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

    This tutorial is awesome I was successfully able to train the model. Also I would like to see a video on model selection too. Thank you so much for such an amazing work. ❤

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

    As someone that's just getting into this, I really like how user friendly Roboflow is. Only thing stopping me from continuing to use it unfortunately is the price point per month on top of only allowing 5,000 images per month with the paid plan. I really wish you all had 4 tiers. Free can stay the same, add the first paid plan for $100 that gives users 4K images, mid tier plan for $200 that gives users 8K images, and top tier plan for $250 that give 10K images + some extra bonuses. This is more competitive imo and would bring more people to the platform over finding cheaper alternatives that allow more freedom to try out multiple new things. I could see you guys being the top dog in this market with how easy setup is and with your TH-cam guides which are easy and fast to understand. It's that price point to image ratio that is truly killing me here.

  • @user-us2lf2kv9h
    @user-us2lf2kv9h ปีที่แล้ว +1

    best yolo NAS custom dataset tutorial , ever !

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

      Haha thanks a lot 🙏🏻! Part 2 coming soon!

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

    Thanks Peter. I just start to try it on my dataset.

  • @liliyalopez8998
    @liliyalopez8998 8 หลายเดือนก่อน +1

    Clear instructions and a very well-documented Google Colab notebook. Thank you!

    • @Roboflow
      @Roboflow  8 หลายเดือนก่อน +1

      Thanks for watching 🙏🏻

    • @ParthPatel-vi5hi
      @ParthPatel-vi5hi 7 หลายเดือนก่อน

      @@Roboflow heyy, so while i execute trainer, my session is getting crashed automatically... any solutions for that

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

    Amazing channel. I am enjoying your work a lot. Keep it up

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

      Thanks a loooot!

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

    super good video! very interested in the model selections

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

      Awesome! Thanks a lot!

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

    thank you for the video. Would be very interesting in model selection video. Thank you!

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

      Awesome! I see a lot of positive feedback for that idea.

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

    Definitely need a video on model selection

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

      hahaha working on it :D

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

    As usual 🎉🎉 Hero

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

      Thanks a lot! 🙏

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

    Yes we want a video on model selection please make it

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

      Hi, it is Peter from the video. We discussed this idea yesterday. I don't want to promise anything but it looks like we will release this video in the next 2 weeks.

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

    Hi Piotr!
    Greetings from Middle Earth. Yes please, I would like to know more on different models selection depending on use case.

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

      Looks like we will do video about it within the next 2 weeks.

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

    You should make a video on training the model. The entire process till it achieves good result

  • @user-jo2zb1rp5w
    @user-jo2zb1rp5w 11 หลายเดือนก่อน

    Great! How to resume to training process if it pauses.

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

    Is there any activation function used in YOLO NAS. If yes, which one and where can I find that information?

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

    Hi Piotr, very good video. I like also your supervision package and all the notebooks you have been publishing in roboflow.
    Just one quick question: I have trained YOLO NAS (small version) with a custom dataset. I have seen that inference (CPU) is quite slow. I mean, compared to YOLO V5 or 8 it is much slower. Have you also noticed this? Many thanks!

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

      I noticed that too. But I have not investigated that issue :/ I accidentally stumbled on that issue when I loaded the model on the CPU and not on GPU. Did you try the quantized version too?

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

    Please post the second part❤❤

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

      Hi, it is Peter from the video! 👋 I hope I will be able to give you this video.

  • @user-lu7zd4tm5w
    @user-lu7zd4tm5w ปีที่แล้ว +1

    Thanks a lot for the great work. May I ask for a video tutorial on how to port the YOLOv8 Python app to the Android platform, with people recognition through the phone's camera?

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

      If you can, please add this to the list of ideas submitted by the community: github.com/roboflow/notebooks/discussions/categories/video-ideas

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

    How to train this on 8 GPUs on DGX A100?

  • @user-qr3yi8xx5m
    @user-qr3yi8xx5m 2 หลายเดือนก่อน

    is there any need to define TensorBoard ? or it's automatically connected when model is finished ?

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

    can you explain how to train on my dataset , how to organize images and ground truth. also how i add different augmentations.

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

    Thanks for the tutorial! Is there a way to change the input dimensions? The default is (640,640) and I wanted to try out the larger size.

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

      I think u can directly pass it directly and YoloNAS will update its parameter accordingly. I am using 480*640 image size and it working great !

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

    Is it possible to connect archives in my local Notebook to googoe colab? Or you just have all in Google drive?

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

    What extension can my custom dataset have? I saw you using yolov5 as extension, is yolov8 also valid??

  • @user-ow8nz8xj1w
    @user-ow8nz8xj1w ปีที่แล้ว +1

    Thank You for awesome video, can we use any other pretrained model instead of coco? If any documentation are there please provide me.
    Thank you so much

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

      To the best of my knowledge, no.

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

    Also, my dataset images are of size not equal to 640x640 , where can I apply this in the coding?

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

    Hey, great explanation. Is there we have to annotate the testing dada too?

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

      Could you elaborate on the question?

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

      @@Roboflow hey thanks for the reply,
      I am just confused about that, we are here annotating the test data labels too.
      Then feeding to the model, then where is the learning of the model?
      How will it make predictions like yolov8?

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

    may i know how to prepare the data before do training with my own images?

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

    It's there a way we can create a real example from this? I have a football 360 video from my son playing 9v9. The idea would be to keep the focus on the ball/play using Yolo Nas. It's that even
    possible?

  • @greyyshellirl
    @greyyshellirl 10 วันที่ผ่านมา

    Does this work in detecting real time with camera? And If i can ask, how to?

  • @FahadRamzan-ri4cr
    @FahadRamzan-ri4cr 8 หลายเดือนก่อน +1

    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    super-gradients 3.3.0+master requires pyparsing==2.4.5, but you have pyparsing 2.4.7 which is incompatible.

  • @fintech1378
    @fintech1378 3 หลายเดือนก่อน

    can you cover Llava on video streaming

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

    I would like you to compare it to yolov5/v8 (better to test it on small objects). ty

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

      Hopefully, we will be able to do in one of the upcoming TH-cam videos

  • @kachaicheung9073
    @kachaicheung9073 3 หลายเดือนก่อน

    Now the model can't train the model, is the recent update problems?

  • @user-sg6tw4hx3o
    @user-sg6tw4hx3o ปีที่แล้ว +1

    hey bro can we do semantic segmentation using the new YOLO NAS model

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

      Nope. It only gives you object detection. At least for now.

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

    pls make video on model selection

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

      Looks like we will make one within the next 2 weeks. Stay tuned!

  • @user-qt7bt6wg8l
    @user-qt7bt6wg8l 3 หลายเดือนก่อน

    I don't know if u'll see the comment or not 😅, but can we use yolo nas on android for object detection. If yes, pls can you make a video on this?

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

    And one video about comparison between yoloV8 and Yolo-NAS based on Accuracy

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

      We were thinking about doing a video like that. I'm actually curious how many people would be interested.

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

    cant open the link anymore

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

    Im getting below error
    AttributeError: 'Trainer' object has no attribute 'train_loader'
    in below code
    trainer.train(model=model,
    training_params=train_params,
    train_loader=train_data,
    valid_loader=val_data)
    any reason

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

      there is a line code in the middel of the notebook import trainer I think that u miss tht

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

    If you want to detect objects like small pieces of trash/garbage, wound out use a pre-trained model or start from scratch? What are some examples for starting from scratch and using pre-trained? - with your football players, if you don’t want to detect anything else like what’s in the coco set, why use pre-trained model?
    Maybe you can cover it in your upcoming model selection video 😅

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

      do you know how to detect with pre-trained model but with excluded classes so not all classes will be detected?

  • @danielarmandovidalsoroa7787
    @danielarmandovidalsoroa7787 2 หลายเดือนก่อน +1

    For some reason, this instruction does not work anymore:
    result = list(model.predict(image, conf=0.35))[0]
    ----> 4 result = list(model.predict(image, conf=0.35))[0]
    TypeError: 'ImageDetectionPrediction' object is not iterable
    I did this instead and it worked
    result = model.predict(image, conf=0.35)
    Perhaps the output format from the model has changed during these 11 months, idk. I'm just leaving this here in case others find the same problem

    • @danielarmandovidalsoroa7787
      @danielarmandovidalsoroa7787 2 หลายเดือนก่อน +1

      Apparently the sv.Detections class has also changed over these months so this instruction does not work anymore:
      labels = [
      f"{result.class_names[class_id]} {confidence:0.2f}"
      for _, _, confidence, class_id, _
      in detections
      ]
      ValueError: too many values to unpack (expected 5)
      Instead, you have to unpack six values 👍:
      labels = [
      f"{result.class_names[class_id]} {confidence:0.2f}"
      for _, _, confidence, class_id, _, _
      in detections
      ]

    • @grecielcasi9200
      @grecielcasi9200 9 วันที่ผ่านมา

      @@danielarmandovidalsoroa7787 thank you so much for providing that information!

  • @NeuralNetwork-go5zn
    @NeuralNetwork-go5zn ปีที่แล้ว +1

    hello, really nice tutorial!
    I created a custom yolo detection with yolov8m as a base, but when I run it, as soon as the speed of the objects increases, the algorithm loses track of me and starts to "jerk" the video output. Does anyone have an idea how to fix this?
    (yolov8m algorithm trained on 300 custom images)
    Thanks so much to anyone who can help me!!

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

      Someone today reported a similar problem in the discussions tab on GitHub. Was it you?

    • @NeuralNetwork-go5zn
      @NeuralNetwork-go5zn ปีที่แล้ว +1

      @@Roboflow yes, sorry

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

      @@NeuralNetwork-go5zn I'll make sure to respond on GH as soon as possible.

    • @NeuralNetwork-go5zn
      @NeuralNetwork-go5zn ปีที่แล้ว

      @@Roboflow thank yuo!

  • @user-ts8tw8lv1p
    @user-ts8tw8lv1p 3 หลายเดือนก่อน

    where is pt file downoad

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

    part 2

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

    create yolo gui app, please

  • @user-ts8tw8lv1p
    @user-ts8tw8lv1p 3 หลายเดือนก่อน

    pt file ?

    • @Roboflow
      @Roboflow  3 หลายเดือนก่อน

      Could you be a bit more specific?

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

    Hey Piotr, could you please me?
    i want to try make object detection on pretrained YoloNasL model but i need to exclude some classes for example class person
    ///
    model = models.get(MODEL_ARCH, pretrained_weights="coco").to(DEVICE)
    image = cv2.imread(SOURCE_IMAGE_PATH)
    result = list(model.predict(image, conf=0.35))[0]
    ///
    how can i set some properties of model like class_names at give array with class names to that property?
    i checked all properties but didnt find out where or how i can exclude some yolo classes
    i would be extremely grateful if you try to help
    thanks in advance!!

  • @varunlw
    @varunlw 8 หลายเดือนก่อน +2

    Getting below error at the time of installation.
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Preparing metadata (pyproject.toml) ... done
    error: subprocess-exited-with-error
    × Building wheel for pycocotools (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    note: This error originates from a subprocess, and is likely not a problem with pip.
    Building wheel for pycocotools (pyproject.toml) ... error
    ERROR: Failed building wheel for pycocotools
    ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects

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

      Any solution for this?

    • @varunlw
      @varunlw 8 หลายเดือนก่อน +1

      install using below command, in same order
      !pip install -q roboflow
      !pip install -q supervision
      !pip install -q super-gradients@@jeanpierre4847

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

    ds = sv.Dataset.from_yolo(
    images_directory_path=f"{dataset.location}/test/images",
    annotations_directory_path=f"{dataset.location}/test/labels",
    data_yaml_path=f"{dataset.location}/data.yaml",
    force_masks=False
    ) This one is not working

    • @tomii5644
      @tomii5644 3 หลายเดือนก่อน

      ds =sv.DetectionsDataset.from_yolo(