From 41573ac5c704f8b8f5c59a774c1f2bda4e375d18 Mon Sep 17 00:00:00 2001 From: yueliuli <1628111725@qq.com> Date: Thu, 23 Apr 2026 11:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=B8=AD=E6=B7=BB=E5=8A=A0le?= =?UTF-8?q?vel=E9=9A=90=E6=82=A3=E7=AD=89=E7=BA=A7=E4=B8=8Eclass=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/qwen_fun.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/qwen_fun.py b/lib/qwen_fun.py index 31aee9a..f6e7ba1 100644 --- a/lib/qwen_fun.py +++ b/lib/qwen_fun.py @@ -456,6 +456,14 @@ def hazard_inspection( all_bases.append(base) temp_obj["base_id"] = all_bases.index(base) + # 隐患等级 + if get_hazard_level_from_rule(rule_dict, class_list[track_info["class_id"]], tag) == "重大隐患": + temp_obj["level"] = 1 + elif get_hazard_level_from_rule(rule_dict, class_list[track_info["class_id"]], tag) == "一般隐患": + temp_obj["level"] = 0 + else: + temp_obj["level"] = -1, + # 其他字段 temp_obj["track_id"] = track_id temp_obj["hazard_track_id"] = hazard_count @@ -477,6 +485,7 @@ def hazard_inspection( # 构建最终结果 final_result = { + "class_list": class_list, "tag": all_tags, "base": all_bases, "objects": all_objects