config test
parent
226cccbcf6
commit
ff85571b47
10
botsort.yaml
10
botsort.yaml
|
@ -2,17 +2,17 @@
|
||||||
# Default YOLO tracker settings for BoT-SORT tracker https://github.com/NirAharon/BoT-SORT
|
# Default YOLO tracker settings for BoT-SORT tracker https://github.com/NirAharon/BoT-SORT
|
||||||
|
|
||||||
tracker_type: botsort # tracker type, ['botsort', 'bytetrack']
|
tracker_type: botsort # tracker type, ['botsort', 'bytetrack']
|
||||||
track_high_thresh: 0.5 # threshold for the first association
|
track_high_thresh: 0.3 # threshold for the first association
|
||||||
track_low_thresh: 0.1 # threshold for the second association
|
track_low_thresh: 0.1 # threshold for the second association
|
||||||
new_track_thresh: 0.6 # threshold for init new track if the detection does not match any tracks
|
new_track_thresh: 0.5 # threshold for init new track if the detection does not match any tracks
|
||||||
track_buffer: 30 # buffer to calculate the time when to remove tracks
|
track_buffer: 10 # buffer to calculate the time when to remove tracks
|
||||||
match_thresh: 0.3 # threshold for matching tracks
|
match_thresh: 0.8 # threshold for matching tracks
|
||||||
# min_box_area: 10 # threshold for min box areas(for tracker evaluation, not used for now)
|
# min_box_area: 10 # threshold for min box areas(for tracker evaluation, not used for now)
|
||||||
# mot20: False # for tracker evaluation(not used for now)
|
# mot20: False # for tracker evaluation(not used for now)
|
||||||
|
|
||||||
# BoT-SORT settings
|
# BoT-SORT settings
|
||||||
gmc_method: sparseOptFlow # method of global motion compensation
|
gmc_method: sparseOptFlow # method of global motion compensation
|
||||||
# ReID model related thresh (not supported yet)
|
# ReID model related thresh (not supported yet)
|
||||||
proximity_thresh: 0.2
|
proximity_thresh: 0.1
|
||||||
appearance_thresh: 0.25
|
appearance_thresh: 0.25
|
||||||
with_reid: False
|
with_reid: False
|
|
@ -0,0 +1,40 @@
|
||||||
|
import cv2
|
||||||
|
import time
|
||||||
|
|
||||||
|
# 获取 ezopen 协议的 URL
|
||||||
|
url = "rtmp://rtmp03open.ys7.com:1935/v3/openlive/L05874022_1_1?expire=1726487667&id=625419662355599360&t=228dca5d37b6bead201e80cca3fc5fe74140242278e4eb51a99bcce593cae027&ev=100"
|
||||||
|
|
||||||
|
# 创建 VideoCapture 对象
|
||||||
|
cap = cv2.VideoCapture(url)
|
||||||
|
|
||||||
|
cv2.namedWindow("Video", cv2.WINDOW_NORMAL) # Create a named window
|
||||||
|
cv2.resizeWindow("Video", 640, 384) # Resize this window
|
||||||
|
|
||||||
|
start_time = time.time()
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
# 获取视频帧
|
||||||
|
while True:
|
||||||
|
ret, frame = cap.read()
|
||||||
|
if time.time() - start_time < 1: # 循环运行直到1秒过去
|
||||||
|
count += 1
|
||||||
|
else:
|
||||||
|
print(count)
|
||||||
|
start_time = time.time()
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
# print(ret)
|
||||||
|
if not ret:
|
||||||
|
print("Error read video stream.")
|
||||||
|
break
|
||||||
|
# 显示视频帧
|
||||||
|
cv2.imshow("Video", frame)
|
||||||
|
# print("0000000000000",ret)
|
||||||
|
# 等待用户按下任意键退出
|
||||||
|
key = cv2.waitKey(1)
|
||||||
|
if key == 27:
|
||||||
|
break
|
||||||
|
|
||||||
|
# 释放资源
|
||||||
|
cap.release()
|
||||||
|
cv2.destroyAllWindows()
|
2
test.py
2
test.py
|
@ -2,4 +2,4 @@ from ultralytics import YOLO
|
||||||
|
|
||||||
# Configure the tracking parameters and run the tracker
|
# Configure the tracking parameters and run the tracker
|
||||||
model = YOLO('best.pt')
|
model = YOLO('best.pt')
|
||||||
results = model.track(source="./videos/123.mp4", conf=0.3, iou=0.5, show=True)
|
results = model.track(source="./videos/123.mp4", tracker='botsort.yaml', show=True)
|
||||||
|
|
Loading…
Reference in New Issue