Spaces:
Running
Running
jiang
commited on
Commit
โข
b667410
1
Parent(s):
4eb0453
update
Browse files- .DS_Store +0 -0
- README.md +2 -2
- app.py +20 -17
- demo/bear.jpeg +0 -0
- demo/cabin.jpeg +0 -0
- demo/otta.png +0 -0
- demo/pig.jpeg +0 -0
- demo/pikachu.jpeg +0 -0
- demo/unicorn.jpeg +0 -0
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
---
|
2 |
title: PolyFormer
|
3 |
-
emoji:
|
4 |
colorFrom: pink
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.14.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
license:
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
title: PolyFormer
|
3 |
+
emoji: ๐
|
4 |
colorFrom: pink
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.14.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
license: apache-2.0
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -23,25 +23,28 @@ import base64
|
|
23 |
import re
|
24 |
from demo import visual_grounding
|
25 |
|
26 |
-
title = "PolyFormer
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
41 |
io = gr.Interface(fn=visual_grounding, inputs=[gr.inputs.Image(type='pil'), "textbox"],
|
42 |
outputs=[gr.outputs.Image(label="output", type='numpy'), gr.outputs.Image(label="predicted mask", type='numpy')],
|
43 |
title=title, description=description, article=article, examples=examples,
|
44 |
allow_flagging=False, allow_screenshot=False)
|
45 |
-
|
46 |
-
io.launch()
|
47 |
|
|
|
23 |
import re
|
24 |
from demo import visual_grounding
|
25 |
|
26 |
+
title = "PolyFormer"
|
27 |
+
|
28 |
+
description = """<p style='text-align: center'> <a href='https://polyformer.github.io/' target='_blank'>Project Page</a> | <a href='https://arxiv.org/pdf/2302.07387.pdf' target='_blank'>Paper</a> | <a href='https://github.com/amazon-science/polygon-transformer' target='_blank'>Github Repo</a></p>
|
29 |
+
<p style='text-align: center'> Demo of PolyFormer for referring image segmentation and referring expression comprehension. Upload your own image or click any one of the examples, and write a description about a certain object. Then click \"Submit\" and wait for the result of grounding.</p>
|
30 |
+
<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings.
|
31 |
+
<br/>
|
32 |
+
<a href="https://huggingface.co/spaces/koajoel/PolyFormer?duplicate=true">
|
33 |
+
<img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
34 |
+
</p>
|
35 |
+
"""
|
36 |
+
|
37 |
+
examples = [['demo/bear.jpeg', 'a bear astronaut in the space'],
|
38 |
+
['demo/unicorn.jpeg', 'a unicorn doing computer vision research'],
|
39 |
+
['demo/pig.jpeg', 'a pig robot preparing a delicious meal'],
|
40 |
+
['demo/otta.png', 'a gentleman otter in a 19th century portrait'],
|
41 |
+
['demo/pikachu.jpeg', 'a pikachu fine-dining with a view to the Eiffel Tower'],
|
42 |
+
['demo/cabin.jpeg', 'a small cabin on top of a snowy mountain in the style of Disney art station']
|
43 |
+
]
|
44 |
io = gr.Interface(fn=visual_grounding, inputs=[gr.inputs.Image(type='pil'), "textbox"],
|
45 |
outputs=[gr.outputs.Image(label="output", type='numpy'), gr.outputs.Image(label="predicted mask", type='numpy')],
|
46 |
title=title, description=description, article=article, examples=examples,
|
47 |
allow_flagging=False, allow_screenshot=False)
|
48 |
+
io.launch(cache_examples=True)
|
49 |
+
# io.launch()
|
50 |
|
demo/bear.jpeg
ADDED
demo/cabin.jpeg
ADDED
demo/otta.png
ADDED
demo/pig.jpeg
ADDED
demo/pikachu.jpeg
ADDED
demo/unicorn.jpeg
ADDED