Gaejoon commited on
Commit
e9ba9c7
ยท
verified ยท
1 Parent(s): 78d8c4b

Update app.py

Browse files

add - initial input strings

Files changed (1) hide show
  1. app.py +4 -1
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="Candidate Labels"), owl_threshold],
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",