fffiloni commited on
Commit
79917e9
·
1 Parent(s): b59f63e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -20,13 +20,9 @@ def run_inference(prompt, video_path, condition, video_length):
20
  video_length = int(video_length)
21
  print(video_length)
22
  command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{video_path}' --output_path 'outputs/' --video_length {video_length} --smoother_steps 19 20"
23
- output = subprocess.check_output(command, shell=True, text=True)
24
- output = output.strip() # Remove any leading/trailing whitespace
25
-
26
- # Process the output as needed
27
- print("Command output:", output)
28
-
29
- return "done"
30
 
31
 
32
 
@@ -41,8 +37,8 @@ with gr.Blocks() as demo:
41
  video_length = gr.Slider(label="video length", minimum=1, maximum=15, step=1, value=2)
42
  #seed = gr.Number(label="seed", value=42)
43
  submit_btn = gr.Button("Submit")
44
- #video_res = gr.Video(label="result")
45
- video_res = gr.Textbox(label="result")
46
 
47
  submit_btn.click(fn=run_inference,
48
  inputs=[prompt,
@@ -50,6 +46,6 @@ with gr.Blocks() as demo:
50
  condition,
51
  video_length
52
  ],
53
- outputs=[video_res])
54
 
55
  demo.queue(max_size=12).launch()
 
20
  video_length = int(video_length)
21
  print(video_length)
22
  command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{video_path}' --output_path 'outputs/' --video_length {video_length} --smoother_steps 19 20"
23
+
24
+ output = f"'outputs'/{prompt}.mp4"
25
+ return "done", output
 
 
 
 
26
 
27
 
28
 
 
37
  video_length = gr.Slider(label="video length", minimum=1, maximum=15, step=1, value=2)
38
  #seed = gr.Number(label="seed", value=42)
39
  submit_btn = gr.Button("Submit")
40
+ video_res = gr.Video(label="result")
41
+ status = gr.Textbox(label="result")
42
 
43
  submit_btn.click(fn=run_inference,
44
  inputs=[prompt,
 
46
  condition,
47
  video_length
48
  ],
49
+ outputs=[stauts, video_res])
50
 
51
  demo.queue(max_size=12).launch()