Hakureirm commited on
Commit
bf53aee
·
verified ·
1 Parent(s): 7ce0302

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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', '_trajectory_animation.jpg') # 实际是GIF但用jpg后缀
347
- heatmap_gif_path = output_path.replace('.mp4', '_heatmap_animation.jpg') # 实际是GIF但用jpg后缀
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)