kony1337 commited on
Commit
13ce98d
1 Parent(s): c36b4d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -65,13 +65,12 @@ def predict(frame1, frame2, times_to_interpolate, model_name):
65
  resize_img("test1.png", "test2.png")
66
  input_frames = ["test1.png", "resized_img2.png"]
67
 
68
- frames = []
69
- for frame in util.interpolate_recursively_from_files(input_frames, times_to_interpolate, model):
70
- img = Image.fromarray(frame)
71
- resized_img = img.resize((256, 256))
72
- frames.append(np.array(resized_img))
73
 
74
- return frames
 
75
 
76
 
77
  title = "frame-interpolation"
@@ -90,7 +89,7 @@ gr.Interface(
90
  gr.inputs.Slider(minimum=2, maximum=4, step=1),
91
  gr.inputs.Dropdown(choices=model_names, default=model_names[0])
92
  ],
93
- gr.outputs.Image(type="numpy", label="Interpolated Frames"),
94
  title=title,
95
  description=description,
96
  article=article,
 
65
  resize_img("test1.png", "test2.png")
66
  input_frames = ["test1.png", "resized_img2.png"]
67
 
68
+ frames = list(
69
+ util.interpolate_recursively_from_files(
70
+ input_frames, times_to_interpolate, model))
 
 
71
 
72
+ mediapy.write_video("out.mp4", frames, fps=30)
73
+ return "out.mp4"
74
 
75
 
76
  title = "frame-interpolation"
 
89
  gr.inputs.Slider(minimum=2, maximum=4, step=1),
90
  gr.inputs.Dropdown(choices=model_names, default=model_names[0])
91
  ],
92
+ "playable_video",
93
  title=title,
94
  description=description,
95
  article=article,