Spaces:
Runtime error
Runtime error
Update app.py
Browse filesadd - initial input strings
app.py
CHANGED
|
@@ -69,6 +69,9 @@ def query_image(img, text_queries, owl_threshold):
|
|
| 69 |
# return (img, owl_output), (img, dino_output)
|
| 70 |
return (img, owl_output)
|
| 71 |
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
owl_threshold = gr.Slider(0, 1, value=0.16, label="OWL Threshold")
|
| 74 |
# dino_threshold = gr.Slider(0, 1, value=0.12, label="Grounding DINO Threshold")
|
|
@@ -77,7 +80,7 @@ owl_output = gr.AnnotatedImage(label="OWL Output")
|
|
| 77 |
demo = gr.Interface(
|
| 78 |
query_image,
|
| 79 |
# inputs=[gr.Image(label="Input Image"), gr.Textbox(label="Candidate Labels"), owl_threshold, dino_threshold],
|
| 80 |
-
inputs=[gr.Image(label="Input Image"), gr.Textbox(label=
|
| 81 |
# outputs=[owl_output, dino_output],
|
| 82 |
outputs=[owl_output],
|
| 83 |
title="OWLv2 Demo",
|
|
|
|
| 69 |
# return (img, owl_output), (img, dino_output)
|
| 70 |
return (img, owl_output)
|
| 71 |
|
| 72 |
+
english_candidate_labels = ["hat", "sunglass", "hair band", "glove", "arm sleeve", "watch", "singlet", "t-shirts", "energy gel", "half pants", "socks", "shoes"]
|
| 73 |
+
korean_candidate_labels = ["๋ชจ์", "์ฌ๊ธ๋ผ์ค", "ํค์ด๋ฐด๋", "์ฅ๊ฐ", "ํํ ์", "์๊ณ", "์ฑ๊ธ๋ ", "ํฐ์
์ธ ", "์๋์ง์ ค", "์ผ์ธ ๋ฐ์ง", "์๋ง", "์ ๋ฐ"]
|
| 74 |
+
english_candidate_labels_string = ",".join(english_candidate_labels)
|
| 75 |
|
| 76 |
owl_threshold = gr.Slider(0, 1, value=0.16, label="OWL Threshold")
|
| 77 |
# dino_threshold = gr.Slider(0, 1, value=0.12, label="Grounding DINO Threshold")
|
|
|
|
| 80 |
demo = gr.Interface(
|
| 81 |
query_image,
|
| 82 |
# inputs=[gr.Image(label="Input Image"), gr.Textbox(label="Candidate Labels"), owl_threshold, dino_threshold],
|
| 83 |
+
inputs=[gr.Image(label="Input Image"), gr.Textbox(label=english_candidate_labels_string), owl_threshold],
|
| 84 |
# outputs=[owl_output, dino_output],
|
| 85 |
outputs=[owl_output],
|
| 86 |
title="OWLv2 Demo",
|