Spaces:
Running
on
Zero
Running
on
Zero
update app.py
Browse files
app.py
CHANGED
|
@@ -149,22 +149,23 @@ with gr.Blocks(css=css) as demo:
|
|
| 149 |
|
| 150 |
with gr.Row():
|
| 151 |
input_video = gr.Video(label="Input Video")
|
|
|
|
| 152 |
submit = gr.Button("Submit")
|
| 153 |
processed_video = gr.Video(label="Processed Video")
|
| 154 |
|
| 155 |
-
def on_submit(uploaded_video):
|
| 156 |
|
| 157 |
# Process the video and get the path of the output video
|
| 158 |
-
output_video_path = make_video(uploaded_video)
|
| 159 |
|
| 160 |
return output_video_path
|
| 161 |
|
| 162 |
-
submit.click(on_submit, inputs=[input_video], outputs=processed_video)
|
| 163 |
|
| 164 |
example_files = os.listdir('assets/examples_video')
|
| 165 |
example_files.sort()
|
| 166 |
example_files = [os.path.join('assets/examples_video', filename) for filename in example_files]
|
| 167 |
-
examples = gr.Examples(examples=example_files, inputs=[input_video], outputs=processed_video, fn=on_submit, cache_examples=True)
|
| 168 |
|
| 169 |
|
| 170 |
if __name__ == '__main__':
|
|
|
|
| 149 |
|
| 150 |
with gr.Row():
|
| 151 |
input_video = gr.Video(label="Input Video")
|
| 152 |
+
model_type = gr.Dropdown(["vits", "vitb", "vitl"], type="value", label='Model Type')
|
| 153 |
submit = gr.Button("Submit")
|
| 154 |
processed_video = gr.Video(label="Processed Video")
|
| 155 |
|
| 156 |
+
def on_submit(uploaded_video,model_type):
|
| 157 |
|
| 158 |
# Process the video and get the path of the output video
|
| 159 |
+
output_video_path = make_video(uploaded_video,encoder=model_type)
|
| 160 |
|
| 161 |
return output_video_path
|
| 162 |
|
| 163 |
+
submit.click(on_submit, inputs=[input_video, model_type], outputs=processed_video)
|
| 164 |
|
| 165 |
example_files = os.listdir('assets/examples_video')
|
| 166 |
example_files.sort()
|
| 167 |
example_files = [os.path.join('assets/examples_video', filename) for filename in example_files]
|
| 168 |
+
examples = gr.Examples(examples=example_files, inputs=[input_video, model_type], outputs=processed_video, fn=on_submit, cache_examples=True)
|
| 169 |
|
| 170 |
|
| 171 |
if __name__ == '__main__':
|