原文:YOLOv8 目标跟踪、车速检测、车流量统计 - 知乎 (zhihu.com)
一、目标跟踪
YOLOv8_ ByteTrack目标跟踪、模型部署_yolov8-track-CSDN博客
二、车速检测、车流量统计
YOLO 车辆测速-CSDN博客
import cv2
import pandas as pd
import numpy as np
from ultralytics import YOLO
import ultralyticsfrom track import *
from deep_sort.deep_sort import DeepSort
import timemodel = YOLO('yolov8_visdrone.pt')# cap=cv2.VideoCapture('veh2.mp4')
cap = cv2.VideoCapture('b.mov')
# cap=cv2.VideoCapture('test_traffic.mp4'