Traffic Analysis with YOLOv8 and ByteTrack - Vehicle Detection and Tracking

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

КОМЕНТАРІ • 133

  • @travellingengineer2215
    @travellingengineer2215 11 місяців тому +2

    is the source code shown in this video available in git? if not, kindly provide the source code...it would be of Immense help..TIA

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

      Looks like the source code from the video is here, just found it
      github.com/roboflow/supervision/tree/develop/examples/traffic_analysis

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

    A really great tutorial. I have one question though, while running script.py on your video it works fine, but when I run it on my video at 12% it quits with error " in _get_ufunc_and_otypes
    raise ValueError('cannot call `vectorize` on size 0 inputs '
    ValueError: cannot call `vectorize` on size 0 inputs unless `otypes` is set". Any ideas why?(I added otypes=[object] as second vectorize parameter and I am waiting for 12 hours now.) And how could I display class name alongside tracker id and group the tracking count displayed on zones according to vehicle class?

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

    Thank you for this innovative and perfective project! Maybe COLAB version is better option for new starters-low budget developers :)

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

      Everything shown is with open source, free tools! github.com/roboflow/supervision/tree/develop/examples/traffic_analysis + universe.roboflow.com/

  • @pawansharma-mi6ce
    @pawansharma-mi6ce 6 місяців тому +1

    can you make videos on this topic Traffic flow tracking at an intersection based on direction-to-direction analysis involves detecting vehicles and determining their movement direction within predefined regions

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

      how is that different from what we showed here?

    • @pawansharma-mi6ce
      @pawansharma-mi6ce 6 місяців тому

      it only show total no of vehicle not showing classified vehcile number how can we do please ..

    • @pawansharma-mi6ce
      @pawansharma-mi6ce 6 місяців тому

      From which direction and how many vehicles have gone on signalized intersection with their class name ?" cannot be showed .. how can we place a name in the line and for example D is the one direction A is the another direction how can we show how manh vehicle can pass from d-A

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

    @Roboflow, all: Has anyone managed to run YOLOv8 on a Coral Edge TPU?
    I've converted the YOLOv8 model:
    model = YOLO('yolov8n.pt')
    model.export(format='edgetpu',int8=True)
    I get:
    Model successfully compiled but not all operations are supported by the Edge TPU. A percentage of the model will instead run on the CPU, which is slower.
    Number of operations that will run on Edge TPU: 230
    Number of operations that will run on CPU: 26
    Running the model with the "yolov8n_full_integer_quant_edgetpu.tflite" file (and a properly plugged in and recognized Coral Edge TPU USB) results in detection times at least two times slower compared to running on my CPU.
    - Are these the correct steps?
    - Is this an inherent problem of the YOLOv8 model? i.e. not all of it can be efficiently quantized to run on a Coral Edge TPU?
    - What hardware do you guys use for edge real time YOLO?

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

      Sorry I don’t have experience with Coral devices. I have it one of my drawers but newer used it. Maybe we should create YT tutorial about it…

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

    Excellent work with great applicability to many fields.

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

    Can you please upload a tutorial on using YOLO-NAS and BYTETrack for object detection and tracking on custom dataset? (if possible, pls include the annotation part for videos of the dataset as well)

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

      Hi we have a separate video covering training for YOLO-NAS. Did you have a chance to watch it? :)

  • @tobieabel7474
    @tobieabel7474 Рік тому +9

    I personally prefer this format of video where you work from the IDE rather than Colab as I find it easier to follow the structure of your thinking, how you go about solving the problem piece by piece.

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

      Thanks for sharing. Funny enough, you are one of the first people who “voted” for IDE.

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

    Impressive job!
    I have one question, although this video was captured by a drone, the camera lens remains stationary. In most cases, the drone is moving, so fixed-position bounding box is not applicable. Is there a way to address this issue? Thank you!

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

      The script should work with simple camera you just need to put it high enough. It doesn’t need to be drone locate directly over the road.

  • @prethiveerajan8807
    @prethiveerajan8807 7 днів тому

    i have this doubt wht shld i enter as --source_weights_path

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

    We need some projects involving vision transformers, please. One of the applications is desnowing images.

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

      Do you mean detection/segmentation transformers? Or image generative AI?

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

    I am working on a project, for detecting saplings in a field. but when the drone is taking a turn to change the lap (basically moving into other lanes) the previous lanes are also coming like 1,2 of them and saplings in those laps are counted again. Is there any solutions for this?

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

      Did you tried any image stitching? So
      I’m short instead of prow easing video. Pick frames every 1 or 2 seconds. Stich them together to form large image. And process that large image?

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

      @@Roboflow actually I have a video from client, I have yolov8 model to detect saplings and the video is shot from drone like if the drone move in first lap, it covers first 4 lanes and when takes a right U turn and move to the 2nd lap the video has previous last 2 or 1 lanes, and saplings on those lanes are counted again, will image stitching work?

  • @frankkubler-q3e
    @frankkubler-q3e 11 місяців тому +1

    Excellent ! Thanks for sharing your work. Did you finetune a Yolov8x model to detect as well the cars ?

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

      Yes. It was trained on custom dataset.

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

    Where is jupyter notebook for this project located?

  • @jorgeluisg
    @jorgeluisg 11 місяців тому +1

    Hello Piotr, I hope you are doing fine! I'm at 11:49 min and I'm getting this error:
    /python3.9/site-packages/supervision/detection/core.py", line 28, in _validate_mask
    raise ValueError("mask must be 3d np.ndarray with (n, H, W) shape")
    ValueError: mask must be 3d np.ndarray with (n, H, W) shape
    I haven't been able to solve it. I also clone the repo and I got the same problem. 😥

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

      Do you get that with our example? Or your model / your video?

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

      Hi there! I got that from your model and video. I ran the bash script to download both video and model from the drive

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

      Hey@@Roboflow I test the code using windows 11, python 3.11.4 with venv and it did work. I was working with conda in linux.

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

    I've a " football player tracking and statistics collecting during de play "project to do ... do you've somes ressources for documentation??

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

      Sorry but I’m not sure if I understand correctly. Could you elaborate?

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

      @@RoboflowI want to be able to collect all the statistics during a soccer match, such as the ball procession, the number of corners and so on...

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

    Great video, really helpful. I am building a people tracker to count how many people are in various zones of a premises and where they have walked from so this is a really useful piece of work - many thanks

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

      Hi 👋🏻 I guild something similar in the past. Awesome! I’m happy to hear that. I hope you will use Supervision?

    • @user-qr9vi5ur6f
      @user-qr9vi5ur6f Рік тому

      Very cool

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

      @@Roboflow yes, looking into Supervision right now. My computer vision skills need all the help they can get!

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

    I have lost hope in finding the answer of my question @roboflow team. I have been commenting on your last 3-4 videos for one help. I want you to help me with Autodistill auto annotations video,where I want to check the annotated images manually so that i can correct the annotation which is wrong and missing. You told me that you will upload a blog, if its already uploaded please share the link or please make a tutorial on the steps . Thank you .Please i need your help

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

    One of My fav CV teacher Piotr Skalski

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

      It is Piotr from the video! Thanks a lot!

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

    Why it's not in Google Collab?

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

      You should be able to run that script in Colab

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

    thank you very much for the video and I asked if I wanted to analyze the congestion by determining the length of the traffic jams, the number of cars in traffic jam for each lane of traffic. THANKS!

  • @Anonyms-rt5fb
    @Anonyms-rt5fb Рік тому +1

    Could anyone let me know what makes the code autotype in the python script? Is it copilot?

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

      Wondering about it too. That was a real speed up over my typical vim coding environment

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

      Yes! I’m using GH Copilot and AI Assistant form JetBrains :)

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

      If you are not using Copilot or any similar plug-in, I highly recommend it.

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

    can you help me in making ANPR system where the number plate in detected and there is automatic opening and closing of gate

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

    Hey can you create a tutorial for smart Surveillance which detect human intrusion classify between authorised and unauthorised intruders and notify security person usign YOLO V8 please

  • @PuckStar
    @PuckStar 11 місяців тому +1

    Can I run all of this also locally? Or do I really need colab?

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

      I did run everything locally on my MacBook.

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

    what if the video was recorded by a drone cruising back and forth? how to set up the line that keep in a fixed position for flow count?

  • @JD-xd3xp
    @JD-xd3xp 11 місяців тому +1

    Excellent work and great video, can you please share the model & name of the video camera used?

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

      On GitHub there is .sh script that you can use to download both the model and video.

    • @JD-xd3xp
      @JD-xd3xp 11 місяців тому

      @@Roboflow I want the name of the video camera used for this testing.

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

    I got a error while compilation with visual code where it state that objects are nun cannot iterate the null objects plz suggest how to solve that issue

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

    Yes, IDE is much easier to follow

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

      I’m trying to do both. Some people had different opinion. They prepare colabs because they do not need to setup environment locally.

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

      @@Roboflow Your videos and contributions to the community are incredible, this is just a minor detail. Thank you 🙏🏻

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

    Nice Video! Thanks for uploading! Can I get the github code for this video?

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

    thank for great tutorial. I want to implement a tracker which counts and track fruits on tree. The problem is some of the fruits are counted more than once. does anybody have any ideas? is there a way to keep the tracklets in ByteTrack for longer duration?

  • @pawansharma-mi6ce
    @pawansharma-mi6ce 7 місяців тому

    can you explain how to create the project like the flow from north to east and east to west how can we calculate

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

    Video from you really helps me a lot I appreciate it . I have a query How can I count number of objects entered and pass from polygon and show the count on polygon

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

    Buen video perrita, tú librería me va a servir mucho. Besos en el aniseto

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

    How do I add speed detection in this

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

    Hi, I was wondering to know, how to export counting results to csv

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

    hi thanks for the video its awesome just wanna ask how can we use this to detect traffic violations such as wrong way driving

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

    Hey dude, it's going to sound a bit lame, but my training has failed many times already and I think it's because of my dataset, I need it to be able to detect cars in that same kind of camera angle, so... can you give that database or tell the link where you got it from please 😅

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

      Link to the data set is in the description:)

  • @AnthonyK-z2z
    @AnthonyK-z2z Рік тому +1

    Thank you for a great work! Would be happy to see you continue experimenting more😊
    Question though, I assume Polygon instance only contains information whether the ID is in the zone or outside without actually showing whether it crosses the line to exit?
    The reason I’m asking this is that my projects has a lot of occlusion, so it’s quite often for model to lose track.
    What will happen if object is not tracked anymore, but it never did actually cross the line to exit?
    Thank you very much!

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

      So what you are looking for is information that given ID was outside and at some point it cross and is inside? To prevent ID popping out of nowhere in the middle of the zone and get counted in?

    • @AnthonyK-z2z
      @AnthonyK-z2z Рік тому

      Not exactly. I want be sure that actual zone exit (crossing the line) won’t be confused with model losing the object.
      Say the object disappeared (due to occlusion) inside the zone. Would the polygon logic treat it as zone exit?

    • @AnthonyK-z2z
      @AnthonyK-z2z Рік тому

      @@Roboflow I'm eager to use and promote your framework. please let me know if you can provide this information:
      I want to be sure that actual zone exit (crossing the line) won’t be confused with model losing the object.
      Say the object disappeared (due to occlusion) inside the zone. Would the polygon logic treat it as zone exit?

  • @유영재-c9c
    @유영재-c9c 6 місяців тому

    how to know tracklet length?

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

    Thank you so much for this video, it is a lot fun learning from your videos!
    I have one question, how do I convert the results I have gotten into a output video? I have tried, however I have only gotten the video without any labels or bounding boxes.

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

      oh I GOT IT! Thank you nonetheless for making these awesome videos!
      Is it possible for you to create a video whereby ReId is combined with tracking algorithm(eg ByteTrack or BOTsort)?
      Thank you once again!

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

    Really great project! I would like to save the tracking data for further analysis - speed calculation, trajectory conflict points. What would be the best way to do it? Let's say the result should be a dictionary with all tracked IDs as keys and the values will be a list with the object coordinates in each frame: {id1: [[x1,y1,frame1],[x2,y2,frame2].......} Thank you!

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

    I trained our network with custom dataset. with YOLOv8 The training period lasted a long time. I want to test the performance of my test set with the network I trained at another time. Is there any other solution than retraining the network?

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

      I’m afraid not. The best you could do is to resume the training. So to pick up where you left of after the first round of training.

  • @abdullahashraf3151
    @abdullahashraf3151 11 місяців тому +1

    Great Video , Please Continue , Thanks Peter :)

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

      Thanks, will do!

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

    sooooooooooooo good, please keep developing!!!

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

      What would you like to see next?

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

      it would be really nice if you can display the speed of the car? or the number of cars/people that crossing the road at red /green light@@Roboflow

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

    Great video! Next step would be identify the crosswalks and build the polygons with that data

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

    Yes, Please continue to the project: I like Both IDE and Colab.

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

    where do I find the code for this ?

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

      Here it is: github.com/roboflow/supervision/tree/develop/examples/traffic_analysis :)

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

    Can we run the program with real-time sources on Windows 11 OS? I can't recognize which OS you are working on. Thank you in advance :D

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

      Yes

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

      @@aniketthakur1163did you try it ? I'm getting a lot of errors and I can't figure out please help me if you can

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

    code link?

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

    Please put vedios about adversarial attacks

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

    Hey Piotr, Huge fan of you but, I have one problem is I'm working in Windows Pycharm. And I have no clue how to run the code in mine ... When i run the code the below part of the code says rebuild it in Windows so if it's possible can you help me in this. Thanks for your work and you keep me motivated to learn more about CV !! Huge fan mate
    cv2.imshow("frame", processed_frame)
    if cv2.waitKey(1) & 0xFF == ord("q"):
    break
    cv2.destroyAllWindows()

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

      Hi 👋🏻 thanks a lot! Please ask your question here: github.com/roboflow/supervision It is hard to debug in YT comments.

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

      @@RoboflowI did I hope to get a reply asap

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

    impressive!
    Actually it would be nice to draw the zones (bounding box) using mouse dynamically and assign a color, how can that be done? any specific libraries for it?

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

      It possible to do it , I did it modifying Streamlit Drawable Canvas component . and having a Config.json file to feed the code

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

      Can you share it? @harold0723 I’d love to see that!

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

    For "solar panel counting using SAM" ...which process is better >>> 1. detection followed by segmentarion Or 2. segmentation followed by classification

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

      From my experience 1 with YOLOv8 + SAM is suuuuuper easy!

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

      i forgot to mention my images are UAV orthomosaic images...so, is YOLOv8 + SAM still good for it ?
      @@Roboflow

  • @Hugo-mm3st
    @Hugo-mm3st Рік тому

    how much cust ( in hardware components) to implement this code in a custom video (30:00 + duration)?

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

      Hi 👋🏻 I’m not sure I understand what you mean. Could you help me out and explain a bit more?

    • @Hugo-mm3st
      @Hugo-mm3st Рік тому

      Do I need to have a very expensive PC to handle the processing that this software consumes? in terms of processor and video card for example@@Roboflow

  • @vishwamgupta-n6k
    @vishwamgupta-n6k 11 місяців тому

    Where can I look for source code.

  • @user-qr9vi5ur6f
    @user-qr9vi5ur6f Рік тому

    Can roboflow extract features and label an entireimage as a unique image or can it only label objects within an image

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

      We can do many different things. You can label with single or multiple categories. You can assign tags. You can cluster images based on similarity. Could you be a bit more specific. What solution are you looking for?

    • @user-qr9vi5ur6f
      @user-qr9vi5ur6f Рік тому

      @@Roboflow thank you! reverse image matching to find the closest match from an image set using the entire image instead of labeling things inside the image... let me know!

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

    can i get vehicular speed?

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

    I'd love to see how to make a system that tracks people on a, for example, clothing store, and generates a heat map of the most popular spots in the store O.o

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

      So a heat map of the most frequent traveling paths or places where people spent the most time?

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

      @@Roboflow exactly that!! i think both cases would be interesting to see, is it one more difficult than the other?

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

    nice.thx!

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

    Is there any way I can detect speed of the vehicle too and show it on the bounding box itself?

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

      Can anyone help, please?

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

      Sure it is. But you would need to know the real dimensions of the road that the car is traveling on.

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

    i personally enjoyed the IDE more than Colab and please do the ones you talked about. traffic density, vehicle speed even the gap between vehicles travelling in the same direction. This will be interesting. What if the zones can be entered from the UI instead of hard coding them. just a thought!

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

      Cool project ideas. I’ll keep those in mind. As for zones, with just a little bit of coding you can make them movable or define them from UI. :)

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

    How to incorporate DeepSort into supervision?

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

      You want to contribute DeepSort into Supervision or implement it in your project?

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

      @@Roboflow implement deepsort in supervision

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

    BY THE WAY IS POLYGON ZONE WORKING?

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

      Isn’t it? Did you encounter any problems?

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

      @@Roboflow i never find it when i search...its a broken link

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

    Loved this project!

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

    Hi there, we are getting an error of ultralytics. Could you please help me?