Abu1998 commited on
Commit
110c7d2
·
verified ·
1 Parent(s): fb3e824

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  from depth_map_generator import generate_depth_map
3
  from depth_segmentation import segment_image_by_depth
4
 
5
- def process_image(image, num_segments):
6
  # Save the uploaded image
7
  original_img_path = "original.jpg"
8
  image.save(original_img_path)
@@ -13,6 +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, segmented_images
17
 
18
  # Gradio Interface
 
2
  from depth_map_generator import generate_depth_map
3
  from depth_segmentation import segment_image_by_depth
4
 
5
+ def on_process(image, num_segments):
6
  # Save the uploaded image
7
  original_img_path = "original.jpg"
8
  image.save(original_img_path)
 
13
  # Perform depth segmentation
14
  segmented_images = segment_image_by_depth(original_img_path, depth_map_path, num_segments)
15
 
16
+ # Return the segmented images and file paths for download
17
  return segmented_images, segmented_images
18
 
19
  # Gradio Interface