jbilcke-hf commited on
Commit
14dc7cb
·
1 Parent(s): 3d4f4de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -135,7 +135,16 @@ def infer(secret_token, video_in_base64, interpolation, fps_output):
135
 
136
  files = final_vid
137
 
138
- return final_vid, files
 
 
 
 
 
 
 
 
 
139
 
140
  title="""test space"""
141
 
@@ -157,6 +166,6 @@ with gr.Blocks() as demo:
157
  file_output = gr.File()
158
 
159
 
160
- submit_btn.click(fn=infer, inputs=[secret_token, video_input, interpolation, fps_output], outputs=[video_output, file_output])
161
 
162
  demo.launch()
 
135
 
136
  files = final_vid
137
 
138
+ final_vid = create_video(result_frames, fps_output, "interpolated")
139
+
140
+ encoded_string = ""
141
+
142
+ # Convert video to base64
143
+ with open(final_vid, "rb") as video_file:
144
+ encoded_string = base64.b64encode(video_file.read()).decode('utf-8')
145
+
146
+ return f"data:video/mp4;base64,{encoded_string}"
147
+
148
 
149
  title="""test space"""
150
 
 
166
  file_output = gr.File()
167
 
168
 
169
+ submit_btn.click(fn=infer, inputs=[secret_token, video_input, interpolation, fps_output], outputs=video_output)
170
 
171
  demo.launch()