Spaces:
Running
on
T4
Running
on
T4
terrapretapermaculture
commited on
Commit
•
40fbf09
1
Parent(s):
ed53313
Update app_depth.py
Browse files- app_depth.py +6 -2
app_depth.py
CHANGED
@@ -21,7 +21,7 @@ def create_demo(process):
|
|
21 |
run_button = gr.Button("Run")
|
22 |
with gr.Accordion("Advanced options", open=False):
|
23 |
preprocessor_name = gr.Radio(
|
24 |
-
label="Preprocessor", choices=["Midas", "DPT", "None"],
|
25 |
)
|
26 |
num_samples = gr.Slider(
|
27 |
label="Number of images", minimum=1, maximum=MAX_NUM_IMAGES, value=DEFAULT_NUM_IMAGES, step=1
|
@@ -47,6 +47,7 @@ def create_demo(process):
|
|
47 |
)
|
48 |
with gr.Column():
|
49 |
result = gr.Gallery(label="Output", show_label=False, columns=2, object_fit="scale-down")
|
|
|
50 |
inputs = [
|
51 |
image,
|
52 |
prompt,
|
@@ -60,6 +61,7 @@ def create_demo(process):
|
|
60 |
seed,
|
61 |
preprocessor_name,
|
62 |
]
|
|
|
63 |
prompt.submit(
|
64 |
fn=randomize_seed_fn,
|
65 |
inputs=[seed, randomize_seed],
|
@@ -72,6 +74,7 @@ def create_demo(process):
|
|
72 |
outputs=result,
|
73 |
api_name=False,
|
74 |
)
|
|
|
75 |
run_button.click(
|
76 |
fn=randomize_seed_fn,
|
77 |
inputs=[seed, randomize_seed],
|
@@ -84,6 +87,7 @@ def create_demo(process):
|
|
84 |
outputs=result,
|
85 |
api_name="depth",
|
86 |
)
|
|
|
87 |
return demo
|
88 |
|
89 |
|
@@ -92,4 +96,4 @@ if __name__ == "__main__":
|
|
92 |
|
93 |
model = Model(task_name="depth")
|
94 |
demo = create_demo(model.process_depth)
|
95 |
-
demo.queue().launch()
|
|
|
21 |
run_button = gr.Button("Run")
|
22 |
with gr.Accordion("Advanced options", open=False):
|
23 |
preprocessor_name = gr.Radio(
|
24 |
+
label="Preprocessor", choices=["Midas", "DPT", "None"], value="DPT"
|
25 |
)
|
26 |
num_samples = gr.Slider(
|
27 |
label="Number of images", minimum=1, maximum=MAX_NUM_IMAGES, value=DEFAULT_NUM_IMAGES, step=1
|
|
|
47 |
)
|
48 |
with gr.Column():
|
49 |
result = gr.Gallery(label="Output", show_label=False, columns=2, object_fit="scale-down")
|
50 |
+
|
51 |
inputs = [
|
52 |
image,
|
53 |
prompt,
|
|
|
61 |
seed,
|
62 |
preprocessor_name,
|
63 |
]
|
64 |
+
|
65 |
prompt.submit(
|
66 |
fn=randomize_seed_fn,
|
67 |
inputs=[seed, randomize_seed],
|
|
|
74 |
outputs=result,
|
75 |
api_name=False,
|
76 |
)
|
77 |
+
|
78 |
run_button.click(
|
79 |
fn=randomize_seed_fn,
|
80 |
inputs=[seed, randomize_seed],
|
|
|
87 |
outputs=result,
|
88 |
api_name="depth",
|
89 |
)
|
90 |
+
|
91 |
return demo
|
92 |
|
93 |
|
|
|
96 |
|
97 |
model = Model(task_name="depth")
|
98 |
demo = create_demo(model.process_depth)
|
99 |
+
demo.queue().launch()
|