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