Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
WXinlong committed Apr 9, 2023
1 parent fd513a6 commit 7192df3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion SegGPT/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Enjoy the [Demo](https://huggingface.co/spaces/BAAI/SegGPT)
python app_gradio.py
```
- This demo is also hosted on HuggingFace [here](https://huggingface.co/spaces/BAAI/SegGPT).
- The current UI interface just unleashes a small part of the capabilities of SegGPT. Please stay tuned for more demonstrations.

<div align="center">
<image src="rainbow.gif" width="720px" />
Expand Down
11 changes: 8 additions & 3 deletions SegGPT/app_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,31 @@ def inference_mask_cat(
['./images/rainbow_1.jpg', './images/rainbow_2.jpg', './images/rainbow_3.jpg'],
['./images/earth_1.jpg', './images/earth_2.jpg', './images/earth_3.jpg'],
['./images/obj_1.jpg', './images/obj_2.jpg', './images/obj_3.jpg'],
['./images/xray_1.jpg', './images/xray_2.jpg', './images/xray_3.jpg'],
['./images/ydt_2.jpg', './images/ydt_1.jpg', './images/ydt_3.jpg'],
]

demo_mask = gr.Interface(fn=inference_mask1,
inputs=[gr.ImageMask(brush_radius=8, label="prompt (提示图)"), gr.Image(label="img1 (测试图1)"), gr.Image(label="img2 (测试图2)")],
outputs=[gr.Image(label="output1 (输出图1)").style(height=384, width=384), gr.Image(label="output2 (输出图2)").style(height=384, width=384)],
#outputs=[gr.Image(shape=(448, 448), label="output1 (输出图1)"), gr.Image(shape=(448, 448), label="output2 (输出图2)")],
outputs=[gr.Image(label="output1 (输出图1)").style(height=256, width=256), gr.Image(label="output2 (输出图2)").style(height=256, width=256)],
#outputs=gr.Gallery(label="outputs (输出图)"),
examples=examples,
#title="SegGPT for Any Segmentation<br>(Painter Inside)",
description="<p> \
Choose an example below &#128293; &#128293; &#128293; <br>\
Or, upload by yourself: <br>\
1. Upload images to be tested to 'img1' and/or 'img2'. <br>2. Upload a prompt image to 'prompt' and draw a mask. <br>\
Tips: The more accurate you annotate, the more accurate the model predicts.;) \
<br> \
💎 The more accurate you annotate, the more accurate the model predicts. <br>\
💎 Examples below were never trained and are randomly selected for testing in the wild. <br>\
💎 Current UI interface only unleashes a small part of the capabilities of SegGPT, i.e., 1-shot case. \
</p>",
cache_examples=False,
allow_flagging="never",
)



title = "SegGPT: Segmenting Everything In Context<br> \
<div align='center'> \
<h2><a href='https://arxiv.org/abs/2304.03284' target='_blank' rel='noopener'>[paper]</a> \
Expand Down

0 comments on commit 7192df3

Please sign in to comment.