Spaces:
Running
on
Zero
Running
on
Zero
xierui.0097
commited on
Commit
·
d673498
1
Parent(s):
4335e0e
Add application file
Browse files
app.py
CHANGED
@@ -17,9 +17,9 @@ examples = [
|
|
17 |
]
|
18 |
|
19 |
|
20 |
-
def venhancer_demo(result_dir="./tmp/"
|
21 |
css = """#input_video {max-width: 1024px !important} #output_vid {max-width: 2048px; max-height:1280px}"""
|
22 |
-
venhancer = VEnhancer_sr(result_dir
|
23 |
with gr.Blocks(analytics_enabled=False, css=css) as venhancer_iface:
|
24 |
gr.Markdown(
|
25 |
"<div align='center'> <h1> VEnhancer </span> </h1> \
|
@@ -55,13 +55,13 @@ def venhancer_demo(result_dir="./tmp/", version="v1"):
|
|
55 |
|
56 |
gr.Examples(
|
57 |
examples=examples,
|
58 |
-
inputs=[input_video, input_text
|
59 |
outputs=[output_video],
|
60 |
fn=venhancer.enhance_a_video,
|
61 |
cache_examples=False,
|
62 |
)
|
63 |
end_btn.click(
|
64 |
-
inputs=[input_video, input_text
|
65 |
outputs=[output_video],
|
66 |
fn=venhancer.enhance_a_video,
|
67 |
)
|
@@ -69,20 +69,8 @@ def venhancer_demo(result_dir="./tmp/", version="v1"):
|
|
69 |
return venhancer_iface
|
70 |
|
71 |
|
72 |
-
def get_parser():
|
73 |
-
parser = argparse.ArgumentParser()
|
74 |
-
parser.add_argument(
|
75 |
-
"--version", type=str, default="v1", choices=["v1", "v2"], help="select the checkpoint version."
|
76 |
-
)
|
77 |
-
|
78 |
-
return parser
|
79 |
-
|
80 |
-
|
81 |
if __name__ == "__main__":
|
82 |
-
parser = get_parser()
|
83 |
-
args = parser.parse_args()
|
84 |
-
|
85 |
result_dir = os.path.join("./", "results")
|
86 |
-
venhancer_iface = venhancer_demo(result_dir
|
87 |
venhancer_iface.queue(max_size=12)
|
88 |
venhancer_iface.launch(max_threads=1)
|
|
|
17 |
]
|
18 |
|
19 |
|
20 |
+
def venhancer_demo(result_dir="./tmp/"):
|
21 |
css = """#input_video {max-width: 1024px !important} #output_vid {max-width: 2048px; max-height:1280px}"""
|
22 |
+
venhancer = VEnhancer_sr(result_dir)
|
23 |
with gr.Blocks(analytics_enabled=False, css=css) as venhancer_iface:
|
24 |
gr.Markdown(
|
25 |
"<div align='center'> <h1> VEnhancer </span> </h1> \
|
|
|
55 |
|
56 |
gr.Examples(
|
57 |
examples=examples,
|
58 |
+
inputs=[input_video, input_text],
|
59 |
outputs=[output_video],
|
60 |
fn=venhancer.enhance_a_video,
|
61 |
cache_examples=False,
|
62 |
)
|
63 |
end_btn.click(
|
64 |
+
inputs=[input_video, input_text],
|
65 |
outputs=[output_video],
|
66 |
fn=venhancer.enhance_a_video,
|
67 |
)
|
|
|
69 |
return venhancer_iface
|
70 |
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
if __name__ == "__main__":
|
|
|
|
|
|
|
73 |
result_dir = os.path.join("./", "results")
|
74 |
+
venhancer_iface = venhancer_demo(result_dir)
|
75 |
venhancer_iface.queue(max_size=12)
|
76 |
venhancer_iface.launch(max_threads=1)
|