Update app.py
Browse files
app.py
CHANGED
|
@@ -56,6 +56,8 @@ def generate(input_video):
|
|
| 56 |
check=True
|
| 57 |
)
|
| 58 |
|
|
|
|
|
|
|
| 59 |
subprocess.run(
|
| 60 |
[
|
| 61 |
"python", "infer_4d.py", "big",
|
|
@@ -70,7 +72,7 @@ def generate(input_video):
|
|
| 70 |
|
| 71 |
output_videos = glob(os.path.join(f"{workdir}", "*.mp4"))
|
| 72 |
print(output_videos)
|
| 73 |
-
return output_videos[0]
|
| 74 |
|
| 75 |
except subprocess.CalledProcessError as e:
|
| 76 |
raise gr.Error(f"Error during inference: {str(e)}")
|
|
@@ -82,7 +84,11 @@ with gr.Blocks() as demo:
|
|
| 82 |
input_video = gr.Video(label="Input Video")
|
| 83 |
submit_btn = gr.Button("Submit")
|
| 84 |
with gr.Column():
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
gr.Examples(
|
| 88 |
examples = video_examples,
|
|
@@ -92,7 +98,13 @@ with gr.Blocks() as demo:
|
|
| 92 |
submit_btn.click(
|
| 93 |
fn = generate,
|
| 94 |
inputs = [input_video],
|
| 95 |
-
outputs = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
)
|
| 97 |
|
| 98 |
demo.queue().launch(show_api=False, show_error=True)
|
|
|
|
| 56 |
check=True
|
| 57 |
)
|
| 58 |
|
| 59 |
+
print(output_videos)
|
| 60 |
+
|
| 61 |
subprocess.run(
|
| 62 |
[
|
| 63 |
"python", "infer_4d.py", "big",
|
|
|
|
| 72 |
|
| 73 |
output_videos = glob(os.path.join(f"{workdir}", "*.mp4"))
|
| 74 |
print(output_videos)
|
| 75 |
+
return output_videos[0], output_videos[1], output_videos[2], output_videos[3],output_videos[4]
|
| 76 |
|
| 77 |
except subprocess.CalledProcessError as e:
|
| 78 |
raise gr.Error(f"Error during inference: {str(e)}")
|
|
|
|
| 84 |
input_video = gr.Video(label="Input Video")
|
| 85 |
submit_btn = gr.Button("Submit")
|
| 86 |
with gr.Column():
|
| 87 |
+
output_result_0 = gr.Video(label="Result")
|
| 88 |
+
output_result_1 = gr.Video(label="Result")
|
| 89 |
+
output_result_2 = gr.Video(label="Result")
|
| 90 |
+
output_result_3 = gr.Video(label="Result")
|
| 91 |
+
output_result_4 = gr.Video(label="Result")
|
| 92 |
|
| 93 |
gr.Examples(
|
| 94 |
examples = video_examples,
|
|
|
|
| 98 |
submit_btn.click(
|
| 99 |
fn = generate,
|
| 100 |
inputs = [input_video],
|
| 101 |
+
outputs = [
|
| 102 |
+
output_result_0,
|
| 103 |
+
output_result_1,
|
| 104 |
+
output_result_2,
|
| 105 |
+
output_result_3,
|
| 106 |
+
output_result_4
|
| 107 |
+
]
|
| 108 |
)
|
| 109 |
|
| 110 |
demo.queue().launch(show_api=False, show_error=True)
|