Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -332,8 +332,8 @@ segm_img_b = gr.Image(
|
|
| 332 |
label="Segmented Image with Box-Prompt", interactive=False, type="pil"
|
| 333 |
)
|
| 334 |
|
| 335 |
-
global_points = []
|
| 336 |
-
global_point_label = []
|
| 337 |
|
| 338 |
input_size_slider = gr.components.Slider(
|
| 339 |
minimum=512,
|
|
@@ -412,16 +412,16 @@ with gr.Blocks(css=css, title="Efficient SAM") as demo:
|
|
| 412 |
# Description
|
| 413 |
gr.Markdown(description_p)
|
| 414 |
|
| 415 |
-
cond_img_p.select(get_points_with_draw, [segm_img_p, cond_img_p], segm_img_p
|
| 416 |
|
| 417 |
-
cond_img_b.select(get_points_with_draw_, [segm_img_b, cond_img_b], segm_img_b
|
| 418 |
|
| 419 |
segment_btn_p.click(
|
| 420 |
-
segment_with_points, inputs=[cond_img_p], outputs=segm_img_p
|
| 421 |
)
|
| 422 |
|
| 423 |
segment_btn_b.click(
|
| 424 |
-
segment_with_boxs, inputs=[cond_img_b, segm_img_b], outputs=segm_img_b
|
| 425 |
)
|
| 426 |
|
| 427 |
def clear():
|
|
|
|
| 332 |
label="Segmented Image with Box-Prompt", interactive=False, type="pil"
|
| 333 |
)
|
| 334 |
|
| 335 |
+
global_points = gr.State([])
|
| 336 |
+
global_point_label = gr.State([])
|
| 337 |
|
| 338 |
input_size_slider = gr.components.Slider(
|
| 339 |
minimum=512,
|
|
|
|
| 412 |
# Description
|
| 413 |
gr.Markdown(description_p)
|
| 414 |
|
| 415 |
+
cond_img_p.select(get_points_with_draw, [segm_img_p, cond_img_p], segm_img_p)
|
| 416 |
|
| 417 |
+
cond_img_b.select(get_points_with_draw_, [segm_img_b, cond_img_b], segm_img_b)
|
| 418 |
|
| 419 |
segment_btn_p.click(
|
| 420 |
+
segment_with_points, inputs=[cond_img_p], outputs=segm_img_p
|
| 421 |
)
|
| 422 |
|
| 423 |
segment_btn_b.click(
|
| 424 |
+
segment_with_boxs, inputs=[cond_img_b, segm_img_b], outputs=segm_img_b
|
| 425 |
)
|
| 426 |
|
| 427 |
def clear():
|