fffiloni commited on
Commit
b048b56
·
verified ·
1 Parent(s): 22a3ce6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -272,7 +272,8 @@ def sam_process(input_first_frame_image, checkpoint, tracking_points, trackings_
272
  first_frame_output_filename = "output_first_frame.jpg"
273
  plt.savefig(first_frame_output_filename, format='jpg')
274
  plt.close()
275
-
 
276
  return "output_first_frame.jpg", frame_names, inference_state
277
 
278
  def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_names, video_frames_dir, vis_frame_type, progress=gr.Progress(track_tqdm=True)):
@@ -322,6 +323,7 @@ def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_
322
  # Append the file path to the list
323
  jpeg_images.append(output_filename)
324
 
 
325
 
326
 
327
  if vis_frame_type == "check":
 
272
  first_frame_output_filename = "output_first_frame.jpg"
273
  plt.savefig(first_frame_output_filename, format='jpg')
274
  plt.close()
275
+ torch.cuda.empty_cache()
276
+
277
  return "output_first_frame.jpg", frame_names, inference_state
278
 
279
  def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_names, video_frames_dir, vis_frame_type, progress=gr.Progress(track_tqdm=True)):
 
323
  # Append the file path to the list
324
  jpeg_images.append(output_filename)
325
 
326
+ torch.cuda.empty_cache()
327
 
328
 
329
  if vis_frame_type == "check":