akhaliq HF staff commited on
Commit
569cf9c
1 Parent(s): af0a97c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -10
app.py CHANGED
@@ -17,15 +17,6 @@ model = snapshot_download(repo_id="akhaliq/frame-interpolation-film-style")
17
  interpolator = interpolator.Interpolator(model, None)
18
 
19
  def predict(frame1, frame2, times_to_interpolate):
20
- img1 = frame1
21
- img2 = frame2
22
- if not img1.size == img2.size:
23
- img1 = img1.crop((0, 0, min(img1.size[0], img2.size[0]), min(img1.size[1], img2.size[1])))
24
- img2 = img2.crop((0, 0, min(img1.size[0], img2.size[0]), min(img1.size[1], img2.size[1])))
25
- frame1 = 'new_frame1.png'
26
- frame2 = 'new_frame2.png'
27
- img1.save(frame1)
28
- img2.save(frame2)
29
 
30
  input_frames = [str(frame1), str(frame2)]
31
 
@@ -42,4 +33,4 @@ title="frame-interpolation"
42
  description="Gradio demo for FILM: Frame Interpolation for Large Scene Motion. To use it, simply upload your images and add the times to interpolate number or click on one of the examples to load them. Read more at the links below."
43
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2202.04901' target='_blank'>FILM: Frame Interpolation for Large Motion</a> | <a href='https://github.com/google-research/frame-interpolation' target='_blank'>Github Repo</a></p>"
44
  examples=[['cat1.jpeg','cat2.jpeg',2]]
45
- gr.Interface(predict,[gr.inputs.Image(type='pil'),gr.inputs.Image(type='pil'),gr.inputs.Slider(minimum=2,maximum=5,step=1)],"playable_video",title=title,description=description,article=article,examples=examples).launch(enable_queue=True)
 
17
  interpolator = interpolator.Interpolator(model, None)
18
 
19
  def predict(frame1, frame2, times_to_interpolate):
 
 
 
 
 
 
 
 
 
20
 
21
  input_frames = [str(frame1), str(frame2)]
22
 
 
33
  description="Gradio demo for FILM: Frame Interpolation for Large Scene Motion. To use it, simply upload your images and add the times to interpolate number or click on one of the examples to load them. Read more at the links below."
34
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2202.04901' target='_blank'>FILM: Frame Interpolation for Large Motion</a> | <a href='https://github.com/google-research/frame-interpolation' target='_blank'>Github Repo</a></p>"
35
  examples=[['cat1.jpeg','cat2.jpeg',2]]
36
+ gr.Interface(predict,[gr.inputs.Image(type='filepath'),gr.inputs.Image(type='filepath'),gr.inputs.Slider(minimum=2,maximum=5,step=1)],"playable_video",title=title,description=description,article=article,examples=examples).launch(enable_queue=True)