Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -286,36 +286,6 @@ def run_grounded_sam(input_image, text_prompt, task_type, inpaint_prompt, box_th
|
|
| 286 |
else:
|
| 287 |
print("task_type:{} error!".format(task_type))
|
| 288 |
|
| 289 |
-
|
| 290 |
-
The error message `gradio.exceptions.DuplicateBlockError: A block with id: 3 has already been rendered in the current Blocks` indicates that you are trying to render a block with a duplicate ID.
|
| 291 |
-
|
| 292 |
-
The issue is caused by two lines of code that add the same widget to your Gradio interface:
|
| 293 |
-
|
| 294 |
-
run_button.click(fn=run_grounded_sam, inputs=[
|
| 295 |
-
input_image, text_prompt, task_type, inpaint_prompt, box_threshold, text_threshold, iou_threshold, inpaint_mode], outputs=gallery)
|
| 296 |
-
|
| 297 |
-
and
|
| 298 |
-
|
| 299 |
-
iface = gr.Interface(
|
| 300 |
-
run_grounded_sam,
|
| 301 |
-
inputs=[
|
| 302 |
-
input_image,
|
| 303 |
-
text_prompt,
|
| 304 |
-
task_type,
|
| 305 |
-
inpaint_prompt,
|
| 306 |
-
box_threshold,
|
| 307 |
-
text_threshold,
|
| 308 |
-
iou_threshold,
|
| 309 |
-
inpaint_mode
|
| 310 |
-
],
|
| 311 |
-
outputs=gallery,
|
| 312 |
-
title="Grounded SAM demo",
|
| 313 |
-
description="This is an interactive demo for the Grounded SAM.",
|
| 314 |
-
layout="vertical",
|
| 315 |
-
theme="light",
|
| 316 |
-
live=True
|
| 317 |
-
)
|
| 318 |
-
|
| 319 |
if __name__ == "__main__":
|
| 320 |
parser = argparse.ArgumentParser("Grounded SAM demo", add_help=True)
|
| 321 |
parser.add_argument("--debug", action="store_true",
|
|
|
|
| 286 |
else:
|
| 287 |
print("task_type:{} error!".format(task_type))
|
| 288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
if __name__ == "__main__":
|
| 290 |
parser = argparse.ArgumentParser("Grounded SAM demo", add_help=True)
|
| 291 |
parser.add_argument("--debug", action="store_true",
|