Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -153,18 +153,37 @@ def run_image(runner,
|
|
| 153 |
return image
|
| 154 |
|
| 155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
def demo(runner, vision_encoder, vision_processor, padding_embed):
|
| 160 |
with gr.Blocks(title="YOLO-World") as demo:
|
| 161 |
with gr.Row():
|
| 162 |
-
gr.Markdown(
|
| 163 |
-
gr.Markdown('<center> This demo is actively under construction and the YOLO-World-Image is an initial version!')
|
| 164 |
-
gr.Markdown("""<center>
|
| 165 |
-
[](https://yoloworld.cc)
|
| 166 |
-
[](https://arxiv.org/abs/2401.17270)
|
| 167 |
-
[](https://huggingface.co/spaces/stevengrove/YOLO-World)</center>""")
|
| 168 |
with gr.Row():
|
| 169 |
image = gr.Image(type='pil', label='input image')
|
| 170 |
output_image = gr.Image(type='pil', label='output image')
|
|
|
|
| 153 |
return image
|
| 154 |
|
| 155 |
|
| 156 |
+
MARKDOWN = """
|
| 157 |
+
# YOLO-World-Image π: YOLO-World with Image Prompts
|
| 158 |
+
|
| 159 |
+
Now everyone can use YOLO-World and some image prompts to detect corresponding objects in images, no longer relying on text prompts!
|
| 160 |
+
|
| 161 |
+
This demo is actively under construction and the YOLO-World-Image is an initial (**beta**) version!
|
| 162 |
+
|
| 163 |
+
<div style='display:flex; gap: 0.25rem; align-items: center'>
|
| 164 |
+
<a href="https://yoloworld.cc"><img src="https://img.shields.io/badge/Project-Page-green"></a>
|
| 165 |
+
<a href="https://arxiv.org/abs/2401.17270"><img src="https://img.shields.io/badge/arXiv-Paper-red"></a>
|
| 166 |
+
<a href="https://github.com/AILab-CVC/YOLO-World"><img src="https://img.shields.io/badge/GitHub-Code-blue"></a>
|
| 167 |
+
<a href="https://huggingface.co/spaces/stevengrove/YOLO-World"><img src="https://img.shields.io/badge/π€HugginngFace-Spaces-orange"></a>
|
| 168 |
+
</div>
|
| 169 |
+
|
| 170 |
+
### Simple guide:
|
| 171 |
+
|
| 172 |
+
* upload the image prompts
|
| 173 |
+
* adjust the hyperparameters:
|
| 174 |
+
- score threshold
|
| 175 |
+
- nms threshold
|
| 176 |
+
- max number of detections
|
| 177 |
+
- whether using padding: adding padding might improve the confidence scores of the predictions. It will be removed in the coming updates.
|
| 178 |
+
* run with 'submit'!
|
| 179 |
+
"""
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
def demo(runner, vision_encoder, vision_processor, padding_embed):
|
| 184 |
with gr.Blocks(title="YOLO-World") as demo:
|
| 185 |
with gr.Row():
|
| 186 |
+
gr.Markdown(MARKDOWN)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
with gr.Row():
|
| 188 |
image = gr.Image(type='pil', label='input image')
|
| 189 |
output_image = gr.Image(type='pil', label='output image')
|