Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -261,26 +261,27 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css_custom) as demo:
|
|
261 |
with gr.TabItem("Per-Image Quality Evaluation"):
|
262 |
gr.Markdown(f"Upload a batch of images (up to **{MAX_IMAGES_PER_BATCH}**) to get individual quality scores. Images are processed in the browser's session.")
|
263 |
|
264 |
-
# Using gr.Files which allows multiple uploads and returns a list of TemporaryFileWrapper objects
|
265 |
image_upload_input = gr.Files(
|
266 |
label=f"Upload Images (max {MAX_IMAGES_PER_BATCH}, .png, .jpg, .jpeg, .bmp, .webp)",
|
267 |
file_count="multiple",
|
268 |
-
type="filepath"
|
269 |
)
|
270 |
|
271 |
evaluate_button_main = gr.Button("🖼️ Evaluate Uploaded Images", variant="primary")
|
272 |
|
273 |
gr.Markdown("---")
|
274 |
status_output_main = gr.Textbox(label="📊 Evaluation Status", interactive=False, lines=2)
|
275 |
-
# batch_is_output = gr.Textbox(label="Overall Inception Score (IS) for Batch", interactive=False, lines=1) # IS deferred
|
276 |
-
# batch_fid_output_info = gr.Textbox(label="Overall Fréchet Inception Distance (FID) for Batch", interactive=False, lines=1) # FID separate
|
277 |
|
278 |
gr.Markdown("### 🖼️ Per-Image Evaluation Results")
|
279 |
gr.Markdown("Click column headers to sort. Previews are thumbnails.")
|
|
|
280 |
results_table_output = gr.DataFrame(
|
281 |
headers=["Preview", "Filename", "BRISQUE (PIQ) (↓)", "NIQE (IQA-PyTorch) (↓)", "MUSIQ-NR (IQA-PyTorch) (↑)"],
|
282 |
datatype=["html", "str", "number", "number", "number"],
|
283 |
-
interactive=False,
|
|
|
|
|
|
|
284 |
)
|
285 |
|
286 |
with gr.TabItem("↔️ Calculate FID (Set vs. Set)"):
|
|
|
261 |
with gr.TabItem("Per-Image Quality Evaluation"):
|
262 |
gr.Markdown(f"Upload a batch of images (up to **{MAX_IMAGES_PER_BATCH}**) to get individual quality scores. Images are processed in the browser's session.")
|
263 |
|
|
|
264 |
image_upload_input = gr.Files(
|
265 |
label=f"Upload Images (max {MAX_IMAGES_PER_BATCH}, .png, .jpg, .jpeg, .bmp, .webp)",
|
266 |
file_count="multiple",
|
267 |
+
type="filepath"
|
268 |
)
|
269 |
|
270 |
evaluate_button_main = gr.Button("🖼️ Evaluate Uploaded Images", variant="primary")
|
271 |
|
272 |
gr.Markdown("---")
|
273 |
status_output_main = gr.Textbox(label="📊 Evaluation Status", interactive=False, lines=2)
|
|
|
|
|
274 |
|
275 |
gr.Markdown("### 🖼️ Per-Image Evaluation Results")
|
276 |
gr.Markdown("Click column headers to sort. Previews are thumbnails.")
|
277 |
+
# MODIFIED LINE BELOW:
|
278 |
results_table_output = gr.DataFrame(
|
279 |
headers=["Preview", "Filename", "BRISQUE (PIQ) (↓)", "NIQE (IQA-PyTorch) (↓)", "MUSIQ-NR (IQA-PyTorch) (↑)"],
|
280 |
datatype=["html", "str", "number", "number", "number"],
|
281 |
+
interactive=False,
|
282 |
+
wrap=True,
|
283 |
+
overflow_row_behaviour="paginate", # max_rows removed
|
284 |
+
# height=450 # Optional: Set a fixed height in pixels if you want ~15 rows visible before scrolling within the component
|
285 |
)
|
286 |
|
287 |
with gr.TabItem("↔️ Calculate FID (Set vs. Set)"):
|