From 63f240ac3aba9e41741ece6b944d10ef3742aaa7 Mon Sep 17 00:00:00 2001 From: martin <1486756632@qq.com> Date: Thu, 26 Feb 2026 14:45:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=88=E5=AF=B9=E7=BC=BA=E5=B0=91=E5=9B=BE?= =?UTF-8?q?=E4=BC=A0=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=BC=95=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E6=8C=82=E8=B5=B7=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BB=E6=B5=81=E6=97=B6=E9=95=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yolo/cv_multi_model_back_video.py | 5 ++++- yolo_api.py | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/yolo/cv_multi_model_back_video.py b/yolo/cv_multi_model_back_video.py index 0086328..ab83240 100644 --- a/yolo/cv_multi_model_back_video.py +++ b/yolo/cv_multi_model_back_video.py @@ -33,6 +33,7 @@ from middleware.read_srt import parse_srt_file from touying.ImageReproject_python.cal_func import cal_canv_location_by_osd, red_line_reproject from touying.ImageReproject_python.img_types import Point from yolo.detect.multi_yolo_trt_detect_track import MultiYoloTrtDetectorTrackId +from yolo.detect.multi_yolo_trt_detect_track_trt10_yolo11 import MultiYoloTrtDetectorTrackId_TRT10_YOLO11 # 配置日志 logging.basicConfig( @@ -1885,6 +1886,7 @@ def init_capture_with_sei_fix(video_url: str, attempt: int = 1): raise RuntimeError(f"无法打开RTMP流 (第{attempt}次尝试)") # 设置核心参数 + cap.set(cv2.CAP_PROP_READ_TIMEOUT_MSEC, 25000) #设置25s拉流超时,是为了规避类似彭州水务没加图传模块,飞机太远就拉流失败 cap.set(cv2.CAP_PROP_BUFFERSIZE, BUFFER_SIZE) # 小缓冲区,实时推帧 cap.set(cv2.CAP_PROP_FOURCC, FOURCC) # 指定H264解码器 cap.set(cv2.CAP_PROP_FPS, TARGET_FPS) # 同步流帧率 @@ -4004,7 +4006,8 @@ async def start_rtmp_processing(video_url: str, task_id: str, model_configs: Lis # 初始化MQTT和设备 mqtt = MQTTService(mqtt_pub_ip, port=mqtt_pub_port) # detector = MultiYOLODetector_TrackId(model_configs) - detector = MultiYoloTrtDetectorTrackId(model_configs) + # detector = MultiYoloTrtDetectorTrackId(model_configs) + detector = MultiYoloTrtDetectorTrackId_TRT10_YOLO11(model_configs) print(f"mqtt_sub_ipmqtt_sub_ipmqtt_sub_ip {mqtt_sub_ip} {mqtt_sub_port} {mqtt_sub_topic}") diff --git a/yolo_api.py b/yolo_api.py index 919e228..338e4c7 100644 --- a/yolo_api.py +++ b/yolo_api.py @@ -67,7 +67,14 @@ DB_CONFIG = { "host": "8.137.54.85", "port": "5060" } - +# 什邡数据库 +# DB_CONFIG = { +# "dbname": "postgres", +# "user": "postgres", +# "password": "root", +# "host": "222.213.91.11", +# "port": "5061" +# } # 配置类 class Config: