Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -66,9 +66,8 @@ def process_video(video_path, process_seconds=20, conf_threshold=0.2, max_det=8)
|
|
66 |
(width, height)
|
67 |
)
|
68 |
|
69 |
-
#
|
70 |
base_size = min(width, height)
|
71 |
-
point_size = max(1, int(base_size * 0.005)) # 0.5% 的最小边长
|
72 |
line_thickness = max(1, int(base_size * 0.002)) # 0.2% 的最小边长
|
73 |
|
74 |
# 设置推理参数并处理视频
|
@@ -80,13 +79,12 @@ def process_video(video_path, process_seconds=20, conf_threshold=0.2, max_det=8)
|
|
80 |
show=False,
|
81 |
stream=True,
|
82 |
line_width=line_thickness, # 线宽
|
83 |
-
|
84 |
show_labels=True,
|
85 |
show_conf=True,
|
86 |
vid_stride=1,
|
87 |
max_det=max_det,
|
88 |
-
|
89 |
-
kpt_line_thickness=line_thickness, # 关键点连接线宽度
|
90 |
)
|
91 |
|
92 |
# 处理结果
|
|
|
66 |
(width, height)
|
67 |
)
|
68 |
|
69 |
+
# 计算基于分辨率的线宽
|
70 |
base_size = min(width, height)
|
|
|
71 |
line_thickness = max(1, int(base_size * 0.002)) # 0.2% 的最小边长
|
72 |
|
73 |
# 设置推理参数并处理视频
|
|
|
79 |
show=False,
|
80 |
stream=True,
|
81 |
line_width=line_thickness, # 线宽
|
82 |
+
boxes=True, # 显示边界框
|
83 |
show_labels=True,
|
84 |
show_conf=True,
|
85 |
vid_stride=1,
|
86 |
max_det=max_det,
|
87 |
+
retina_masks=True # 更精细的显示
|
|
|
88 |
)
|
89 |
|
90 |
# 处理结果
|