Update app.py
Browse files
app.py
CHANGED
|
@@ -55,13 +55,13 @@ def format_face_comparison_result(result, img1_path, img2_path):
|
|
| 55 |
# Matching results in the new table format
|
| 56 |
if matches:
|
| 57 |
html += """
|
| 58 |
-
<div
|
| 59 |
<div class="matches-table">
|
| 60 |
<table>
|
| 61 |
<thead>
|
| 62 |
<tr>
|
| 63 |
-
<th>First
|
| 64 |
-
<th>Second
|
| 65 |
<th>Similarity Score</th>
|
| 66 |
<th>Result</th>
|
| 67 |
</tr>
|
|
@@ -155,8 +155,7 @@ def get_custom_css():
|
|
| 155 |
/* Header styling - logo and text in same line */
|
| 156 |
.company-header {
|
| 157 |
background: var(--background-fill-primary);
|
| 158 |
-
padding:
|
| 159 |
-
margin-bottom: 25px;
|
| 160 |
text-align: center;
|
| 161 |
width: 100%;
|
| 162 |
display: flex;
|
|
@@ -181,87 +180,21 @@ def get_custom_css():
|
|
| 181 |
|
| 182 |
.header-text h1 {
|
| 183 |
font-size: 2.4em !important;
|
| 184 |
-
margin-bottom: 12px;
|
| 185 |
font-weight: 700;
|
| 186 |
-
margin-top: 0;
|
| 187 |
color: var(--body-text-color);
|
| 188 |
}
|
| 189 |
|
| 190 |
.header-text p {
|
| 191 |
font-size: 1.3em !important;
|
| 192 |
-
margin-bottom: 0;
|
| 193 |
color: var(--body-text-color);
|
| 194 |
opacity: 0.8;
|
| 195 |
}
|
| 196 |
|
| 197 |
-
/* About section layout */
|
| 198 |
-
.about-section {
|
| 199 |
-
width: 100%;
|
| 200 |
-
margin-bottom: 25px;
|
| 201 |
-
}
|
| 202 |
-
|
| 203 |
-
.about-content {
|
| 204 |
-
display: flex;
|
| 205 |
-
gap: 25px;
|
| 206 |
-
width: 100%;
|
| 207 |
-
}
|
| 208 |
-
|
| 209 |
-
.features-section {
|
| 210 |
-
flex: 0.6;
|
| 211 |
-
padding: 25px;
|
| 212 |
-
background: var(--background-fill-secondary);
|
| 213 |
-
border-radius: 10px;
|
| 214 |
-
font-size: 1.05em !important;
|
| 215 |
-
}
|
| 216 |
-
|
| 217 |
-
.demo-items-section {
|
| 218 |
-
flex: 0.4;
|
| 219 |
-
padding: 10px;
|
| 220 |
-
background: var(--background-fill-secondary);
|
| 221 |
-
border-radius: 10px;
|
| 222 |
-
}
|
| 223 |
-
|
| 224 |
-
.demo-items-grid {
|
| 225 |
-
display: grid;
|
| 226 |
-
grid-template-columns: repeat(2, 1fr);
|
| 227 |
-
gap: 15px;
|
| 228 |
-
}
|
| 229 |
-
|
| 230 |
-
.demo-item {
|
| 231 |
-
background: var(--background-fill-primary);
|
| 232 |
-
padding: 4px;
|
| 233 |
-
border-radius: 8px;
|
| 234 |
-
text-align: center;
|
| 235 |
-
transition: background-color 0.2s ease;
|
| 236 |
-
display: flex;
|
| 237 |
-
flex-direction: column;
|
| 238 |
-
align-items: center;
|
| 239 |
-
justify-content: center;
|
| 240 |
-
text-decoration: none;
|
| 241 |
-
color: var(--body-text-color);
|
| 242 |
-
font-size: 1em !important;
|
| 243 |
-
}
|
| 244 |
-
|
| 245 |
-
.demo-item:hover {
|
| 246 |
-
background: var(--button-secondary-background-fill-hover);
|
| 247 |
-
}
|
| 248 |
-
|
| 249 |
-
.demo-item img {
|
| 250 |
-
height: 30px;
|
| 251 |
-
margin-bottom: 10px;
|
| 252 |
-
}
|
| 253 |
-
|
| 254 |
-
.demo-item span {
|
| 255 |
-
font-size: 0.95em !important;
|
| 256 |
-
font-weight: 600;
|
| 257 |
-
}
|
| 258 |
-
|
| 259 |
/* Main content layout */
|
| 260 |
.main-content-row {
|
| 261 |
display: flex;
|
| 262 |
gap: 25px;
|
| 263 |
width: 100%;
|
| 264 |
-
margin-bottom: 25px;
|
| 265 |
}
|
| 266 |
|
| 267 |
.upload-section {
|
|
@@ -307,9 +240,8 @@ def get_custom_css():
|
|
| 307 |
/* Result container styling */
|
| 308 |
.result-container {
|
| 309 |
background: var(--background-fill-primary);
|
| 310 |
-
padding:
|
| 311 |
border-radius: 10px;
|
| 312 |
-
margin-top: 0;
|
| 313 |
width: 100%;
|
| 314 |
text-align: center;
|
| 315 |
height: fit-content;
|
|
@@ -324,13 +256,12 @@ def get_custom_css():
|
|
| 324 |
display: grid;
|
| 325 |
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
| 326 |
gap: 15px;
|
| 327 |
-
margin-top: 20px;
|
| 328 |
justify-content: center;
|
| 329 |
}
|
| 330 |
|
| 331 |
.detection-card {
|
| 332 |
background: var(--background-fill-secondary);
|
| 333 |
-
padding:
|
| 334 |
border-radius: 8px;
|
| 335 |
text-align: center;
|
| 336 |
display: flex;
|
|
@@ -343,7 +274,6 @@ def get_custom_css():
|
|
| 343 |
height: 60px;
|
| 344 |
border-radius: 50%;
|
| 345 |
object-fit: cover;
|
| 346 |
-
margin-bottom: 10px;
|
| 347 |
}
|
| 348 |
|
| 349 |
.no-face {
|
|
@@ -364,7 +294,6 @@ def get_custom_css():
|
|
| 364 |
font-size: 0.9em !important;
|
| 365 |
color: var(--body-text-color);
|
| 366 |
opacity: 0.8;
|
| 367 |
-
margin-top: 8px;
|
| 368 |
}
|
| 369 |
|
| 370 |
/* Matching table - NEW STYLING */
|
|
@@ -378,15 +307,14 @@ def get_custom_css():
|
|
| 378 |
.matches-table table {
|
| 379 |
width: 100%;
|
| 380 |
border-collapse: collapse;
|
| 381 |
-
margin-top: 8px;
|
| 382 |
font-size: 1em !important;
|
| 383 |
-
min-width:
|
| 384 |
}
|
| 385 |
|
| 386 |
.matches-table th {
|
| 387 |
background: var(--background-fill-secondary);
|
| 388 |
color: var(--body-text-color);
|
| 389 |
-
padding:
|
| 390 |
text-align: center;
|
| 391 |
font-size: 1em !important;
|
| 392 |
font-weight: 700;
|
|
@@ -394,7 +322,7 @@ def get_custom_css():
|
|
| 394 |
}
|
| 395 |
|
| 396 |
.matches-table td {
|
| 397 |
-
padding:
|
| 398 |
border-bottom: 1px solid var(--border-color-primary);
|
| 399 |
text-align: center;
|
| 400 |
font-size: 0.95em !important;
|
|
@@ -551,7 +479,7 @@ with gr.Blocks(
|
|
| 551 |
# Results Section
|
| 552 |
with gr.Column(scale=0.4, elem_classes="result-section"):
|
| 553 |
txt_compare_out = gr.HTML(
|
| 554 |
-
value="<div style='text-align: center; padding:
|
| 555 |
)
|
| 556 |
|
| 557 |
# Connect the function
|
|
|
|
| 55 |
# Matching results in the new table format
|
| 56 |
if matches:
|
| 57 |
html += """
|
| 58 |
+
<div>
|
| 59 |
<div class="matches-table">
|
| 60 |
<table>
|
| 61 |
<thead>
|
| 62 |
<tr>
|
| 63 |
+
<th>First Face</th>
|
| 64 |
+
<th>Second Face</th>
|
| 65 |
<th>Similarity Score</th>
|
| 66 |
<th>Result</th>
|
| 67 |
</tr>
|
|
|
|
| 155 |
/* Header styling - logo and text in same line */
|
| 156 |
.company-header {
|
| 157 |
background: var(--background-fill-primary);
|
| 158 |
+
padding: 10px;
|
|
|
|
| 159 |
text-align: center;
|
| 160 |
width: 100%;
|
| 161 |
display: flex;
|
|
|
|
| 180 |
|
| 181 |
.header-text h1 {
|
| 182 |
font-size: 2.4em !important;
|
|
|
|
| 183 |
font-weight: 700;
|
|
|
|
| 184 |
color: var(--body-text-color);
|
| 185 |
}
|
| 186 |
|
| 187 |
.header-text p {
|
| 188 |
font-size: 1.3em !important;
|
|
|
|
| 189 |
color: var(--body-text-color);
|
| 190 |
opacity: 0.8;
|
| 191 |
}
|
| 192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
/* Main content layout */
|
| 194 |
.main-content-row {
|
| 195 |
display: flex;
|
| 196 |
gap: 25px;
|
| 197 |
width: 100%;
|
|
|
|
| 198 |
}
|
| 199 |
|
| 200 |
.upload-section {
|
|
|
|
| 240 |
/* Result container styling */
|
| 241 |
.result-container {
|
| 242 |
background: var(--background-fill-primary);
|
| 243 |
+
padding: 4px;
|
| 244 |
border-radius: 10px;
|
|
|
|
| 245 |
width: 100%;
|
| 246 |
text-align: center;
|
| 247 |
height: fit-content;
|
|
|
|
| 256 |
display: grid;
|
| 257 |
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
| 258 |
gap: 15px;
|
|
|
|
| 259 |
justify-content: center;
|
| 260 |
}
|
| 261 |
|
| 262 |
.detection-card {
|
| 263 |
background: var(--background-fill-secondary);
|
| 264 |
+
padding: 4px;
|
| 265 |
border-radius: 8px;
|
| 266 |
text-align: center;
|
| 267 |
display: flex;
|
|
|
|
| 274 |
height: 60px;
|
| 275 |
border-radius: 50%;
|
| 276 |
object-fit: cover;
|
|
|
|
| 277 |
}
|
| 278 |
|
| 279 |
.no-face {
|
|
|
|
| 294 |
font-size: 0.9em !important;
|
| 295 |
color: var(--body-text-color);
|
| 296 |
opacity: 0.8;
|
|
|
|
| 297 |
}
|
| 298 |
|
| 299 |
/* Matching table - NEW STYLING */
|
|
|
|
| 307 |
.matches-table table {
|
| 308 |
width: 100%;
|
| 309 |
border-collapse: collapse;
|
|
|
|
| 310 |
font-size: 1em !important;
|
| 311 |
+
min-width: 450px;
|
| 312 |
}
|
| 313 |
|
| 314 |
.matches-table th {
|
| 315 |
background: var(--background-fill-secondary);
|
| 316 |
color: var(--body-text-color);
|
| 317 |
+
padding: 4px 2px !important;
|
| 318 |
text-align: center;
|
| 319 |
font-size: 1em !important;
|
| 320 |
font-weight: 700;
|
|
|
|
| 322 |
}
|
| 323 |
|
| 324 |
.matches-table td {
|
| 325 |
+
padding: 4px 2px !important;
|
| 326 |
border-bottom: 1px solid var(--border-color-primary);
|
| 327 |
text-align: center;
|
| 328 |
font-size: 0.95em !important;
|
|
|
|
| 479 |
# Results Section
|
| 480 |
with gr.Column(scale=0.4, elem_classes="result-section"):
|
| 481 |
txt_compare_out = gr.HTML(
|
| 482 |
+
value="<div style='text-align: center; padding: 10px; font-size: 1.1em;'>Results will appear here after comparison</div>"
|
| 483 |
)
|
| 484 |
|
| 485 |
# Connect the function
|