From c678c8b96f6a1704d200406ef162e48c0f230e01 Mon Sep 17 00:00:00 2001 From: yueliuli <1628111725@qq.com> Date: Thu, 23 Apr 2026 11:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E5=91=8A=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Qwen_app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Qwen_app.py b/Qwen_app.py index 97a68f4..a77cdf4 100644 --- a/Qwen_app.py +++ b/Qwen_app.py @@ -231,7 +231,7 @@ def run(vid_file: str, run_sam3: bool = True, run_inspection: bool = True, gen_r # 获取总帧数与帧率 cap = cv2.VideoCapture(input_video_path) total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) - fps = cap.get(cv2.CAP_PROP_FPS) + fps = int(cap.get(cv2.CAP_PROP_FPS)) cap.release() @@ -287,9 +287,9 @@ def run(vid_file: str, run_sam3: bool = True, run_inspection: bool = True, gen_r #================生成报告================= if gen_report: - if result == {}: - with open(f"{output_dir}/hazard_inspection.json", "r", encoding="utf-8") as f: - result = json.load(f) + result: dict = {} + with open(f"{output_dir}/hazard_inspection.json", "r", encoding="utf-8") as f: + result = json.load(f) with open(f"知识库/rule.json", "r", encoding="utf-8") as f: rule_definitions = json.load(f)