Track & Count Objects using YOLOv8 ByteTrack & Supervision

Поділитися
Вставка
  • Опубліковано 31 тра 2024
  • Let's build together an application to track and count objects using Computer Vision. We used YOLOv8 for detection, ByteTrack for tracking, and the latest python library from Roboflow - Supervision for object counting.
    Chapters:
    0:00 Introduction
    1:28 Setting up the Python environment for vehicle tracking
    5:28 Using YOLOv8 for vehicle detection
    6:27 Building custom inference pipeline with Supervision for a single image
    12:37 Building custom inference pipeline with Supervision for a whole video
    15:46 Tracking detections with ByteTrack
    17:40 Counting objects crossing the line with Supervision
    19:29 Training YOLOv8 Object Detection model on custom dataset
    22:50 Detect, track, and count candies on the conveyor
    25:50 Conclusion
    Resources:
    🌏 Roboflow: roboflow.com
    🌌 Roboflow Universe: universe.roboflow.com
    ⭐ Supervision repository: github.com/roboflow/supervision
    📝 Track and Count with YOLOv8 Blogpost: blog.roboflow.com/yolov8-trac...
    📓 Track and Count Vehicles with YOLOv8 + ByteTRACK + Supervision Notebook: colab.research.google.com/git...
    📓How to Train YOLOv8 Object Detection on a Custom Dataset Notebook: colab.research.google.com/git...
    🎬 Count People in Zone | 3 Models: YOLOv5, YOLOv8 and Detectron2: • Count People in Zone |...
    🎬 YOLOv8 Object Counting in Real-time with Webcam, OpenCV and Supervision: • YOLOv8 Object Counting...
    🎬 YOLOv8: How to Train for Object Detection on a Custom Dataset: • YOLOv8: How to Train f...
    🎬 Instance Segmentation in 12 minutes with YOLOv8 and Python: • Instance Segmentation ...
    📓 Learn more about YOLOv8 and other Computer Vision models with Roboflow Notebooks: github.com/roboflow/notebooks
    Stay updated with the projects I'm working on at github.com/roboflow and github.com/SkalskiP! ⭐
  • Наука та технологія

КОМЕНТАРІ • 349

  • @omoyeyeemmanuel4238
    @omoyeyeemmanuel4238 2 місяці тому +5

    your code comes with the error of numpy between float, int and double

    • @Roboflow
      @Roboflow  2 місяці тому +5

      I recommend using updated version of the notebook: colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-track-and-count-vehicles-with-yolov8-and-supervison.ipynb

    • @MOG_Emmanuel
      @MOG_Emmanuel 2 місяці тому

      thanks
      @@Roboflow

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

      @@Roboflow Does that notebook solve the error? Thank you!

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

      Is there any other updated notebook because this one is also throwing some error

    • @Nasarae
      @Nasarae 10 днів тому

      ​@@mariacaleropereira2967 The notebook works perfectly :)

  • @user-xn2np9md1d
    @user-xn2np9md1d Рік тому +8

    The best and complete tutorial for implementing YOLOV8 based object detection, tracking and counting system. Love it brother

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

      That’s what I strived for! Great to hear you liked it so much 🔥

    • @ashishreddy2634
      @ashishreddy2634 5 місяців тому

      How can I count the bounding boxes for a set of images ( not a video) in this case ( using a pre trained yolov8 model with only 1 class)

    • @user-xn2np9md1d
      @user-xn2np9md1d 7 днів тому

      ​@@ashishreddy2634 Are you trying to detect specific class?

  • @MrCantyousea
    @MrCantyousea Рік тому +12

    Always best contexts with very clear explanations... You are perfect bro !

  • @ditya3548
    @ditya3548 7 місяців тому +5

    26 minutes for this is not long at all. Thank you for what you do and please don't hesitate to make longer videos, however you see fit.

    • @Roboflow
      @Roboflow  7 місяців тому +1

      My pleasure!

    • @katanshin
      @katanshin 7 місяців тому

      It goes to show how streamlined this stuff has become. Try doing a PhD in this ten years ago and having to write your own code for everything AND the novel parts you're working on. Takes months and hours to explain. Now anyone can git clone and run complex models. What a world :)

    • @ditya3548
      @ditya3548 7 місяців тому

      @@katanshin Truly!

  • @aaron1uk
    @aaron1uk Рік тому +2

    Fantastic tutorial, playing around with plenty of the options here, thanks for the upload.

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

      Hi it is Peter from the video 👋Thanks a lot! Let us know what other feature could be useful ;)

  • @bramantyowikantyoso1
    @bramantyowikantyoso1 4 місяці тому

    Thank you so much.. I have Zero experience on this matter but following each of your instruction and I did finish my project with my own video.. Super!

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 9 місяців тому +1

    Thank you brothers, for your work!

  • @ogunserifonargan191
    @ogunserifonargan191 5 місяців тому

    TY for your great work on supervision library. I have modified your line counting algorithm. During counting people from indoor cctv camera, lines stay short to meet counting conditions. Firstly, I tried center dot instead of corners of bb, but it become unstable, especially when a person pass from door, because center of rectangle become unstable while object slowly disappear. Finally, I draw a square at center of object. It fits my case and generate stable countings.

  • @Aron-0-1
    @Aron-0-1 4 місяці тому +1

    You deserve more subscribers and likes ! Cool guy and straightforward 💛

    • @Roboflow
      @Roboflow  4 місяці тому

      I hope we will get 50k subs this year! 🤞🏻

    • @Aron-0-1
      @Aron-0-1 4 місяці тому

      @@Roboflow Guys show your love for this dedicated Gentleman by subscribing and liking his content.

  • @djaadiabdellah9081
    @djaadiabdellah9081 3 місяці тому

    Just wow!
    Thank you for this great content.

  • @EastAfrica_Vehicle_Importers
    @EastAfrica_Vehicle_Importers 8 місяців тому +1

    i love how u explain the tuitorial so awesome,thanks

    • @Roboflow
      @Roboflow  8 місяців тому

      This is so nice to hear. Make sure to try Supervision if you like the tutorial.

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

    Awesome awesome awesome! Thank you for the excellent work

  • @leenaltwayan4004
    @leenaltwayan4004 Рік тому +4

    Great video! However I tried implementing it with more than one counter (one for each lane) but it seems that LineCounter is a global variable shared across all other lanes. is there a way to overcome this?
    Thank you!

  • @jeannecmoi
    @jeannecmoi 4 місяці тому

    Hi, does the tracking work if the object changes class as time goes? For example for the football field dataset if my labels were "player static" and "player running" would the tracking be able to follow the same player as it changes states? Thank you!

  • @tomaszbazelczuk4987
    @tomaszbazelczuk4987 Рік тому +2

    really good staff!!!

  • @m.tsaqifwismadi4625
    @m.tsaqifwismadi4625 Рік тому

    Great one! very thorough well explained

  • @sowmiyar6505
    @sowmiyar6505 9 місяців тому +1

    Thankyou so much. The explanation was in-depth.

    • @Roboflow
      @Roboflow  8 місяців тому +2

      My pleasure!

    • @sowmiyar6505
      @sowmiyar6505 8 місяців тому

      @@Roboflow by adjusting some resolution and having perfect line counter position,your code is doing great in real-time. 👍

  • @akhileshsharma5067
    @akhileshsharma5067 3 місяці тому +2

    Hello Piotr @roboflow, thank you for the video. I have trained my model on 3 different classes.Would it be possible to have the line zone annotator display the count of each class separately rather than the sum of detections of all classes? Can you please help with this?

  • @madeshprasadc2551
    @madeshprasadc2551 Рік тому +1

    Thank you for this tutorial, it helps us a lot

    • @Roboflow
      @Roboflow  Рік тому +1

      This is great to hear! 💜 I was hoping for such a positive feedback

  • @SkiLLFace360
    @SkiLLFace360 Рік тому +2

    I really enjoyed the last episodes, very well and comprehensibly explained! Thanks!
    Would it be possible to make a video about rotated object detection in YOLOv8? Would be very useful.

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

      Hi, it is Peter from video! Thanks from kind words. It means a lot to me. Is YOLOv8 capable of rotated object detection?

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

      @@SkalskiP Hm you are probably right, rotated detection doesn't exist yet.
      Thought I just overlooked it..
      Thanks for the answer!

    • @SkalskiP
      @SkalskiP Рік тому +1

      @@SkiLLFace360 no worries it is kind of my job to know it ;)

  • @gnavarrolema
    @gnavarrolema Рік тому +1

    Great video tutorial. Thank you!!!

  • @harqilamiga80
    @harqilamiga80 6 місяців тому

    hi. can i make a box instead of line, referencing on 17:40? so i want to count an object if that object staying in that box for milliseconds

  • @user-oo1ll9fk6o
    @user-oo1ll9fk6o 7 місяців тому

    Could you help with what each of the ByteTrackerArgs are for? I mean track_thresh, track_buffer and so on

  • @evanshlom1
    @evanshlom1 11 місяців тому

    You have touched my soul

  • @mvcko5296
    @mvcko5296 8 місяців тому +1

    Is there any easy way to count objects on pre predicted images? And print results in termina. I have a problem with find solution in internet.

  • @user-firebender
    @user-firebender 4 місяці тому

    how can i edit the in and out line (name/label), i want ti only detect in
    and how i adjust the script to immedietely ipdate the count when the object enter the scanning line and so it wonr't recount the object that already ?

  • @cristianespana4253
    @cristianespana4253 2 місяці тому +4

    Hola tengo el error en la parte del código : tracks = byte_tracker.update( output_results=detections2boxes(detections=detections), img_info=frame.shape, img_size=frame.shape ) ;sale este error: AttributeError: module 'numpy' has no attribute 'float' ;pueden ayudar porfavor

    • @manuelnavarrete4509
      @manuelnavarrete4509 2 місяці тому

      Tengo el mismo error, pudiste solucionarlo?

    • @cristianespana4253
      @cristianespana4253 2 місяці тому

      @@manuelnavarrete4509 si ..antes de ejecutar el código agrega esta línea : !pip install -U numpy==1.23.5 ;después te pedirá reiniciar la sesión ,vuelves a ejecutar el código ya sin volver a instalar el numpy y listo

  • @davidavitan9916
    @davidavitan9916 11 місяців тому

    I am interested in running this algorithm in pycharm and with the YOLO model that I built and trained myself and not run the algorithm from a notebook.
    Is it possible to get a customized py file?

  • @nehabhadu4977
    @nehabhadu4977 5 місяців тому

    For classification into car, bus, truck and motorcycle which one is used ByteTrack or Supervision?
    Additionally, is Bytetrack also used for counting along with tracking? Because supervision is used for annotations.

  • @tsaqilabelaaskarina908
    @tsaqilabelaaskarina908 6 місяців тому

    hello, can i use the supervision to count object on yolov5? i have an existing onnx model

  • @KK-ws9rh
    @KK-ws9rh 6 місяців тому

    Thanks! I'm still a beginner, so this is very confusing. So I have one question: I can't use 'best.pt', the model trained with yolov7, in this tutorial, right?

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

    How to check its performance because we always need accuracy, precision and other metrices to find the performance of the model ?, Do I need to annotate first then calculate the accuracy?

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

    Can you please tell me how to calculate the overall accuracy(SHOWING mAP score) of the particular trained yolov7 model in Google colab?

  • @MrT12359
    @MrT12359 8 місяців тому +1

    Excellent video 👌

    • @Roboflow
      @Roboflow  8 місяців тому +1

      Thanks a lot! 🙏🏻 make sure to try Supervision!

  • @nabi9214
    @nabi9214 7 місяців тому

    thank you for the tutorial, very easy to understand! I have a question, how do I get the CSV file result to find out the coordinates of the bounding box?

  • @robertolrjg
    @robertolrjg 4 місяці тому

    so useful, thanks a lot

  • @beachbotdxb
    @beachbotdxb 11 місяців тому

    Hello how would I be able to print the values from the counter to a txt. file. I tried the following code but I am unable to obtain the count from the line_counter: with open("output.txt", "w") as file:
    # Print the variable into the file
    print(line_counter, file=file)

  • @nithinhs7231
    @nithinhs7231 Рік тому +3

    Classical... What a topic.. thanks..

    • @SkalskiP
      @SkalskiP Рік тому +1

      No. Thank you for watching! ;)

    • @shukkkursabzaliev1730
      @shukkkursabzaliev1730 Рік тому +1

      @@SkalskiP As always amazing job! One problem I am facing inside match_detections_with_tracks function, when the object is not in frame and model return emtpy list this line gives error iou = box_iou_batch(tracks_boxes, detection_boxes)
      How can I solve it?

    • @SkalskiP
      @SkalskiP Рік тому +1

      @@shukkkursabzaliev1730 oh, that code is far from being bullet proof. Would you like me to update notebook to work for those use-cases?

  • @RayVargas-be8tf
    @RayVargas-be8tf 2 місяці тому

    Tengo problemas con numpy en la parte del tqdm, y ya cambie los np.float por float y aun asi el problema persiste

  • @rafael.gildin
    @rafael.gildin 8 місяців тому +1

    Great video, thanks a lot

    • @Roboflow
      @Roboflow  8 місяців тому

      My pleasure!

  • @luisdavidviverosescamilla201
    @luisdavidviverosescamilla201 10 днів тому

    Is there any other updated notebook because this one is also throwing some error ?

  • @mohammadhaadiakhter2869
    @mohammadhaadiakhter2869 8 місяців тому

    Is there any change that I can make to detect the speed of the vehicles. I used two lines, and took a random value for the distance between those two lines. Now the problem is I am not able to understand how to use 'time' library to extract the time for the vehicles going up the lane and down the lane between the two lines. Can please anyone help me with that?

  • @ItzMapJr
    @ItzMapJr 7 місяців тому

    I have followed the code provided and the program runs well as shown in the video. If I want to count vehicles according to each class, such as the number of motorbikes and the number of cars. How and which parts should I change in the code? Thank you

  • @wayneqwele8847
    @wayneqwele8847 8 місяців тому

    this is awesome!

  • @Bhai-zf1xi
    @Bhai-zf1xi 2 місяці тому

    Hiw can i get the count of in and out vehicles in one var only . I just want the whole count . Is it possible??

  • @body1024
    @body1024 Рік тому +2

    thank you
    very helpful

    • @Roboflow
      @Roboflow  Рік тому +1

      That's what I wanted to hear!

  • @hankling8963
    @hankling8963 Рік тому +1

    Nice job ! love from china❤

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

      Hi, it is Peter from the video! Thanks a looot! Love from Poland.

  • @AIEasySolutions
    @AIEasySolutions 9 днів тому

    Thank you very much, really appreciate! I applied to my custom video, it does not count correctly. I saw in your video it also does not count correctly, how we can improve it?

  • @luisdavidviverosescamilla201
    @luisdavidviverosescamilla201 8 місяців тому

    Hi I have other question. Is it possible in the moment when the byteTrack algorithm count the candy or the car or bus or any other object is possible that the algorithm classify per class the counting for example if 4 cars pass the line in the video show how many cars pass the lines and show other count for buses and other for motorcycles is it possible for bytetrack?

    • @Roboflow
      @Roboflow  7 місяців тому

      ByteTrack is only responsible for tracking. The counting is done by line logic. Right now it is possible but you would need a separate line for every class. You don’t need to draw all of those line. But you would need LineZone object to perform the actual counting

  • @danushkabandara
    @danushkabandara Рік тому +2

    thanks for the video. I noticed that even with a clear view of all the vehicles, you still lose track of the truck and it gets a new id. Is there a way to limit the number of ids that the objects get so that this doesnt happen? for example you only have 4 possible labels during the video and the algorithm has to select the most likely label when tracking.

    • @SkalskiP
      @SkalskiP Рік тому +1

      Is is possible to solve those issues. Or to at least make them less frequent. But potential solutions are usually strictly tied to use-case that you are trying to solve. In our case you can notice that those id changes are happening only when cars are still far away or when they are partially ocluded by this large metal object hanging over the left lane. Thats why I would propose to discard objects that are in top half of image and only take into account those that are in bottom half - closer.

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

    Congratulations for the video, very useful. I have a question: If I want to take a v8 model to mobile without losing fps effectiveness and model effectiveness. How would you do? Thanks.

  • @nhanduong5917
    @nhanduong5917 7 місяців тому +1

    from 7:49, the notebook from the link in the description doesn't have those lines, so where can I copy them to paste? Thank you!

    • @Roboflow
      @Roboflow  7 місяців тому

      I just checked. The line definition is there.

    • @nhanduong5917
      @nhanduong5917 7 місяців тому

      @@Roboflow I'm sorry but I don't understand! Could you please reply me with the link?

  • @kevinakd9308
    @kevinakd9308 3 місяці тому

    Help me please! I has a error in the next code.
    the problem is here:
    tracks = byte_tracker.update(
    output_results=detections2boxes(detections=detections),
    img_info=frame.shape,
    img_size=frame.shape
    )
    I dont know how i can fix it

  • @Jkfyr99
    @Jkfyr99 Рік тому +1

    I have been working with ByteTrack for a bit now, but I have struggled on evaluating its tracking performance do you know if it is possible to check tracking performance of the individual objects using something live MOT metrics?

    • @Roboflow
      @Roboflow  Рік тому +1

      Yes, it is possible but you would need to have annotated data.

  • @hossainalmahdi1248
    @hossainalmahdi1248 2 місяці тому

    what to do if i want to show the vehicle counts based on their class. like car in: 1, bus in: 2, car out : 5, bus out: 6

  • @chihebnouri5541
    @chihebnouri5541 2 місяці тому

    i want to only count the vehicule entering not exiting.is it possible?i

  • @baharuddindiassaputra6966
    @baharuddindiassaputra6966 4 місяці тому +2

    Great video, i have a question in this video the linecounter from supervision will increase when all line from prediction box is through the line. Can you change it so just from bottom line / top line??

    • @Roboflow
      @Roboflow  3 місяці тому

      Ask this question here: github.com/roboflow/supervision Describe what you want to do. We will do our best to help you.

  • @aerogrampur
    @aerogrampur 22 дні тому

    appreciate the elaborate explanation. Can we tag each of those objects with unique id? like car1, car2 ...etc

  • @gunduvenkatasai3706
    @gunduvenkatasai3706 2 місяці тому

    Can i draw multiple lines to count objects at multiple locations ?

  • @Jordufi
    @Jordufi Рік тому +3

    I really need help for one thing.
    How can you show the specific number of cars and trucks that have gone in and out.
    For example:
    3 cars and 1 truck in and
    5 cars and 1 truck out

    • @Roboflow
      @Roboflow  Рік тому +2

      We don't have a dedicated feature yet, but you can build a workaround solution. Create two separate line counters. Filter detections by class, to get car and truck detections and trigger one line counter with car detections and the other with truck detections.

    • @Jordufi
      @Jordufi Рік тому +1

      @@Roboflow I will try that, thank you very much!!!

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

    Hi Peter, thank you very very much for your video and explanation! It was incredibly helpful.
    I have a question: for the counting why do we need the line? Since we have the tracking and each object has an id, should not be enough to count the unique id? Thank you

    • @malotabi5949
      @malotabi5949 10 місяців тому

      Can we have the car speed and the postion (x,y,z)

  • @luisdavidviverosescamilla201
    @luisdavidviverosescamilla201 Рік тому +1

    Hi I have question in this case you don't use deepsort technique for tracking the cars do I?

    • @Roboflow
      @Roboflow  Рік тому +1

      I use BytetTack. DeepSort is just another tracker that you can use.

  • @rafael.gildin
    @rafael.gildin 7 місяців тому +1

    Does the same code works for crowd videos ? I’ve been failing to do it.
    Thanks.

    • @Roboflow
      @Roboflow  7 місяців тому

      It should. But I’d need to see specific result to understand what’s failing.

  • @lofihavensongs
    @lofihavensongs Рік тому +2

    Hey there, thanks for the amazing YOLO 8 videos, I run the code for object detection and it was work fine. then I tried to run for instance segmentation. all steps are fine but in the final step when I run the code for Inference with Custom Model, code run without any issue but this message did not appear: Results saved to runs/segment/predict2. do you know what is the problem?

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

      Could you create issue here: github.com/roboflow/notebooks/issues ?

    • @lofihavensongs
      @lofihavensongs Рік тому +1

      @@Roboflow Hi I found the error , in the code should write : save=true but you forgot it I guess . Thanks

    • @Roboflow
      @Roboflow  Рік тому +1

      @@lofihavensongs thanks a lot! Let me try to update that

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

    Hi I have a question what happen if in this case I would like to put a line in vertical way in the middel of the image how can I solve this problem because in your video you don't show how to obtain these values that you put for trace the line for counting

    • @Roboflow
      @Roboflow  8 місяців тому +1

      You just need to know your frame dimensions and experiment a bit to find the right fit.

    • @luisdavidviverosescamilla201
      @luisdavidviverosescamilla201 8 місяців тому

      thanks a lot this comment help me a lot @@Roboflow

  • @user-ie8cy3rc3l
    @user-ie8cy3rc3l Місяць тому

    i tried to use other video with your code but the for loop stops at 6% of the frame. it doesnt return error and it even runs next code properly. So what can be the problem?

    • @user-ie8cy3rc3l
      @user-ie8cy3rc3l Місяць тому

      SOURCE_VIDEO_PATH = "/content/highway.mp4"
      video_info = VideoInfo.from_video_path(SOURCE_VIDEO_PATH)
      byte_tracker = BYTETracker(BYTETrackerArgs())
      TARGET_VIDEO_PATH = f"{HOME}/result.mp4"
      generator = get_video_frames_generator(SOURCE_VIDEO_PATH, end=video_info.total_frames)
      box_annotator = BoundingBoxAnnotator(thickness=4)
      counts = []
      ids = []
      i = 0
      print(video_info)
      with VideoSink(TARGET_VIDEO_PATH, video_info) as sink:
      for frame in tqdm(generator, total=video_info.total_frames):
      print(frame)
      i += 1
      results = model(frame)[0]
      detections = Detections(
      xyxy=results.boxes.xyxy.cpu().numpy(),
      confidence=results.boxes.conf.cpu().numpy(),
      class_id=results.boxes.cls.cpu().numpy().astype(int)
      )
      tracks = byte_tracker.update(
      output_results=detections2boxes(detections=detections),
      img_info=frame.shape,
      img_size=frame.shape
      )
      tracker_id = match_detections_with_tracks(detections=detections, tracks=tracks)
      detections.tracker_id = np.array(tracker_id)
      labels = [
      f"#{tracker_id}"
      for x
      in detections
      ]
      frame = box_annotator.annotate(scene=frame, detections=detections)
      for x in tracker_id:
      if not x in ids:
      ids.append(x)
      counts.append(len(ids))
      sink.write_frame(frame)
      print(i)

  • @vcarvewood4545
    @vcarvewood4545 Рік тому +1

    Piotr jest super-duper ultra yolo guru :D

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

      It's Peter from video. I'm not sure if I'm YOLO guru, but thanks a lot for this kind comment. I went through a bit of internet hate lately, so it is great to here some positive feedback.

  • @s4ifbn
    @s4ifbn Рік тому +1

    thank you, nicley done, I was wondering if we use the segmentation model, how can we annotate the segments with supervision ?

    • @Roboflow
      @Roboflow  Рік тому +1

      Great question. We have support for segmentation on our road map, but it will take us a bit more time to put it on production.

  • @Teleportcamera
    @Teleportcamera Рік тому +2

    Thank you for the amazing video! Is it possible to invoke yolo8 on every 4th frame (for example), instead of every single frame? And have some kind of other system follow the object in the other 3 frames (to save on resources).

    • @Roboflow
      @Roboflow  Рік тому +1

      Not to my knowledge. You skip the frame completely or not. All of those trackers depend on boxes being generated by the model. That being said you can try to pass detections to tracker every 4th frame. It all depends on input video but could still work.

  • @wahyumaulana1649
    @wahyumaulana1649 5 місяців тому

    Is it possible do this on instance segmentation model?

  • @maalimaali9902
    @maalimaali9902 6 місяців тому

    i have this problem ''AttributeError: type object 'Detections' has no attribute 'from_ultralytics'''

  • @bossarts2435
    @bossarts2435 2 місяці тому

    i am new to this and collab so maybe thats why i am facing a small issue!
    the code runs succefuly but output video is not showing..where did i go wrong?
    the commands and all are exicuting with no issues and it even show its detecting cars in the final tab but no video

    • @Roboflow
      @Roboflow  2 місяці тому

      You need to download the result after processing.

  • @shukkkursabzaliev1730
    @shukkkursabzaliev1730 Рік тому +2

    @SkalskiP As always amazing job! One problem I am facing inside *match_detections_with_tracks* function, when the object is not in frame and model return _emtpy list_ this line gives error *iou = box_iou_batch(tracks_boxes, detection_boxes)*
    How can I solve it?

    • @SkalskiP
      @SkalskiP Рік тому +1

      Hi it's Peter from the video. I just fixed that problem. Could you try the tutorial once again?

  • @user-qi4md8ty2n
    @user-qi4md8ty2n 4 місяці тому

    even i upload the zip file it shows no directory .what can i do?

  • @FatemehZaremehrjardi
    @FatemehZaremehrjardi Рік тому +1

    Thank you so much for the video. what's the difference between this notebook and using "yolo track model=path/to/best.pt tracker="bytetrack.yaml"" ?

    • @Roboflow
      @Roboflow  Рік тому +2

      Hi! That video was actually recorded before YOLOv8 team added tracking capability. But in short, you can use ByteTrack with any object detection model, and if you will use Ultralytics implementation then you are bound to use only YOLOv8.

  • @neeraj.kumar.1
    @neeraj.kumar.1 Рік тому +3

    Bro I'm getting problem whenever I'm installation supervision in g-drive
    Please let me know how to solve this problem

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

    hi bro thanks for your effort that tutorial is awsome , I need to do the same thing but real-time by using my webcam or an ip camera

  • @user-vg6ve2il1b
    @user-vg6ve2il1b 5 місяців тому

    hi! thanks ! its v useful. Can it be applied on cellphones ? like an android or IOS app?

  • @pedrofonte9531
    @pedrofonte9531 Рік тому +1

    I have one question: Since we are trying to count the objects and since the Object's id given by the tracker are unique, why can't we just count the last Id or count the different number of ids?

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

      How do you know how many of them traveled up and how many down?

  • @snehitvaddi
    @snehitvaddi Рік тому +1

    Suuperb... What if I want to detect and track the faulty chocolates in that video and mark the chocolate faulty until it leaves out the frame? Any thoughts on this?

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

      Do you have a model to detect those faults?

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

      ​@@Roboflow No, currently I have a model to detect potatoes on a conveyer belt. For detecting defects I'm thinking of using OpenCV to detect color deviations.
      My problem is since potatoes keep rotating on the conveyer belt, I want to track the defective potato even if it keeps rolling.

    • @snehitvaddi
      @snehitvaddi Рік тому +1

      Hey Peter!
      Any thoughts on this? And also, Just now saw your video on Grounding DINO it looks interesting. What are your thoughts on using it to detect rotten/spoiled potatoes as explained in earlier comments.

    • @Roboflow
      @Roboflow  Рік тому +1

      @@snehitvaddi sorry I missed your comment. If you have images of rotten potatoes you can try if DINO detect it. Sounds like something that should work. Color range is doable as well, just pretty hard to get right color ranges I think :/

  • @ikramessafi9560
    @ikramessafi9560 24 дні тому

    Thank you ,Could you please explain how to count objects detected in images?

  • @AdarshSingh-rm6er
    @AdarshSingh-rm6er 16 днів тому

    I want to use supervision for face detection and tracking with Detectron2 model

  • @noktaatisi
    @noktaatisi 6 місяців тому

    How should I edit the code to draw multiple lines?

  • @ChirawatNg
    @ChirawatNg Рік тому +1

    Thank you for a very good explanation.
    I found that YOLOv8 has their own tracking command both CLI and python mode.
    I tried on CLI mode, it works well. but unfortunatly in python mode, ID always reset to id 1.
    Now I am thinking of using ByteTrack as you did or do you have any idea of using straight forward way to use YOLOv8 to tracking object.
    Thanks,
    Nott

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

      Yeah we have video on YOLOv8 native tracking. Take a look here: ua-cam.com/video/Mi9iHFd0_Bo/v-deo.html

    • @ChirawatNg
      @ChirawatNg Рік тому +1

      @@Roboflow thank you

  • @user-kg6fg9hy5o
    @user-kg6fg9hy5o 4 місяці тому

    Thanks for information. By the way, I could not understand about the BYTETracks classes.
    In particular, I've tried adjusting the parameters aspect_ratio_thresh and min_box_area, but there wasn't a significant change. I would appreciate it if you could explain the specific meanings of these parameters. I hope to receive a prompt response. Thank you!

  • @tolgaisk8539
    @tolgaisk8539 Рік тому +2

    How do we count for each class

  • @kevj1605
    @kevj1605 Рік тому +1

    Is the code just related to one or two test cases/videos? Is it possible to do it for any video in general?

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

      Oh! It should work for any video you want. I already seen so many projects build on top of that code demo. Let me know if that works for your case too!

  • @OmarHisham1
    @OmarHisham1 Рік тому +13

    Fun Fact: Tqdm is an arabic word pronounced "Ta-qa-dom", which means progress

    • @SkalskiP
      @SkalskiP Рік тому +1

      Hi it's Peter from the video! Wow! I didn't know that. Now you made me look and here is what I found: tqdm derives from the Arabic word taqaddum (تقدّم) which can mean “progress,” and is an abbreviation for “I love you so much” in Spanish (te quiero demasiado).

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

      @@SkalskiP didn't know about the Spanish abbreviation,
      Nice informative tutorial btw

    • @jorgehenriquesoares7880
      @jorgehenriquesoares7880 10 місяців тому +1

      This is, in fact, fun. Thank you.

    • @vm5954
      @vm5954 3 місяці тому

      Difficult to install though no module ultralytics🙄

  • @ChristoforosAristeidou
    @ChristoforosAristeidou Рік тому +1

    What if i want to count objects of a specific class only? how can this be implemented? Let's say that we want to count only "car" class and not "truck" also? Can this be done?

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

      sure! you just need to filter detections before passing them through the line counter. You would need to add this line before triggering:
      detections = detections[detections.class_id == YOUR_CLASS]

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

      @@Roboflow well i get error: TypeError: 'Detections' object is not subscriptable
      Maybe if i use this filtering before the line counter??
      #class to filter
      mask = np.array([class_id in CLASS_ID for class_id in detections.class_id], dtype=bool)
      detections.filter(mask=mask, inplace=True)
      Let's say instead of CLASS_ID to use [1] so i can keep only class 1

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

    I cannot import lapjv. It show ImportError: cannot import name 'LARGE_' from 'lapjv' (C:\()\lapjv.cp38-win_amd64.pyd). I tried to solve this problem but cannot.

  • @minhonvungoc117
    @minhonvungoc117 Рік тому +2

    Thanks for your interesting video. Could you make a video to compare YOLOv8, YOLOv7, YOLOv6 for object detection and object tracking? That would be great!!!

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

      Interesting idea! Do you think it is worth comparing them they are all super close regarding accuracy and speed. What sort of benchmark are you mostly interested in?

  • @NetoFreitass
    @NetoFreitass 6 місяців тому +1

    Great video! How do I customize the counter? For example, position it in the corner of the screen, count cars, trucks, and motorcycles with their own counters? Thank you!

  • @user-no4ff6mq1r
    @user-no4ff6mq1r 10 місяців тому

    Great video! how can we use gpu with yolov8? and TensorRT? thank you☺

  • @blessingagyeikyem9849
    @blessingagyeikyem9849 Рік тому +1

    How do I get the specific time stamp for which the object was early detected in the video

    • @Roboflow
      @Roboflow  Рік тому +1

      We don’t have time analysis support yet in supervision :/

  • @walterr.t5032
    @walterr.t5032 3 місяці тому

    Hello Piotr @roboflow , I want to be able to activate my previously trained intelligence so that it detects and counts in real time, very similar to the video, but without a video itself, how could I do it? :c

    • @Roboflow
      @Roboflow  3 місяці тому

      I’m afraid I don’t understand the question :/ could you help me out and give me more details?

  • @silakanveli
    @silakanveli Рік тому +1

    Excellent! Just something I was looking! Thanks Roboflow.
    What was the fps?

    • @Roboflow
      @Roboflow  Рік тому +1

      We hope you will build something cool using supervision pip package ;)

  • @jordanlee2839
    @jordanlee2839 3 місяці тому +1

    very helpful video, but my code kept on having error due to the line [ tracks = byte_tracker.update( ] saying "AttributeError: module 'numpy' has no attribute 'float'. " plus when I use the google colab link in the description, i ran the byetrack and it encounters the same error, eventhough i didnt change any code i left it be and it kept on having the same error, so is it an update issue? can you please try and run your code in google colab in the description you gave? Because its seriously not working when i didnt even change any code

    • @Roboflow
      @Roboflow  3 місяці тому +1

      I recommend using this updated version of the notebook: colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-track-and-count-vehicles-with-yolov8-and-supervison.ipynb

    • @jordanlee2839
      @jordanlee2839 3 місяці тому

      @Roboflow thx a lot, I'll be sure to try this tomorrow

    • @atomix_2402
      @atomix_2402 3 місяці тому

      @@Roboflow is there a lot of difference in two methods ?

  • @gunduvenkatasai3706
    @gunduvenkatasai3706 2 місяці тому

    How can i draw multiple lines to count ?

  • @user-zj8kt7sk6e
    @user-zj8kt7sk6e 4 місяці тому

    Thank you. This is nice. I have a requirement to create vehicle detection model with good accuracy. Is it possible to create for me and work for this

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

    I get this error with supervision = 0.1.0. AttributeError: module 'supervision' has no attribute 'get_video_frames_generator'

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

      How do you import it? from supervision.video.source import get_video_frames_generator? That was the API used in 0.1.0.