YOLOv8: Real-Time Object Detection with Webcam

Поделиться
HTML-код
  • Опубликовано: 19 июн 2024
  • Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-nielsen.com/aicareer (PRICES WILL INCREASE SOON)
    You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
    _____________________________________________________________
    In this video 📝 we are going to Deploy a YOLOv8 Object Detection Model in Python. We will see how to deploy a trained YOLOv8 model and run live inference on a webcam. This can actually run in real-time. You can also check out my YOLOv7 Course where we cover everything from generating a dataset, setting up the model, training, and deployment.
    If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
    _____________________________________________________________
    🛠️ Freelance Work: www.nicolai-nielsen.com/nncode
    _____________________________________________________________
    💻💰🛠️ High Earner AI Career Program: www.nicolai-nielsen.com/aicareer
    ⚙️ Real-world AI Technical Courses: (www.nicos-school.com)
    📗 OpenCV GPU in Python: www.nicos-school.com/p/opencv...
    📕 YOLOv7 Object Detection: www.nicos-school.com/p/yolov7...
    📒 Transformer & Segmentation: www.nicos-school.com/p/transf...
    📙 YOLOv8 Object Tracking: www.nicos-school.com/p/yolov8...
    📘 Research Paper Implementation: www.nicos-school.com/p/resear...
    📔 CustomGPT: www.nicos-school.com/p/custom...
    _____________________________________________________________
    📞 Connect with Me:
    🌳 linktr.ee/nicolainielsen
    🌍 My Website: www.nicolai-nielsen.com/
    🤖 GitHub: github.com/niconielsen32
    👉 LinkedIn: / nicolaiai
    🐦 X/Twitter: / nielsencv_ai
    🌆 Instagram: / nicolaihoeirup
    _____________________________________________________________
    🎮 My Gear (Affiliate links):
    💻 Laptop: amzn.to/49LJkTW
    🖥️ Desktop PC:
    NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
    Intel I9-14900K: amzn.to/3W4Z5Cb
    Motherboard: amzn.to/4aR6wBC
    32GB RAM: amzn.to/3Jt2XVR
    🖥️ Monitor: amzn.to/4aLP8hh
    🖱️ Mouse: amzn.to/3W501GH
    ⌨️ Keyboard: amzn.to/3xUGz5b
    🎙️ Microphone: amzn.to/3w1F1WK
    📷 Camera: amzn.to/4b4Ryr9
    _____________________________________________________________
    Tags:
    #yolov8 #yolo #objectdetection #ultralytics
  • НаукаНаука

