acmyu commited on
Commit
c94b242
·
1 Parent(s): 95510cb

remove interp frame bg

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. main.py +4 -2
app.py CHANGED
@@ -58,7 +58,7 @@ with gr.Blocks() as demo:
58
  )
59
 
60
  interp_btn.click(
61
- run_interpolate_frames, inputs=[interp_frame1, interp_frame2, times_to_interp], outputs=[frames, frames_thumb]
62
  )
63
 
64
  eval_btn.click(
 
58
  )
59
 
60
  interp_btn.click(
61
+ run_interpolate_frames, inputs=[interp_frame1, interp_frame2, times_to_interp, remove_bg], outputs=[frames, frames_thumb]
62
  )
63
 
64
  eval_btn.click(
main.py CHANGED
@@ -1293,7 +1293,7 @@ def run_eval(images_orig, video_path, train_steps=100, inference_steps=10, fps=1
1293
 
1294
 
1295
  @spaces.GPU(duration=30)
1296
- def interpolate_frames(frame1, frame2, times_to_interp):
1297
  film = Predictor()
1298
  film.setup()
1299
 
@@ -1311,7 +1311,9 @@ def interpolate_frames(frame1, frame2, times_to_interp):
1311
  results = [Image.open(out_vid)]
1312
 
1313
  print(results)
1314
-
 
 
1315
  for r in results:
1316
  r.thumbnail((width, height))
1317
 
 
1293
 
1294
 
1295
  @spaces.GPU(duration=30)
1296
+ def interpolate_frames(frame1, frame2, times_to_interp, remove_bg):
1297
  film = Predictor()
1298
  film.setup()
1299
 
 
1311
  results = [Image.open(out_vid)]
1312
 
1313
  print(results)
1314
+ if remove_bg:
1315
+ results = [removebg(img, rembg_session, True) for img in results]
1316
+
1317
  for r in results:
1318
  r.thumbnail((width, height))
1319