Object Tracking with YOLOv8: Vehicles Tracking, Counting (Entering & Leaving) and Speed Estimation

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.พ. 2023
  • #ObjectDetection #ObjectTracking #SpeedEstimation #yolov8 #yolo #computervision #deeplearning #ai #machinelearning #opencv #opencvpython #pytorch
    --------------------------------------------------------------------------
    Code Available:
    Google Colab File Link:
    colab.research.google.com/dri...
    Github Repo:
    github.com/MuhammadMoinFaisal...
    -----------------------------------------------------------------------------------------------------------------------------
    If you enjoyed this video, be sure to subscribe and press the 👍 button
    🧑🏻‍💻 My AI and Computer Vision Courses⭐:
    📙 YOLOv9: Learn Object Detection, Tracking with WebApps (13$):
    www.udemy.com/course/yolov9-l...
    📕 Learn LangChain: Build #22 LLM Apps using OpenAI & Llama 2 (13$):
    www.udemy.com/course/learn-la...
    📚 Computer Vision Web Development: YOLOv8 and TensorFlow.js (13$):
    www.udemy.com/course/computer...
    📕 Learn OpenCV: Build # 30 Apps with OpenCV, YOLOv8 & YOLO-NAS (13$):
    www.udemy.com/course/learn-op...
    📗 YOLO-NAS, OpenAI, SAM with WebApps using Flask and Streamlit (13$): www.udemy.com/course/yolo-nas...
    📘 YOLO-NAS The Ultimate Course for Object Detection & Tracking (13$): www.udemy.com/course/yolo-nas...
    📙 YOLOv8: Object Detection, Tracking & Web Apps in Python 2023 (13$) : www.udemy.com/course/yolov8-t...
    📚 YOLOv7 YOLOv8 YOLO-NAS: Object Detection, Tracking & Web Apps in Python 2023 (13$): www.udemy.com/course/yolov7-o...
    Follow Me:
    LinkedIn: / muhammad-moin-7776751a0
    GitHub: github.com/MuhammadMoinFaisal
    Chat with us on Discord:
    ► / discord
    For Consultation Call:
    www.upwork.com/freelancers/~0...
    --------------------------------------------------------------------------------------------------------------------------
    YOLOv8 Object Tracking Github Repo:
    github.com/MuhammadMoinFaisal...
    Medium Profile:
    / m.moinfaisal

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

  • @muhammadmoinfaisal
    @muhammadmoinfaisal  11 หลายเดือนก่อน +4

    🧑🏻‍💻 My AI and Computer Vision Courses⭐:
    📙 YOLOv9: Learn Object Detection, Tracking with WebApps (13$):
    www.udemy.com/course/yolov9-learn-object-detection-tracking-with-webapps/?couponCode=MAY13DOLLAR
    📕 Learn LangChain: Build #22 LLM Apps using OpenAI & Llama 2 (13$):
    www.udemy.com/course/learn-langchain-build-12-llm-apps-using-openai-llama-2/?couponCode=MAY13DOLLAR
    📚 Computer Vision Web Development: YOLOv8 and TensorFlow.js (13$):
    www.udemy.com/course/computer-vision-web-development/?couponCode=MAY13DOLLAR
    📕 Learn OpenCV: Build # 30 Apps with OpenCV, YOLOv8 & YOLO-NAS (13$):
    www.udemy.com/course/learn-opencv-build-30-apps-with-opencv-yolov8-yolo-nas/?couponCode=MAY13DOLLAR
    📗 YOLO-NAS, OpenAI, SAM with WebApps using Flask and Streamlit (13$): www.udemy.com/course/yolo-nas-object-detection-tracking-web-app-in-python-2023/?couponCode=MAY13DOLLAR
    📘 YOLO-NAS The Ultimate Course for Object Detection & Tracking (13$): www.udemy.com/course/yolo-nas-the-ultimate-course-for-object-detection-tracking/?couponCode=MAY13DOLLAR
    📙 YOLOv8: Object Detection, Tracking & Web Apps in Python 2023 (13$) : www.udemy.com/course/yolov8-the-ultimate-course-for-object-detection-tracking/?couponCode=MAY13DOLLAR
    📚 YOLOv7 YOLOv8 YOLO-NAS: Object Detection, Tracking & Web Apps in Python 2023 (13$): www.udemy.com/course/yolov7-object-detection-tracking-with-web-app-development/?couponCode=MAY13DOLLAR

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

    Hi, I want to get all the detected object information per frame. So, in one frame if there is 2 car and 1 person detected it would print:
    frame 1, car 1(tracking ID), bbox info, other metdata (color of the car, etc.), timestamp,....
    frame 1, car 2.....
    frame 1, person 1....
    frame 2....
    Like this. I am trying to do that from the write results script, but it writes a summary of the frame. Could you please help me how to do it?

  • @user-zf6yd2uj3r
    @user-zf6yd2uj3r ปีที่แล้ว

    Hi great job done. Is it possible to add in timestamp to make analysis on which time frame has more traffic?

  • @matheusmirandapereira5633
    @matheusmirandapereira5633 5 หลายเดือนก่อน

    Hi Muhammad, I really like your video
    I have some doubts, I don’t understand how you drew the line to count the veichles. How can I draw two lines in the video and get the exact time the objects pass through them and register the time in a sheet?
    Thank you

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

    Hello Muhammad, great work, I am seeing some obvious forgotten variable, which by chance I am working on a solution. The perspective has a direct influence on screen speed, but if you do a perspective transform (which by now would be manual input) you can get the bird view of the camera. The result will be very distorted, but it will allow to proportionate detection velocity of the detections.

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

      Hi Alex, Thanks a lot for sharing this information i will look into it
      Thanks

  • @engineeringmathsm1520
    @engineeringmathsm1520 8 วันที่ผ่านมา

    Thank you soo much broski

  • @agengprayoga3836
    @agengprayoga3836 10 หลายเดือนก่อน +1

    Thanks sir, that great work. But, how i can use custome model on this project?

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

    Hi sir, I want to use a custom video with two classes. Can you please help me to count the two objects. I tried running the code but it is giving errors. Please help

  • @pawansharma-mi6ce
    @pawansharma-mi6ce 2 หลายเดือนก่อน

    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

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

    what is the spec of the device you are running these models on ?

  • @luisvillegas1746
    @luisvillegas1746 7 หลายเดือนก่อน

    Excelente

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

    we can modify car_id by amount of seats that cars have! or not. And if can, can you tell me how to do that Thanks

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

    hello sir. its a great video for learning.
    If i need to detect only the vehicles but not human beings, what should i do?
    if i need to change the dataset, at which directory i should exactly make the changes.
    please reply sir.

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

    I want to send class over TCP IP using yolov5 but condition is when TCP IP is connected else skip sending and save class in text and continue monitoring for connection reconnecting. I am working on a detect.py file in the yolov5 repository .Advanced thanks.

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

    Hello Muhammad Moin, how i can run this model on GPU?

  • @areebafatima8319
    @areebafatima8319 7 วันที่ผ่านมา

    Can u make it for yolov9 aswell same or anything vehicle number detection with yolov9
    .you explain really well sir

  • @Ahmed-xn2qf
    @Ahmed-xn2qf ปีที่แล้ว +2

    Good explanation Sir

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

    hi sir is this code valid for real time vehicle tracking, countingand also for speed?

  • @tushyajshubham371
    @tushyajshubham371 7 วันที่ผ่านมา

    How to solve the - "AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float."

  • @areebafatima8319
    @areebafatima8319 11 วันที่ผ่านมา

    Where is the speed estimation code??? Cant see it in the repo?

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

    Nice Tutorial

  • @ilhamariatama8475
    @ilhamariatama8475 7 หลายเดือนก่อน

    Assalamualaikum bro, can this be made into real time?

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

    Very good

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

    I am facing an error. It is telling me to do "set the environment variable HYDRA_FULL_ERROR=1 for a complete trace. What should i do?

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

      yes same here ,same error encountered

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

      ​@@aparnabapuram5600what u did to solve it?

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

      Install a numpy version less than 1.24

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

    great video, which python version did you use?

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

    thank u

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

    Hi,When I input pip install -e '.[dev]' ,there show ERROR: '.[dev]' is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https
    , git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file). I can't solve it although I use stackoverflow,Can you help me?

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

      try pip install -e ".[dev]"

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

      thank you, it works@@ayknes7944

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

    why the hEll everone is using open cv i dont see any experts working without open cv

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

    hello sir i am getting the error
    FileNotFoundError: C:\Users\Hem Raj\Desktop\Vehicle monitoring\YOLOv8-DeepSORT-Object-Tracking\ultralytics\assets does not exist
    Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

    • @akshithreddy1983
      @akshithreddy1983 5 หลายเดือนก่อน

      same error
      any solution?

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

      Paste the error in chat gpt it will give you the errors and correction and it will get resolved

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

    Thanks sir great work. The speed seems to be low comparing to what it should be in real any explanation please? And i think in the speed estimation speed = distance / time.

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

      Hi @Youssef, we have set the time constant = 15 *3.6, 15 represents the frame per second while 3.6 is the constant which we can adjust,
      and yes as speed = distance/time, but here we are doing speed = d_meters * time_constant, because we have frequency here in this case as frequency = 1/time so we will have speed = d_meters*time_constant

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

      Thanks sir. And for the low speed did you please identify the source problem?

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

    hi, I got some errors like settings.keys() == defaults.keys() \
    AttributeError: 'NoneType' object has no attribute 'keys'. Plz help me

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

      Hi @Nhan, please email me the screenshot of the error at m.moinfaisal@gmail.com

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

      @@muhammadmoinfaisal I did send the email . Please help me double check

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

    Can you share me the full code including estimation part as well where it shows the speed of car!

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

      Hi Smit, Good news i have made the code public and i have added the links in the video description please check it
      Thanks

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

      Thank you so much 😊🙌🏻

  • @dudleyboy5327
    @dudleyboy5327 2 หลายเดือนก่อน

    i followed all steps u mentioned, but when i run the test.mp4 video in pycharm i get this :
    Fusing layers...
    YOLOv8l summary: 268 layers, 43668288 parameters, 0 gradients, 165.2 GFLOPs
    Error executing job with overrides: ['model=yolov8l.pt', 'source=test3.mp4', 'show=True']
    Traceback (most recent call last):
    File "C:\Users\ASUS\Documents\DeepSORT_Tutorial1\pythonProject1\YOLOv8-DeepSORT-Object-Tracking\ultralytics\yolo\v8\detect
    \predict.py", line 253, in predict
    predictor()
    and other similar errors after it. i checked predict.py file and i had every "from ultralytics.yolo etc." underlined in red. (total of 12 errors and few warnings)
    please help

    • @niloybiswas9113
      @niloybiswas9113 22 วันที่ผ่านมา

      did you solved the probem?

    • @dudleyboy5327
      @dudleyboy5327 21 วันที่ผ่านมา

      @@niloybiswas9113 no i didn't 😭 i changed the project completely and the code editor to Thonny

  • @user-sm3bc7jg4e
    @user-sm3bc7jg4e 7 หลายเดือนก่อน

    from 8:17, I can't hear your voice. Please check. thank you

  • @jamesabbott3052
    @jamesabbott3052 27 วันที่ผ่านมา

    Hi, thanks for the great video. I am getting the following error: ModuleNotFoundError: No module named 'easydict' when I try to run the code,
    python predict.py model=yolov81.pt source="test3.mp4" show=True

    • @elaf7092
      @elaf7092 12 วันที่ผ่านมา

      pip install easydict in the terminal may be this will solve it

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

    hello sir, can i implementation this deepsort in yolov5? thank you

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

      HI M Rafly, Yes you can implement YOLOv5 and DeepSORT object tracking and there are many open source code available on github as well

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

    Please how do you get pixel of meter of video?

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

      Hi @Youssef, currently we have set the pixel per meter as 8 but we can make it dynamic like close to camera 1 and away from camera 20, to get more better results

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

    what about using my own video on gogel colab for trying ?

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

      Yes you ca use your own video as well

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

    dataset pls??

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

    how to increase video speed in this project? me using cpu

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

      If you are using CPU than FPS will be low and video processing will also be very low, but you can use Google Colab it offers free GPU.

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

    hello i have error when i want to detect object and tracking, pls help me.
    from ultralytics.yolo.engine.predictor import BasePredictor
    ModuleNotFoundError: No module named 'easydict'

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

    Sir could you please share the speed estimation code as well

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

      me too

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

      Hi, Apologies for the delay in reply i was away, here is the Google Colab File Link, it contains the step by step implementation details with speed estimation code as well
      Google Colab File Link:
      colab.research.google.com/drive/1nPGcKGB2ZGO1s8qlflXoWVpIkMlT2J5L?usp=sharing
      Thanks

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

    Hello sir

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

    can you guys have voice in this video after 8.15min

  • @jake-jm8se
    @jake-jm8se 4 หลายเดือนก่อน

    can i do this in vscode?

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

      yes u can. but for some reason, i already installed hydra, yet it still display no module named 'hydra'

    • @AnakPribumi-ue5gl
      @AnakPribumi-ue5gl 2 หลายเดือนก่อน

      from this question, I said that this tutorial not for beginner. Learn from fundamental, never skip if u want to learn something, it will help you in the future. Of course you can use notepad for this tutorial too.

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

    Hello Sir , I have an error is that when I run pip install -e '.[dev]' , then error is shows below like is ..... Preparing metadata (setup.py) ... error
    ERROR: Command errored out with exit status 1:
    command: 'D:\SW Part\Engineering Tools\pythonProject\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\SW Part\\Engineering Tools\\pythonProject\\YOLOv8-DeepSORT-Object-Tracking\\setup.py'
    "'"'; __file__='"'"'D:\\SW Part\\Engineering Tools\\pythonProject\\YOLOv8-DeepSORT-Object-Tracking\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools i
    mport setup; setup()'"'"');code = f.read().replace('"'"'
    '"'"', '"'"'
    '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\10008296\AppData\Local\Temp\pip-pip-egg-info-addy7_ky'
    cwd: D:\SW Part\Engineering Tools\pythonProject\YOLOv8-DeepSORT-Object-Tracking\
    Complete output (9 lines):
    Traceback (most recent call last):
    File "", line 1, in
    File "D:\SW Part\Engineering Tools\pythonProject\YOLOv8-DeepSORT-Object-Tracking\setup.py", line 23, in
    version=get_version(), # version of pypi package
    File "D:\SW Part\Engineering Tools\pythonProject\YOLOv8-DeepSORT-Object-Tracking\setup.py", line 18, in get_version
    return re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', file.read_text(), re.M)[1]
    File "C:\Users\10008296\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1133, in read_text
    return f.read()
    UnicodeDecodeError: 'cp950' codec can't decode byte 0xf0 in position 19: illegal multibyte sequence
    ----------------------------------------
    WARNING: Discarding file:///D:/SW%20Part/Engineering%20Tools/pythonProject/YOLOv8-DeepSORT-Object-Tracking. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Could not fetch URL pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF o
    ccurred in violation of protocol (_ssl.c:997)'))) - skipping

  • @user-ix8dp9us3l
    @user-ix8dp9us3l ปีที่แล้ว

    plz share speed estimation code

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

      Hi, Apologies for the delay in reply i was away, here is the Google Colab File Link, it contains the step by step implementation details with speed estimation code as well
      Google Colab File Link:
      colab.research.google.com/drive/1nPGcKGB2ZGO1s8qlflXoWVpIkMlT2J5L?usp=sharing
      Thanks

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

    I followed your instructions and now it broke my Python and Yolov8 installation. Why did your code update my global Python configuration? Good news, I can run your example. Bad news, I can't run anything else. I can't figure out how to get the speed estimation like in the video title, where is this?
    from deep_sort_pytorch.utils.parser import get_config
    ModuleNotFoundError: No module named 'deep_sort_pytorch'

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

      Hi John,
      You are getting this error because you have not placed the DeepSORT files in the right folder
      Thanks

  • @aishwaryahs7768
    @aishwaryahs7768 11 หลายเดือนก่อน +2

    hi i am not able to run this line ----gdown "drive.google.com/uc?id=1rjBn8Fl1E_9d0EMVtL24S9aNQOJAveR5&confirm=t"--- as i'm getting error for this