Commit
·
14dc7cb
1
Parent(s):
3d4f4de
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,7 +135,16 @@ def infer(secret_token, video_in_base64, interpolation, fps_output):
|
|
| 135 |
|
| 136 |
files = final_vid
|
| 137 |
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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=
|
| 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()
|