miojizzy commited on
Commit
0279e71
·
1 Parent(s): 39804bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -21,8 +21,7 @@ def greet(v, speed_ratio, debug, progress=gr.Progress(track_tqdm=True)):
21
  print(ret[-2:])
22
  if len(result)>0 and result[-1][-2:] == ret[-2:]: continue
23
  result.append(ret[ret_offset:])
24
- yield data[0], ret
25
- return None, result
26
 
27
 
28
  with gr.Blocks() as demo:
@@ -30,25 +29,23 @@ with gr.Blocks() as demo:
30
  with gr.Row():
31
  with gr.Column():
32
  input_video = gr.Video()
33
- #info = gr.Textbox(lines=4, label="info")
34
- #input_video.change(fn=get_info, inputs=input_video, outputs=info)
35
  input_speed = gr.Slider(1, 30, value=4, label="speed_ratio")
36
  input_debug = gr.Checkbox(label="debug")
37
  btn = gr.Button(value="Submit")
 
 
 
 
 
 
 
38
  with gr.Column():
39
- output_image = gr.Image()
40
  output_res = gr.Textbox(label="result")
41
 
42
  input = [input_video, input_speed, input_debug]
43
- output = [output_image, output_res]
44
 
45
  btn.click(greet, inputs=input, outputs=output)
46
 
47
- gr.Examples(
48
- examples=[[os.path.join(os.path.dirname(__file__), "example/test.mp4"), 4]],
49
- inputs=input,
50
- outputs=output,
51
- fn=greet,
52
- cache_examples=False,
53
- )
54
  demo.queue().launch(debug=True)
 
21
  print(ret[-2:])
22
  if len(result)>0 and result[-1][-2:] == ret[-2:]: continue
23
  result.append(ret[ret_offset:])
24
+ return result
 
25
 
26
 
27
  with gr.Blocks() as demo:
 
29
  with gr.Row():
30
  with gr.Column():
31
  input_video = gr.Video()
 
 
32
  input_speed = gr.Slider(1, 30, value=4, label="speed_ratio")
33
  input_debug = gr.Checkbox(label="debug")
34
  btn = gr.Button(value="Submit")
35
+ gr.Examples(
36
+ examples=[[os.path.join(os.path.dirname(__file__), "example/test.mp4")]],
37
+ inputs=input,
38
+ outputs=output,
39
+ fn=greet,
40
+ cache_examples=False,
41
+ )
42
  with gr.Column():
 
43
  output_res = gr.Textbox(label="result")
44
 
45
  input = [input_video, input_speed, input_debug]
46
+ output = [output_res]
47
 
48
  btn.click(greet, inputs=input, outputs=output)
49
 
50
+
 
 
 
 
 
 
51
  demo.queue().launch(debug=True)