jhj0517 commited on
Commit
719689e
·
1 Parent(s): 930c751

clean temp/out

Browse files
Files changed (1) hide show
  1. modules/sam_inference.py +4 -2
modules/sam_inference.py CHANGED
@@ -24,7 +24,7 @@ from modules.mask_utils import (
24
  create_solid_color_mask_image
25
  )
26
  from modules.video_utils import (get_frames_from_dir, create_video_from_frames, get_video_info, extract_frames,
27
- extract_sound, clean_temp_dir)
28
  from modules.utils import save_image
29
  from modules.logger_util import get_logger
30
 
@@ -277,6 +277,8 @@ class SamInference:
277
  logger.error(error_message)
278
  raise gr.Error(error_message, duration=20)
279
 
 
 
280
  prompt_frame_image, prompt = image_prompt_input_data["image"], image_prompt_input_data["points"]
281
 
282
  point_labels, point_coords, box = self.handle_prompt_data(prompt)
@@ -306,7 +308,7 @@ class SamInference:
306
  save_image(image=filtered_image, output_dir=TEMP_OUT_DIR)
307
 
308
  out_video = create_video_from_frames(
309
- frames_dir=TEMP_DIR,
310
  frame_rate=self.video_info.frame_rate,
311
  output_dir=self.output_dir,
312
  )
 
24
  create_solid_color_mask_image
25
  )
26
  from modules.video_utils import (get_frames_from_dir, create_video_from_frames, get_video_info, extract_frames,
27
+ extract_sound, clean_temp_dir, clean_image_files)
28
  from modules.utils import save_image
29
  from modules.logger_util import get_logger
30
 
 
277
  logger.error(error_message)
278
  raise gr.Error(error_message, duration=20)
279
 
280
+ clean_image_files(TEMP_OUT_DIR)
281
+
282
  prompt_frame_image, prompt = image_prompt_input_data["image"], image_prompt_input_data["points"]
283
 
284
  point_labels, point_coords, box = self.handle_prompt_data(prompt)
 
308
  save_image(image=filtered_image, output_dir=TEMP_OUT_DIR)
309
 
310
  out_video = create_video_from_frames(
311
+ frames_dir=TEMP_OUT_DIR,
312
  frame_rate=self.video_info.frame_rate,
313
  output_dir=self.output_dir,
314
  )