Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,26 +22,27 @@ def greet(v, progress=gr.Progress(track_tqdm=True)):
|
|
| 22 |
yield data[0], ret
|
| 23 |
return None, result
|
| 24 |
|
| 25 |
-
def greet2(v, progress=gr.Progress(track_tqdm=True)):
|
| 26 |
-
for img in progress.tqdm(v):
|
| 27 |
-
yield img, ""
|
| 28 |
-
return None, "finish"
|
| 29 |
|
| 30 |
with gr.Blocks() as demo:
|
|
|
|
| 31 |
with gr.Row():
|
| 32 |
-
|
| 33 |
-
gr.Video()
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
gr.
|
| 37 |
-
gr.
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
btn.click(greet, inputs=input, outputs=output)
|
| 42 |
|
| 43 |
gr.Examples(
|
| 44 |
-
examples=[os.path.join(os.path.dirname(__file__), "example/test.mp4")],
|
| 45 |
inputs=input,
|
| 46 |
outputs=output,
|
| 47 |
fn=greet,
|
|
|
|
| 22 |
yield data[0], ret
|
| 23 |
return None, result
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
with gr.Blocks() as demo:
|
| 27 |
+
|
| 28 |
with gr.Row():
|
| 29 |
+
with gr.Column():
|
| 30 |
+
input_video = gr.Video()
|
| 31 |
+
#info = gr.Textbox(lines=4, label="info")
|
| 32 |
+
#input_video.change(fn=get_info, inputs=input_video, outputs=info)
|
| 33 |
+
input_speed = gr.Slider(1, 30, value=4, label="speed_ratio")
|
| 34 |
+
btn = gr.Button(value="Submit")
|
| 35 |
+
with gr.Column():
|
| 36 |
+
output_image = gr.Image()
|
| 37 |
+
output_res = gr.Textbox(label="result")
|
| 38 |
+
|
| 39 |
+
input = [input_video, input_speed]
|
| 40 |
+
output = [output_image, output_res]
|
| 41 |
|
| 42 |
btn.click(greet, inputs=input, outputs=output)
|
| 43 |
|
| 44 |
gr.Examples(
|
| 45 |
+
examples=[[os.path.join(os.path.dirname(__file__), "example/test.mp4"), 4]],
|
| 46 |
inputs=input,
|
| 47 |
outputs=output,
|
| 48 |
fn=greet,
|