Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,16 +25,16 @@ def show_image_pair(pair_id):
|
|
25 |
try:
|
26 |
record = df[df['pair_id'] == pair_id].iloc[0]
|
27 |
except IndexError:
|
28 |
-
return None, None, "Invalid Pair ID.", "",
|
29 |
|
30 |
img1_path = os.path.join(current_dir, record['image1'])
|
31 |
img2_path = os.path.join(current_dir, record['image2'])
|
32 |
|
33 |
# Check if images exist
|
34 |
if not os.path.isfile(img1_path):
|
35 |
-
return None, None, "Image 1 not found.", "",
|
36 |
if not os.path.isfile(img2_path):
|
37 |
-
return None, None, "Image 2 not found.", "",
|
38 |
|
39 |
try:
|
40 |
img1 = Image.open(img1_path)
|
@@ -76,21 +76,21 @@ with gr.Blocks() as demo:
|
|
76 |
with gr.Column(scale=2):
|
77 |
label1 = gr.Textbox(label="Label 1", interactive=False, lines=1)
|
78 |
with gr.Column(scale=1):
|
79 |
-
label1_score = gr.
|
80 |
|
81 |
# Label 2 and Label 2 Score Row
|
82 |
with gr.Row():
|
83 |
with gr.Column(scale=2):
|
84 |
label2 = gr.Textbox(label="Label 2", interactive=False, lines=1)
|
85 |
with gr.Column(scale=1):
|
86 |
-
label2_score = gr.
|
87 |
|
88 |
# Label 3 and Label 3 Score Row
|
89 |
with gr.Row():
|
90 |
with gr.Column(scale=2):
|
91 |
label3 = gr.Textbox(label="Label 3", interactive=False, lines=1)
|
92 |
with gr.Column(scale=1):
|
93 |
-
label3_score = gr.
|
94 |
|
95 |
# Prompt Row
|
96 |
with gr.Row():
|
|
|
25 |
try:
|
26 |
record = df[df['pair_id'] == pair_id].iloc[0]
|
27 |
except IndexError:
|
28 |
+
return None, None, "Invalid Pair ID.", "", "", "", "", "", ""
|
29 |
|
30 |
img1_path = os.path.join(current_dir, record['image1'])
|
31 |
img2_path = os.path.join(current_dir, record['image2'])
|
32 |
|
33 |
# Check if images exist
|
34 |
if not os.path.isfile(img1_path):
|
35 |
+
return None, None, "Image 1 not found.", "", "", "", "", "", ""
|
36 |
if not os.path.isfile(img2_path):
|
37 |
+
return None, None, "Image 2 not found.", "", "", "", "", "", ""
|
38 |
|
39 |
try:
|
40 |
img1 = Image.open(img1_path)
|
|
|
76 |
with gr.Column(scale=2):
|
77 |
label1 = gr.Textbox(label="Label 1", interactive=False, lines=1)
|
78 |
with gr.Column(scale=1):
|
79 |
+
label1_score = gr.Textbox(label="Label 1 Score", interactive=False, lines=1)
|
80 |
|
81 |
# Label 2 and Label 2 Score Row
|
82 |
with gr.Row():
|
83 |
with gr.Column(scale=2):
|
84 |
label2 = gr.Textbox(label="Label 2", interactive=False, lines=1)
|
85 |
with gr.Column(scale=1):
|
86 |
+
label2_score = gr.Textbox(label="Label 2 Score", interactive=False, lines=1)
|
87 |
|
88 |
# Label 3 and Label 3 Score Row
|
89 |
with gr.Row():
|
90 |
with gr.Column(scale=2):
|
91 |
label3 = gr.Textbox(label="Label 3", interactive=False, lines=1)
|
92 |
with gr.Column(scale=1):
|
93 |
+
label3_score = gr.Textbox(label="Label 3 Score", interactive=False, lines=1)
|
94 |
|
95 |
# Prompt Row
|
96 |
with gr.Row():
|