Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def infer(img, text_queries, score_threshold, model):
|
|
| 59 |
return result_labels
|
| 60 |
|
| 61 |
# def query_image(img, text_queries, owl_threshold, dino_threshold):
|
| 62 |
-
def query_image(img, text_queries, owl_threshold):
|
| 63 |
text_queries = text_queries
|
| 64 |
text_queries = text_queries.split(",")
|
| 65 |
owl_output = infer(img, text_queries, owl_threshold, "owl")
|
|
@@ -80,7 +80,12 @@ owl_output = gr.AnnotatedImage(label="OWL Output")
|
|
| 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=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
# outputs=[owl_output, dino_output],
|
| 85 |
outputs=[owl_output],
|
| 86 |
title="OWLv2 Demo",
|
|
|
|
| 59 |
return result_labels
|
| 60 |
|
| 61 |
# def query_image(img, text_queries, owl_threshold, dino_threshold):
|
| 62 |
+
def query_image(img, text_queries, owl_threshold, flag_output_korean):
|
| 63 |
text_queries = text_queries
|
| 64 |
text_queries = text_queries.split(",")
|
| 65 |
owl_output = infer(img, text_queries, owl_threshold, "owl")
|
|
|
|
| 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=[
|
| 84 |
+
gr.Image(label="Input Image"),
|
| 85 |
+
gr.Textbox(label="Candidate Labels", value=english_candidate_labels_string),
|
| 86 |
+
owl_threshold,
|
| 87 |
+
gr.Checkbox(label="Output labels Korean")
|
| 88 |
+
],
|
| 89 |
# outputs=[owl_output, dino_output],
|
| 90 |
outputs=[owl_output],
|
| 91 |
title="OWLv2 Demo",
|