Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -251,8 +251,8 @@ def main_fun(image_pil, x_units, y_units, text_prompt, box_threshold, text_thres
|
|
251 |
output = inpainted_shifted + shifted_image
|
252 |
output = Image.fromarray(output)
|
253 |
# visualize_results(image_pil, output, 'shifted')
|
254 |
-
|
255 |
-
return segmented_image, output
|
256 |
|
257 |
import gradio as gr
|
258 |
|
@@ -263,9 +263,9 @@ with image_blocks as demo:
|
|
263 |
with gr.Column():
|
264 |
image = gr.Image(sources=['upload'], type="pil", label="Upload")
|
265 |
# with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
266 |
-
text_prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=True)
|
267 |
-
x_units = gr.Slider(minimum=
|
268 |
-
y_units = gr.Slider(minimum=
|
269 |
with gr.Accordion("Advanced options", open=False) as advanced_options:
|
270 |
box_threshold = gr.Slider(
|
271 |
label="Box Threshold", minimum=0.0, maximum=1.0, value=0.23, step=0.01
|
|
|
251 |
output = inpainted_shifted + shifted_image
|
252 |
output = Image.fromarray(output)
|
253 |
# visualize_results(image_pil, output, 'shifted')
|
254 |
+
segmented_image = Image.fromarray(segmented_image)
|
255 |
+
return segmented_image.resize((512, 512)), output.resize((512, 512))
|
256 |
|
257 |
import gradio as gr
|
258 |
|
|
|
263 |
with gr.Column():
|
264 |
image = gr.Image(sources=['upload'], type="pil", label="Upload")
|
265 |
# with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
266 |
+
text_prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', label="Object class", show_label=True)
|
267 |
+
x_units = gr.Slider(minimum=0, maximum=300, step=10, value=100, label="x_units")
|
268 |
+
y_units = gr.Slider(minimum=0, maximum=300, step=10, value=0, label="y_units")
|
269 |
with gr.Accordion("Advanced options", open=False) as advanced_options:
|
270 |
box_threshold = gr.Slider(
|
271 |
label="Box Threshold", minimum=0.0, maximum=1.0, value=0.23, step=0.01
|