Gaejoon commited on
Commit
510c1ca
ยท
verified ยท
1 Parent(s): 90f022c

adjust sample threshold value

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -69,8 +69,8 @@ def query_image(img, text_queries, owl_threshold):
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")
@@ -86,6 +86,6 @@ demo = gr.Interface(
86
  title="OWLv2 Demo",
87
  description="Compare two state-of-the-art zero-shot object detection models [OWLv2](https://huggingface.co/google/owlv2-base-patch16) . Simply enter an image and the objects you want to find with comma, or try one of the examples. Play with the threshold to filter out low confidence predictions in each model.",
88
  # examples=[["./bee.jpg", "bee, flower", 0.16, 0.12], ["./cats.png", "cat, fishnet", 0.16, 0.12]]
89
- examples=[["./rs_sample1.jpg", english_candidate_labels_string, 0.16, 0.12], ["./rs_sample2.jpg", english_candidate_labels_string, 0.16, 0.12]]
90
  )
91
  demo.launch(debug=True)
 
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", "ear phone"]
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")
 
86
  title="OWLv2 Demo",
87
  description="Compare two state-of-the-art zero-shot object detection models [OWLv2](https://huggingface.co/google/owlv2-base-patch16) . Simply enter an image and the objects you want to find with comma, or try one of the examples. Play with the threshold to filter out low confidence predictions in each model.",
88
  # examples=[["./bee.jpg", "bee, flower", 0.16, 0.12], ["./cats.png", "cat, fishnet", 0.16, 0.12]]
89
+ examples=[["./rs_sample1.jpg", english_candidate_labels_string, 0.16, 0.12], ["./rs_sample2.jpg", english_candidate_labels_string, 0.13, 0.10]]
90
  )
91
  demo.launch(debug=True)