Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def process_image(image, num_segments):
|
|
| 13 |
# Perform depth segmentation
|
| 14 |
segmented_images = segment_image_by_depth(original_img_path, depth_map_path, num_segments)
|
| 15 |
|
| 16 |
-
return segmented_images
|
| 17 |
|
| 18 |
# Gradio Interface
|
| 19 |
with gr.Blocks() as demo:
|
|
@@ -26,13 +26,9 @@ with gr.Blocks() as demo:
|
|
| 26 |
process_button = gr.Button("Process Image")
|
| 27 |
|
| 28 |
with gr.Column():
|
| 29 |
-
output_gallery = gr.Gallery(label="Segmented Images")
|
| 30 |
download_button = gr.Files(label="Download All", file_count="multiple")
|
| 31 |
|
| 32 |
-
def on_process(image, num_segments):
|
| 33 |
-
segmented_images = process_image(image, num_segments)
|
| 34 |
-
return segmented_images, segmented_images
|
| 35 |
-
|
| 36 |
process_button.click(on_process, [image_input, num_segments], [output_gallery, download_button])
|
| 37 |
|
| 38 |
demo.launch()
|
|
|
|
| 13 |
# Perform depth segmentation
|
| 14 |
segmented_images = segment_image_by_depth(original_img_path, depth_map_path, num_segments)
|
| 15 |
|
| 16 |
+
return segmented_images, segmented_images
|
| 17 |
|
| 18 |
# Gradio Interface
|
| 19 |
with gr.Blocks() as demo:
|
|
|
|
| 26 |
process_button = gr.Button("Process Image")
|
| 27 |
|
| 28 |
with gr.Column():
|
| 29 |
+
output_gallery = gr.Gallery(label="Segmented Images")
|
| 30 |
download_button = gr.Files(label="Download All", file_count="multiple")
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
process_button.click(on_process, [image_input, num_segments], [output_gallery, download_button])
|
| 33 |
|
| 34 |
demo.launch()
|