Комментарии • 106

  • @NicolaiAI
    @NicolaiAI  Год назад +6

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

    • @lewywaish2587
      @lewywaish2587 11 месяцев назад

      Your videos are are big inspirstion to young programmers like me,massive appreciation.

  • @tinycat5349
    @tinycat5349 4 месяца назад

    dude thanks this brought my dog back

  • @adekojoadeyemi2596
    @adekojoadeyemi2596 Год назад +7

    Is it possible to use different custom trained models in a single project with webcam. I trained a model with ASL alphabet and another models with ASL action, how can I join both models together on my live webcam project so that it can detect both alphabet and action. I am using ultralytics python library.

  • @benjaminlines6387
    @benjaminlines6387 Год назад +2

    Do you still have to install CUDA on your machine? Because somewhere I read that torch comes with its own toolkit. I kinda don't want to mess up my other projects, that are using CUDA 10.0

    • @NicolaiAI
      @NicolaiAI  Год назад

      U Can install it directly with pytorch. Think u Can use 10 as well

  • @Cam022
    @Cam022 2 месяца назад

    So I don’t need to worry about open cv from source for GPU support for this? Just need the PyTorch with GPU support?

  • @nochance7167
    @nochance7167 10 дней назад +1

    Hello, Nicolai! Very good video. How can I count and memorise in a variable the objects that the model detects and display the maximum number of the objects from a class into the console? Thank you!

    • @NicolaiAI
      @NicolaiAI  9 дней назад

      You will need to run object tracking on top of that! Thanks a lot for watching

  • @gased7317
    @gased7317 11 месяцев назад

    Can you try how many FPS would you get on TensorRT Yolov5 torch as you have RTX 4090ti? You should get at least 170fps

  • @starioa
    @starioa 11 месяцев назад +3

    How did you know that the "zero" in model.predict( source = 0 is the webcam. I want to send live camera content from an android app to the windows machine then do Real-Time Object Detection with YOLOv8 and then in the phone screen to print labels with the prediction just like 11:35 in your video. How could I do that?
    Thanks

    • @emiralkan6016
      @emiralkan6016 10 месяцев назад

      source = 0 is most of the time is the inbuilt webcam by default. About other question no idea sorry

  • @user-kg5gs8of6w
    @user-kg5gs8of6w 13 дней назад

    Is it possible to proceed with the vehicle speed estimation, which is a whole project, in real time through YOLO-World?

  • @fedorlaputin9119
    @fedorlaputin9119 Год назад

    Where can I see the full yolov8 architecture for object detection?

  • @StaMariaRock
    @StaMariaRock Год назад +3

    Nice video, I'm struggling like hell to install this yolo in anaconda with GPU, I'm following all the steps but is running on CPU, can you do a video about it?
    I'm trying to train a model, but the torch is picking my CPU

    • @NicolaiAI
      @NicolaiAI  Год назад +2

      I’d just uninstall torch, torch vision and install the gpu version

    • @StaMariaRock
      @StaMariaRock Год назад

      @@NicolaiAI yeah! you were right, I uninstall torch and torchvision, reinstalled with the pip (the conda seems like is not working well) and after it I run conda update --all and done, is working now
      Amazing advice! thanks so much

  • @Tolazytoedit435
    @Tolazytoedit435 5 месяцев назад

    I want to classify different classes like types of cars model how can i achieved it?

  • @vovvas6490
    @vovvas6490 3 месяца назад

    If I am trying to use yolo8 and opencv to show bbox of the objects the video starts to run in a slow motion. Any ideas why it's happening?

  • @zrlcproject
    @zrlcproject 9 месяцев назад

    why when I try with the yolov8n model the fps drops and touches 15 ms?

  • @FBal28
    @FBal28 Год назад +2

    Just wanted to mention I had to change print(results) to print(*results) to make this work. otherwise it just took a single picture and quit.
    Also, what specs are you running on? I'm getting around 80ms per frame

    • @NicolaiAI
      @NicolaiAI  Год назад +1

      Thanks for the tip! Im running on a Rtx 4090. Make sure u are on gpu if u have that

    • @FBal28
      @FBal28 Год назад

      ​@@NicolaiAI Yep, looks adding device='mpu' as an argument to model.predict is needed for mac users. Unfortunately, they haven't finished adding support for it, so mac users are stuck with cpu for now

    • @NicolaiAI
      @NicolaiAI  Год назад

      @@yyyuyu-je9mo in my tracking video I go over how to extract the results

    • @yyyuyu-je9mo
      @yyyuyu-je9mo Год назад +1

      @@NicolaiAI im watching it rn, thank you for the tutorials

    • @NicolaiAI
      @NicolaiAI  Год назад

      @@yyyuyu-je9mo thanks a lot for watching!

  • @maiquelkappel7745
    @maiquelkappel7745 Год назад +2

    Congratulations on the job. Can you make a video of yolov8, mss and numpay, capturing the image directly from the monitor screen?

    • @morttthewart7134
      @morttthewart7134 9 месяцев назад

      did you ever get an answer to this?

    • @ditya.aditya16
      @ditya.aditya16 9 месяцев назад

      I am waiting for a solution to this question

    • @tonaarea-js3fd
      @tonaarea-js3fd 9 месяцев назад

      @@ditya.aditya16 yes

    • @tonaarea-js3fd
      @tonaarea-js3fd 9 месяцев назад

      @@morttthewart7134 I GOT TO DEVELOP.

  • @ArumugaTamilSelvan
    @ArumugaTamilSelvan 3 месяца назад +2

    1000th like...❤

    • @NicolaiAI
      @NicolaiAI  3 месяца назад +1

      Wow what a milestone! Thanks for watching. Never thought this was a possibility when I made the video

  • @badaldesai3743
    @badaldesai3743 Год назад +1

    Can we detect distance between two different classes using Yolo v8. I mean (dist. btw a human and chair) ?

    • @NicolaiAI
      @NicolaiAI  Год назад

      Only relative distance in the frame ynkes u have 3D information

  • @mohammadhaadiakhter2869
    @mohammadhaadiakhter2869 Год назад +1

    Can you please make a video on making a yolov8 model for custom dataset please?

    • @NicolaiAI
      @NicolaiAI  Год назад +1

      I already did that with instance segmentation and will upload a video today with custom object detection

  • @BimaAgungSaputra-gt4px
    @BimaAgungSaputra-gt4px 4 месяца назад +2

    hi! good tutorials btw. im new using yolo model, when i run your code in my machine it said "import ultralytucs.yolo.v8.detect.predict could not be resolved". am i missing a step here? because i already installed ultralytics and opencv libraries, or maybe i have to install another libraries? thanks in advance

    • @AI_mod
      @AI_mod 2 месяца назад

      try from ultralytics.models.yolo.detect import DetectionPredictor

  • @TravelwithRasel.
    @TravelwithRasel. Месяц назад

    results = model.predict(source="0", show=True) # accepts all formats - img/folder/vid. - what would be the rest of part?

  • @rajands65
    @rajands65 9 месяцев назад +2

    where can i get the code for this

  • @fahadzhossain
    @fahadzhossain 4 месяца назад +6

    Hi. this video is great. I have trained a model. I installed ultralytics using pip but when I run the code in visual studio for prediction it is showing
    "from ultralytics.yolo.v8.detect.predict import DetectionPredictor
    ModuleNotFoundError: No module named 'ultralytics.yolo' " Please help me with this

    • @supapholkodtom517
      @supapholkodtom517 3 месяца назад +1

      Maybe have use with miniconda3 and create virtual environment(option)

    • @janbartos7863
      @janbartos7863 29 дней назад

      Had the same issue, and found out you don't need the line completely, so just delete it or comment it out and you'll be good.

  • @houdabekkourialami3581
    @houdabekkourialami3581 4 месяца назад

    I have a problem. When i run the vscode script i get the results printed in the terminal but the webcam isn't displayed. What can be the source of the problem? Knowing that my webcam works fine (when i execute the cv2.imshow() it's displayed)

    • @saudiorchestra6443
      @saudiorchestra6443 2 месяца назад

      I have the same issue on Windows. I have set show=True, but still nothing. But, I noticed that I am getting this error:
      cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1272: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'
      so, I ran these and it fixed it:
      pip uninstall opencv-python opencv-python-headless
      pip install opencv-python

  • @ToezzyTV
    @ToezzyTV Год назад +1

    Hello I just have a question how to retrieve the processing times per image that are displayed in the terminal on yolov8?

  • @benjaminlines6387
    @benjaminlines6387 Год назад +2

    In the results... should be a tensor, right? Because in older versions you could do:
    results = model("image.png")
    And in the results would be your bounding box data. Now it tells me that there are 2 persons and 1 tie in that image (and it's also correctly saved in predict folder) but if im trying to print the result it prints none. Is there some extra method of getting results? Not working with camera right now, just an static image.

    • @NicolaiAI
      @NicolaiAI  Год назад +1

      U can check out my new video with tracking. Then u can see how to extract the information

    • @andyhayes2018
      @andyhayes2018 Год назад

      I specifically have a YOLOG model I’m interested in networking with knowledgeable CSI guys

  • @user-ht7qy8bh6z
    @user-ht7qy8bh6z 8 месяцев назад

    @NicolaiNielsen
    how to implement 2nd stage classifier after detection in yolov8
    Thank you

    • @harshans7712
      @harshans7712 3 месяца назад

      I too have the same doubt

  • @divyejoshi1348
    @divyejoshi1348 Год назад +1

    Hey ! I have used yolo v8 with my rtx 3050 and I am getting good training and predictions on the coco128 dataset
    BUT the problem arises when I try to use a custom dataset, the training goes well, but when I see predictions it just gives the same image with no bounding boxes. The labels are correctly placed because it gives the bounding boxes for the already defined labels, but not any for predicted ones . Any solutions ?

    • @gongallateja5969
      @gongallateja5969 3 месяца назад

      hey could you send me the zip file of the github repository which would be helpful for my project

  • @TheLordOfWolves
    @TheLordOfWolves Год назад +1

    What version of pytorch and cuda toolkit are you using ?

  • @cesarriat
    @cesarriat Год назад +1

    how do you change the size, there are different webcams and with different resolutions, not all of them are 640. Like when an .mp4 video is processed?

    • @NicolaiAI
      @NicolaiAI  Год назад

      I think u can specify it as an argument. But it also preprocesses the image before hand and resizes the images

    • @houdabekkourialami3581
      @houdabekkourialami3581 4 месяца назад

      Hi. I know i'm late but for other people who need this, y'all can check another video tutorial called "yolov8 object counting in real-time with webcam" from roboflow

  • @lphonehacks
    @lphonehacks 24 дня назад

    getting a syntax error at step 1.. anyone knows how to fix?

  • @moahaimen
    @moahaimen 11 месяцев назад

    i need to do the same for a youtube video , ,my problem detection happens but i need to show the video it doesnt exist

  • @Adilkhan0
    @Adilkhan0 Год назад

    I have trained my custom model but I'm facing an issue, how to add easyocr for licensee plate recognition in real-time, please help I'm having a really hard time with it

    • @maddestruction1
      @maddestruction1 3 месяца назад

      Did you figure out how to do it? I also need to extract license plate numbers in real-time using easyOCR. I’d appreciate any help.

  • @jupiterjs031
    @jupiterjs031 Год назад +1

    hi
    Can't I get class id or name detected in object detection?
    For example, I want to write python code that sends an alert mail when a person is detected.

    • @NicolaiAI
      @NicolaiAI  Год назад +1

      U can import the model as in my yolov7 course. In that course I show different ways how to deploy the models and extract the information

    • @user-so9en8wz5b
      @user-so9en8wz5b Год назад

      혹시 해결하셨나요?
      저도 class이름 가져와서 감지된 class name에 따라 gpio제어할려고 해서요..

  • @Yogeshyadav-ks9tq
    @Yogeshyadav-ks9tq Год назад +1

    can you please share your system configuration for Realtime detection

    • @NicolaiAI
      @NicolaiAI  Год назад

      I’m running this on a Rtx 4090. But it can run real-time with way lower end hardware

  • @lobnaahmed-wb8cg
    @lobnaahmed-wb8cg 2 месяца назад

    can you send the link of the repo plz

  • @abeltamikasetiarini2469
    @abeltamikasetiarini2469 Год назад +2

    how to script to display the number of each class on the camera screen?

    • @NicolaiAI
      @NicolaiAI  Год назад

      I show that in the tracking video on my channel

  • @ToryHwang
    @ToryHwang Год назад +1

    How do I get the full source of real-time object detection of camera images using YoLo8?

    • @NicolaiAI
      @NicolaiAI  Год назад

      U Can check out my latest Yolov8 video

  • @user-nn7dk2my1w
    @user-nn7dk2my1w 4 месяца назад +1

    Что то ты не договариваешь покажи полный код где строчка которая запускает камеру?

  • @user-sp6iy5kn4e
    @user-sp6iy5kn4e 10 месяцев назад

    how to get those tensor data 12:23

  • @alfibima4247
    @alfibima4247 Год назад +1

    I'm trying YOLOv8 to detect live video streaming on RUclips. but the speed is very slow. how to boost the speed so that object detection can be realtime? I use GTX 1650 GPU

    • @NicolaiAI
      @NicolaiAI  Год назад

      Try to use google colab instead

  • @aoeu256
    @aoeu256 3 месяца назад

    I want to use this to build a language immersion environment to learn Chinese.
    我想用这个来搭建一个语言沉浸式环境来学习中文。
    Is there a way that not only shows "person" but also the parts that make up the person, but also in very small fonts, such as hands eyes, nose, mouth. On “monitor” it will be able to detect text, windows, buttons etc... My program will also show some related words like verb (like it will say eat with food), classification (tool),
    有没有一种方法,不仅可以显示“人”,还可以显示构成人的各个部分,而且还可以用很小的字体,例如手、眼睛、鼻子、嘴巴。在“监视器”上,它将能够检测文本、窗口、按钮等...我的程序还将显示一些相关的单词,例如动词(就像它会说与食物一起吃)、分类(工具)、

  • @MuhammadHussain-ws1xs
    @MuhammadHussain-ws1xs Год назад +1

    the webcam doesn't turn on for me but i can see the predictions in the terminal, any idea?

    • @NicolaiAI
      @NicolaiAI  Год назад

      Do u set show = true?

    • @fitshake5380
      @fitshake5380 Год назад

      Same for me. Any solution for it? Even I have put show = true

  • @EgeSener
    @EgeSener Год назад +1

    hello my model working much slower than yours. What can i add to this code ?

    • @NicolaiAI
      @NicolaiAI  Год назад

      Have u tried with one of the smaller models and are u running on a gpu? Just remember that I’m running this on a Rtx 4090 so not comparable for most

  • @ishankamadhuranga3729
    @ishankamadhuranga3729 Год назад +1

    Can you show how to predict movement of object or give me idea how to do that

    • @NicolaiAI
      @NicolaiAI  Год назад

      U Can get more information about that in the tracking video I have with Yolov8

  • @user-so9en8wz5b
    @user-so9en8wz5b Год назад +1

    The results function stores class names, and I need that information Can't class information be extracted during real-time object detection?

    • @NicolaiAI
      @NicolaiAI  Год назад

      Yeah I have a video here on the channel where I implement a custom function

    • @user-so9en8wz5b
      @user-so9en8wz5b Год назад +1

      @@NicolaiAI Thank you for your answer! If possible, can I know the RUclips link or title containing the content?

    • @NicolaiAI
      @NicolaiAI  Год назад

      Simple YOLOv8 Class for Object Detection with Webcam in Real-time
      ruclips.net/video/O9Jbdy5xOow/видео.html

    • @user-so9en8wz5b
      @user-so9en8wz5b Год назад +1

      @@NicolaiAI Thanks!!!

  • @snoppjonte
    @snoppjonte 10 месяцев назад +1

    how do you terminate the stream without using ctrl+c?

    • @NicolaiAI
      @NicolaiAI  10 месяцев назад

      U Can check for key presses with opencv as I do in the bottom of the while loop. Then u will terminate and release resources

    • @snoppjonte
      @snoppjonte 9 месяцев назад

      @@NicolaiAI What while loop? The code (test.py) that you show only have like 3 imports and 3 lines of code.

  • @HavokBWR
    @HavokBWR 11 месяцев назад

    Would this software be able to track an object in 3d space? Say if you had an AR/VR environment and you wanted to track the position of objects in the room that might get moved around?

  • @winnuayi3266
    @winnuayi3266 4 месяца назад

    I've tried computer vision application using RTX 3060 12GB. The GPU can only run object detection on 3 CCTVs. I wonder how many CCTVs RTX 4090 24 GB can handle?

    • @harshans7712
      @harshans7712 3 месяца назад

      What is the resolution of the cctv camera's video?

    • @winnuayi
      @winnuayi 3 месяца назад

      @@harshans7712 we used resolution at 360p. Around 30fps for each cctv. The inferenced streaming videos are displayed in the web at the same time.

  • @yaminipandranki339
    @yaminipandranki339 6 месяцев назад

    Can you please provide the code for wild animal detection using yolo .
    And if possible can you please provide source code for this project