Simple YOLOv8 Class for Object Detection with Webcam in Real-time

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

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

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

    Join My AI Career Program
    www.nicolai-nielsen.com/aicareer
    Enroll in My School and Technical Courses
    www.nicos-school.com

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

    where is the code can you share me the git link of your repo
    pls

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

    The following error comes up:
    ValueError: too many values to unpack (expected 4)
    It is in the following lines:
    self.labels = [f"{self.CLASS_NAMES_DICT[class_id]} {confidence:0.2f}"
    for _, confidence, class_id, tracker_id
    in detections]

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

      hi did it get solved or not. Because it also gives me same value error . please help if you solve this error

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

      Same error

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

      Try to make this change , it solved the problem for me
      Just add another '_' after 'for'
      self.labels = [f"{self.CLASS_NAMES_DICT[class_id]} {confidence:0.2f}"
      for _,_, confidence, class_id, tracker_id
      in detections]

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

    Hello, thank for your video
    But i have a problem:
    from supervision.tools.detections import Detections, BoxAnnotator
    ModuleNotFoundError: No module named 'supervision.tools'
    Can you fix it? Thank you, have a nice day!

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

      Hi Thanks for watching! Did u pip install supervision?

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

      @@NicolaiAI Yupp, i installed it, But it still error

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

      @@NicolaiAI In my supervision library there is no "tool" module but there is still "draw" module, I don't understand why

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

      same problem

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

      @@adrianknutsen i fixed it, please remove "supervision" version 0.2.0 and install "supervision" version 0.10

  • @hamidrezakarami4664
    @hamidrezakarami4664 19 วันที่ผ่านมา

    speak slowly ... be indian

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

    Thanks for that Video, it's really helpful.
    if possible, can you share the name of your chair plz😅.

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

      Thanks a lot for watching! My chair in the background is from IKEA and my Office chair is a Herman Miller embody

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

    Thank you, it’s so clear and detail.

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

      Glad you like it! Thanks for watching

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

    Great video. However I wonder how to get a very smoothly output. I have tried multithreading however the output is a bit of choppy. Not tottaly smooth. Do you have any solution on that

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

      Thanks! Are u thinking about tracking? I have a course about that with yolov8

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

    Hi, I would like to know how to count the amount of detected object per class. Is this possible? I could only get the amount of all the detected objects.

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

      U could have a list with all the counters and then increment the index in that list based on the label’s index

  • @a.a.ardebili7433
    @a.a.ardebili7433 ปีที่แล้ว +1

    Thank you for the video. How I can set a filter to detect and draw BBox ONLY for "Person"? Is it possible to set up an area in the video frame the detector detects the objects only in that area?

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

      Thanks a lot for watching! Yeah u can just crop out your region of interest. And if u check for index 0 in the classes it corresponds to a person. I have another video here on the channel where I implement Yolov8 in a class for person detection

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

    Great Video! But I unfortunately had an error occurred, "TypeError: unsupported format string passed to list.__format__". Any idea on how to fix this?

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

      In what line do u get the error?

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

      @@NicolaiAI Nevermind, got it fixed! Keep up the great work though! Your course on YOLO v8 must be really in depth if you can afford to teach us this for free!

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

      @@mystuff6071 there is also some theory in the course and how to do everything from scratch. Also different ways to deploy the model

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

    If I only want to display bboxes with confidence >0.5 where Can I do this in the code? Great video!!

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

      U Can basically just have an if statment checking the confidence score and then only visualize or store if greater than threshold

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

      @@NicolaiAI Hey, I couldn't implement said statement into your code. Is there any way you can help?

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

      @@NicolaiAI In which method should this if statement be made please? Cannot understand a way where to put this statement.

  • @al-musbahitechnology5766
    @al-musbahitechnology5766 9 หลายเดือนก่อน

    Thank you, you helped me a lot, but I still have a problem. I trained a model to recognize license plates. It identified them, but I also want it to print the number of the car that it identified. Can you explain this method?

  • @左逸豪
    @左逸豪 ปีที่แล้ว

    I want to transfer the names of the detection objects in yolov8's real time analysis to the mobile application in real time via websocket, how do I do that?

  • @JasonKim-yz8rv
    @JasonKim-yz8rv ปีที่แล้ว +1

    Can YOLOv8 perform instance segmentation in real-time?

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

      Yeah for sure! I actually have a video about that aswell. Even for a custom dataset

    • @JasonKim-yz8rv
      @JasonKim-yz8rv ปีที่แล้ว +1

      @@NicolaiAI Wow... I found it. That's brilliant!!!

    • @JasonKim-yz8rv
      @JasonKim-yz8rv ปีที่แล้ว

      th-cam.com/video/4iRFGjNtzNo/w-d-xo.html

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

      @@JasonKim-yz8rv great to hear! Hope u can use it

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

    Can this implement in raspberry pi? Will this makes the fps drops?

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

    it says there is no modele named supervision help!

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

      Did u pip install it?

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

      @@NicolaiAI thankss

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

      After pip installing. It says there us no module named supervision.tools

    • @TechAirSpace
      @TechAirSpace 6 หลายเดือนก่อน

      @@yaseenpk1739 Did you figure this out? I'm getting the same error.

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

    Congratulations on the video. Could you make a video like this, but using monitor screen?

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

    Hi, I have the next error: ColorPalette.__init__() missing 1 required positional argument: 'colors'. Any idea?

    • @Nourhan-jw8iv
      @Nourhan-jw8iv 6 หลายเดือนก่อน

      Did u know how to fix this error

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

      Has this error. Use 'sv.ColorPalette.default()' instead.

  • @붓따-b3f
    @붓따-b3f ปีที่แล้ว

    I came here after seeing your comment link.
    I'm trying to load my trained best.onnx file. However, I'm getting the following error:
    return self._sess.run(output_names, input_feed, run_options)
    onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: images for the following indices
    index: 2 Got: 640 Expected: 320
    index: 3 Got: 640 Expected: 320
    Please fix either the inputs or the model.
    I tried adding self.img_size = (320, 320) in __init__ and modifying the predict method as follows:
    def predict(self, frame):
    frame = cv2.resize(frame, self.img_size)
    results = self.model(frame)
    return results
    But I still encounter the same error. Is there any specific reason for this?

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

      U are trying to use onnx with PyTorch. U can’t really do that since onnx is a whole another framework. In my yolov7 course I go over how to use custom trained yolo models with onnx framework

    • @붓따-b3f
      @붓따-b3f ปีที่แล้ว +1

      @@NicolaiAI th-cam.com/video/UNVIZBK45kk/w-d-xo.html
      Is the video in question correct?
      Thank you for your prompt response!

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

      Yeah that’s the course I’m talking about. Then u can do inference with ONNX

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

    How can we print the objecct detected?

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

    Thank you so much, this is really helpful and well explained.

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

      Glad it was helpful! Thanks for watching

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

    why do you have two cameras.

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

      Some people might find it interesting to see how it is behind the scenes

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

    Hi, I got ValueError: too many values to unpack (expected 4) on line 68

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

      Hi, did you solve this problem?

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

      Same error

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

      Try to make this change , it solved the problem for me
      Just add another '_' after 'for'
      self.labels = [f"{self.CLASS_NAMES_DICT[class_id]} {confidence:0.2f}"
      for _,_, confidence, class_id, tracker_id
      in detections]