Spaces:
Running
on
T4
Running
on
T4
ymq2017
commited on
Commit
·
ee8fea2
1
Parent(s):
376ea26
hq_token_only
Browse files
app.py
CHANGED
|
@@ -349,9 +349,9 @@ if __name__ == "__main__":
|
|
| 349 |
|
| 350 |
**scribble_box**: Click on two points, the top-left point and the bottom-right point to represent a bounding box of the target instance.
|
| 351 |
|
| 352 |
-
**automatic**: Automaticly generate text prompt and the corresponding box input.
|
| 353 |
|
| 354 |
-
|
| 355 |
|
| 356 |
To achieve best visualization effect, for images contain multiple objects (like typical coco images), we suggest to set hq_token_only=False. For images contain single object, we suggest to set hq_token_only = True.
|
| 357 |
|
|
@@ -365,6 +365,9 @@ if __name__ == "__main__":
|
|
| 365 |
task_type = gr.Dropdown(
|
| 366 |
["text", "scribble_point", "scribble_box", "automatic"], value="text", label="task_type")
|
| 367 |
text_prompt = gr.Textbox(label="Text Prompt", placeholder="butterfly .")
|
|
|
|
|
|
|
|
|
|
| 368 |
run_button = gr.Button(label="Run")
|
| 369 |
with gr.Accordion("Advanced options", open=False):
|
| 370 |
box_threshold = gr.Slider(
|
|
@@ -376,9 +379,6 @@ if __name__ == "__main__":
|
|
| 376 |
iou_threshold = gr.Slider(
|
| 377 |
label="IOU Threshold", minimum=0.0, maximum=1.0, value=0.8, step=0.001
|
| 378 |
)
|
| 379 |
-
hq_token_only = gr.Dropdown(
|
| 380 |
-
[False, True], value=False, label="hq_token_only"
|
| 381 |
-
)
|
| 382 |
|
| 383 |
with gr.Column():
|
| 384 |
gallery = gr.Gallery(
|
|
|
|
| 349 |
|
| 350 |
**scribble_box**: Click on two points, the top-left point and the bottom-right point to represent a bounding box of the target instance.
|
| 351 |
|
| 352 |
+
**automatic**: Automaticly generate text prompt and the corresponding box input with BLIP and Grounding-DINO.
|
| 353 |
|
| 354 |
+
We also support a hyper-paramter **hq_token_only**. False means use hq output to correct SAM output. True means use hq output only. Default: False.
|
| 355 |
|
| 356 |
To achieve best visualization effect, for images contain multiple objects (like typical coco images), we suggest to set hq_token_only=False. For images contain single object, we suggest to set hq_token_only = True.
|
| 357 |
|
|
|
|
| 365 |
task_type = gr.Dropdown(
|
| 366 |
["text", "scribble_point", "scribble_box", "automatic"], value="text", label="task_type")
|
| 367 |
text_prompt = gr.Textbox(label="Text Prompt", placeholder="butterfly .")
|
| 368 |
+
hq_token_only = gr.Dropdown(
|
| 369 |
+
[False, True], value=False, label="hq_token_only"
|
| 370 |
+
)
|
| 371 |
run_button = gr.Button(label="Run")
|
| 372 |
with gr.Accordion("Advanced options", open=False):
|
| 373 |
box_threshold = gr.Slider(
|
|
|
|
| 379 |
iou_threshold = gr.Slider(
|
| 380 |
label="IOU Threshold", minimum=0.0, maximum=1.0, value=0.8, step=0.001
|
| 381 |
)
|
|
|
|
|
|
|
|
|
|
| 382 |
|
| 383 |
with gr.Column():
|
| 384 |
gallery = gr.Gallery(
|