From 7192df3ea17657f27f324b46cc205b724b7a3065 Mon Sep 17 00:00:00 2001 From: WXinlong Date: Sun, 9 Apr 2023 13:47:40 +0800 Subject: [PATCH] minor --- SegGPT/README.md | 1 - SegGPT/app_gradio.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SegGPT/README.md b/SegGPT/README.md index 79f71b2..88d628f 100644 --- a/SegGPT/README.md +++ b/SegGPT/README.md @@ -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.
diff --git a/SegGPT/app_gradio.py b/SegGPT/app_gradio.py index 0d25547..34c797e 100644 --- a/SegGPT/app_gradio.py +++ b/SegGPT/app_gradio.py @@ -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
(Painter Inside)", description="

\ Choose an example below 🔥 🔥 🔥
\ Or, upload by yourself:
\ 1. Upload images to be tested to 'img1' and/or 'img2'.
2. Upload a prompt image to 'prompt' and draw a mask.
\ - Tips: The more accurate you annotate, the more accurate the model predicts.;) \ +
\ + 💎 The more accurate you annotate, the more accurate the model predicts.
\ + 💎 Examples below were never trained and are randomly selected for testing in the wild.
\ + 💎 Current UI interface only unleashes a small part of the capabilities of SegGPT, i.e., 1-shot case. \

", cache_examples=False, allow_flagging="never", ) + title = "SegGPT: Segmenting Everything In Context
\
\

[paper] \