jiang commited on
Commit
b667410
โ€ข
1 Parent(s): 4eb0453
Files changed (9) hide show
  1. .DS_Store +0 -0
  2. README.md +2 -2
  3. app.py +20 -17
  4. demo/bear.jpeg +0 -0
  5. demo/cabin.jpeg +0 -0
  6. demo/otta.png +0 -0
  7. demo/pig.jpeg +0 -0
  8. demo/pikachu.jpeg +0 -0
  9. 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: afl-3.0
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-Visual_Grounding"
27
- description = "Gradio Demo for PolyFormer-Visual_Grounding. Upload your own image or click any one of the examples, " \
28
- "and write a description about a certain object. " \
29
- "Then click \"Submit\" and wait for the result of grounding. For help or to provide feedback, please contact: Hui Ding (@huidin)"
30
- article = "<p style='text-align: center'><a href='https://arxiv.org/pdf/2302.07387.pdf' target='_blank'>PolyFormer CVPR2023" \
31
- "</a></p> "
32
- # examples = [['A bear astronaut in the space.jpeg', 'a bear astronaut in the space'],
33
- # ['A unicorn doing computer vision research.jpeg', 'a unicorn doing computer vision research'],
34
- # ['pig.jpeg', 'a pig robot preparing a delicious meal'],
35
- # ['otta.png', 'a gentleman otter in a 19th century portrait'],
36
- # ['pikachu.jpeg', 'a pikachu fine-dining with a view to the Eiffel Tower'],
37
- # ['A small cabin on top of a snowy mountain in the style of Disney artstation.jpeg', 'a small cabin on top of a snowy mountain in the style of Disney artstation'],
38
- #
39
- # ]
40
- examples = []
 
 
 
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
- # io.launch(cache_examples=True)
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