Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -114,13 +114,25 @@ def load_example(model_name, images, prompt):
|
|
114 |
return model_name, images, prompt
|
115 |
|
116 |
# Create the second demo
|
117 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
gr.Markdown("# VQAScore Ranking\nThis model ranks a gallery of images based on their similarity to a text prompt.")
|
119 |
model_dropdown = gr.Dropdown(["clip-flant5-xl", "clip-flant5-xxl"], label="Model Name")
|
120 |
-
gallery = gr.Gallery(label="Generated Images", elem_id="input-gallery"
|
121 |
prompt = gr.Textbox(label="Prompt")
|
122 |
rank_button = gr.Button("Rank Images")
|
123 |
-
ranked_gallery = gr.Gallery(label="Ranked Images with Scores", elem_id="ranked-gallery"
|
124 |
|
125 |
rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
|
126 |
|
|
|
114 |
return model_name, images, prompt
|
115 |
|
116 |
# Create the second demo
|
117 |
+
with gr.Blocks(css="""
|
118 |
+
.input-gallery .gallery-item img {
|
119 |
+
max-width: 100px;
|
120 |
+
height: auto;
|
121 |
+
}
|
122 |
+
.ranked-gallery .gallery-item img {
|
123 |
+
max-width: 100px;
|
124 |
+
height: auto;
|
125 |
+
}
|
126 |
+
.ranked-gallery .gallery-item div {
|
127 |
+
font-size: 20px;
|
128 |
+
}
|
129 |
+
""") as demo_vqascore_ranking_beta:
|
130 |
gr.Markdown("# VQAScore Ranking\nThis model ranks a gallery of images based on their similarity to a text prompt.")
|
131 |
model_dropdown = gr.Dropdown(["clip-flant5-xl", "clip-flant5-xxl"], label="Model Name")
|
132 |
+
gallery = gr.Gallery(label="Generated Images", elem_id="input-gallery", columns=3, height=200, allow_preview=True)
|
133 |
prompt = gr.Textbox(label="Prompt")
|
134 |
rank_button = gr.Button("Rank Images")
|
135 |
+
ranked_gallery = gr.Gallery(label="Ranked Images with Scores", elem_id="ranked-gallery", columns=3, height=200, allow_preview=True)
|
136 |
|
137 |
rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
|
138 |
|