Spaces:
Running
Running
update app
Browse files
app.py
CHANGED
|
@@ -98,7 +98,15 @@ def infer(image, candidate_labels):
|
|
| 98 |
probs = metaclip_detector(image, candidate_labels)
|
| 99 |
return postprocess_metaclip(probs, labels=candidate_labels)
|
| 100 |
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
gr.Markdown("# **MetaCLIP 2 Zero-Shot Classification**")
|
| 103 |
gr.Markdown(
|
| 104 |
"Test the performance of MetaCLIP 2 on zero-shot classification in this Space"
|
|
@@ -107,7 +115,7 @@ with gr.Blocks(theme=orange_red_theme) as demo:
|
|
| 107 |
with gr.Column():
|
| 108 |
image_input = gr.Image(type="pil")
|
| 109 |
text_input = gr.Textbox(label="Input a list of labels (comma seperated)")
|
| 110 |
-
run_button = gr.Button("Run",
|
| 111 |
with gr.Column():
|
| 112 |
metaclip_output = gr.Label(label="MetaCLIP 2 Output", num_top_classes=3)
|
| 113 |
|
|
|
|
| 98 |
probs = metaclip_detector(image, candidate_labels)
|
| 99 |
return postprocess_metaclip(probs, labels=candidate_labels)
|
| 100 |
|
| 101 |
+
css="""
|
| 102 |
+
#col-container {
|
| 103 |
+
margin: 0 auto;
|
| 104 |
+
max-width: 960px;
|
| 105 |
+
}
|
| 106 |
+
#main-title h1 {font-size: 2.1em !important;}
|
| 107 |
+
"""
|
| 108 |
+
|
| 109 |
+
with gr.Blocks(css=css, theme=orange_red_theme) as demo:
|
| 110 |
gr.Markdown("# **MetaCLIP 2 Zero-Shot Classification**")
|
| 111 |
gr.Markdown(
|
| 112 |
"Test the performance of MetaCLIP 2 on zero-shot classification in this Space"
|
|
|
|
| 115 |
with gr.Column():
|
| 116 |
image_input = gr.Image(type="pil")
|
| 117 |
text_input = gr.Textbox(label="Input a list of labels (comma seperated)")
|
| 118 |
+
run_button = gr.Button("Run", variant="primary")
|
| 119 |
with gr.Column():
|
| 120 |
metaclip_output = gr.Label(label="MetaCLIP 2 Output", num_top_classes=3)
|
| 121 |
|