Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -243,7 +243,8 @@ def run_demo_server(pipe_depth, pipe_normal, pipe_dis):
|
|
243 |
with gr.Column():
|
244 |
depth_image_input = gr.Image(
|
245 |
label="Input Image",
|
246 |
-
type="filepath",
|
|
|
247 |
)
|
248 |
with gr.Row():
|
249 |
depth_image_submit_btn = gr.Button(
|
@@ -275,20 +276,18 @@ def run_demo_server(pipe_depth, pipe_normal, pipe_dis):
|
|
275 |
interactive=False,
|
276 |
)
|
277 |
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
|
283 |
example_folder = os.path.join(os.path.dirname(__file__), "./images")
|
284 |
-
example_fns = [os.path.join(example_folder, example) for example in os.listdir(example_folder)]
|
285 |
Examples(
|
286 |
fn=process_pipe_depth,
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
examples=example_fns,
|
292 |
inputs=[depth_image_input],
|
293 |
outputs=[depth_image_output_slider, depth_image_output_files],
|
294 |
# cache_examples=True,
|
|
|
243 |
with gr.Column():
|
244 |
depth_image_input = gr.Image(
|
245 |
label="Input Image",
|
246 |
+
# type="filepath",
|
247 |
+
type="pil",
|
248 |
)
|
249 |
with gr.Row():
|
250 |
depth_image_submit_btn = gr.Button(
|
|
|
276 |
interactive=False,
|
277 |
)
|
278 |
|
279 |
+
filenames = []
|
280 |
+
filenames.extend(["depth_anime_%d.jpg" %(i+1) for i in range(7)])
|
281 |
+
filenames.extend(["depth_line_%d.jpg" %(i+1) for i in range(6)])
|
282 |
+
filenames.extend(["depth_real_%d.jpg" %(i+1) for i in range(24)])
|
283 |
|
284 |
example_folder = os.path.join(os.path.dirname(__file__), "./images")
|
|
|
285 |
Examples(
|
286 |
fn=process_pipe_depth,
|
287 |
+
examples=[
|
288 |
+
os.path.join(example_folder, name)
|
289 |
+
for name in filenames
|
290 |
+
],
|
|
|
291 |
inputs=[depth_image_input],
|
292 |
outputs=[depth_image_output_slider, depth_image_output_files],
|
293 |
# cache_examples=True,
|