config test

main
luanhailiang 2023-09-26 20:07:44 +08:00
parent 226cccbcf6
commit ff85571b47
3 changed files with 46 additions and 6 deletions

View File

@ -2,17 +2,17 @@
# Default YOLO tracker settings for BoT-SORT tracker https://github.com/NirAharon/BoT-SORT
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
new_track_thresh: 0.6 # 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
match_thresh: 0.3 # threshold for matching tracks
new_track_thresh: 0.5 # threshold for init new track if the detection does not match any tracks
track_buffer: 10 # buffer to calculate the time when to remove 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)
# mot20: False # for tracker evaluation(not used for now)
# BoT-SORT settings
gmc_method: sparseOptFlow # method of global motion compensation
# ReID model related thresh (not supported yet)
proximity_thresh: 0.2
proximity_thresh: 0.1
appearance_thresh: 0.25
with_reid: False

40
ez.py 100644
View File

@ -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()

View File

@ -2,4 +2,4 @@ from ultralytics import YOLO
# Configure the tracking parameters and run the tracker
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)