Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -342,9 +342,9 @@ def process_video(video_path, process_seconds=20, conf_threshold=0.2, max_det=8)
|
|
342 |
frame_heatmap_color = cv2.addWeighted(frame_heatmap_color, 0.7, np.full_like(frame_heatmap_color, 255), 0.3, 0)
|
343 |
heatmap_frames.append(frame_heatmap_color)
|
344 |
|
345 |
-
# 保存GIF动画
|
346 |
-
trajectory_gif_path = output_path.replace('.mp4', '
|
347 |
-
heatmap_gif_path = output_path.replace('.mp4', '
|
348 |
|
349 |
imageio.mimsave(trajectory_gif_path, trajectory_frames, duration=50) # 50ms per frame
|
350 |
imageio.mimsave(heatmap_gif_path, heatmap_frames, duration=50)
|
|
|
342 |
frame_heatmap_color = cv2.addWeighted(frame_heatmap_color, 0.7, np.full_like(frame_heatmap_color, 255), 0.3, 0)
|
343 |
heatmap_frames.append(frame_heatmap_color)
|
344 |
|
345 |
+
# 保存GIF动画 - 修改这部分
|
346 |
+
trajectory_gif_path = output_path.replace('.mp4', '_trajectory.gif') # 使用.gif后缀
|
347 |
+
heatmap_gif_path = output_path.replace('.mp4', '_heatmap.gif') # 使用.gif后缀
|
348 |
|
349 |
imageio.mimsave(trajectory_gif_path, trajectory_frames, duration=50) # 50ms per frame
|
350 |
imageio.mimsave(heatmap_gif_path, heatmap_frames, duration=50)
|