优化报告生成部分代码
This commit is contained in:
parent
dd973a90b3
commit
c678c8b96f
|
|
@ -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,7 +287,7 @@ def run(vid_file: str, run_sam3: bool = True, run_inspection: bool = True, gen_r
|
|||
#================生成报告=================
|
||||
|
||||
if gen_report:
|
||||
if result == {}:
|
||||
result: dict = {}
|
||||
with open(f"{output_dir}/hazard_inspection.json", "r", encoding="utf-8") as f:
|
||||
result = json.load(f)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue