rdjarbeng commited on
Commit
f9d0a7f
·
1 Parent(s): cd2b645

try with only one example

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -84,7 +84,7 @@ def remove_background(input_image, bg_color, model_choice, alpha_matting, post_p
84
  # Save the output image to a temporary file
85
  # Generate a unique timestamp for the output file name
86
  timestamp = time.strftime("%Y%m%d-%H%M%S")
87
- output_path = f"output_remove_background_s{timestamp}.png"
88
  output_image.save(output_path)
89
  logging.info(f"Saved output image {output_path}")
90
 
@@ -95,9 +95,8 @@ def remove_background(input_image, bg_color, model_choice, alpha_matting, post_p
95
  return None, None
96
 
97
  examples = [
98
- ['scifi_man1.jpg', None, "", False, False, False],
99
- ['cats.jpeg', None, "", False, False, False],
100
- ['dogs.png', None, "", False, False, False]
101
  ]
102
  # Gradio interface
103
  iface = gr.Interface(
@@ -112,7 +111,7 @@ iface = gr.Interface(
112
  type="value"
113
  ),
114
  gr.Checkbox(label="Enable Alpha Matting", value=False),
115
- gr.Checkbox(label="Post-Process Mask (to post process the mask to get better results)", value=False),
116
  gr.Checkbox(label="Only Return Mask ", value=False)
117
  ],
118
  outputs=[
 
84
  # Save the output image to a temporary file
85
  # Generate a unique timestamp for the output file name
86
  timestamp = time.strftime("%Y%m%d-%H%M%S")
87
+ output_path = f"output_remove_background_{timestamp}.png"
88
  output_image.save(output_path)
89
  logging.info(f"Saved output image {output_path}")
90
 
 
95
  return None, None
96
 
97
  examples = [
98
+
99
+ ['dogs.png']
 
100
  ]
101
  # Gradio interface
102
  iface = gr.Interface(
 
111
  type="value"
112
  ),
113
  gr.Checkbox(label="Enable Alpha Matting", value=False),
114
+ gr.Checkbox(label="Post-Process Mask (post process the mask to get better results)", value=False),
115
  gr.Checkbox(label="Only Return Mask ", value=False)
116
  ],
117
  outputs=[