Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -343,55 +343,179 @@ def analyze_outfit(input_img: Image.Image):
|
|
| 343 |
return category_html, None, f"Analysis complete ({category_label}), but error generating audio/response."
|
| 344 |
|
| 345 |
# --- Elite Fashion / Techno CSS (Keep your existing CSS) ---
|
| 346 |
-
custom_css = """:root {
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
.
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
.gradio-container { max-width: 850px !important; margin: auto !important; padding-top: 30px; }
|
| 367 |
-
.gr-row { gap: 25px !important; }
|
| 368 |
-
.result-score {
|
| 369 |
-
color: var(--text-color) !important;
|
| 370 |
-
font-size: 1.1em;
|
| 371 |
-
margin-top: 0; /* Adjust spacing as needed */
|
| 372 |
-
margin-bottom: 5px; /* Add space below score */
|
| 373 |
}
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
background: rgba(30, 30, 30, 0.55);
|
| 378 |
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 379 |
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
|
| 380 |
-
border-radius: 16px;
|
| 381 |
-
padding: 20px;
|
| 382 |
}
|
| 383 |
-
|
| 384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
.gr-button-primary:hover {
|
| 386 |
-
|
| 387 |
-
|
|
|
|
| 388 |
}
|
| 389 |
-
|
| 390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
.result-error {
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 395 |
}"""
|
| 396 |
|
| 397 |
# --- Gradio Interface (Using the custom CSS) ---
|
|
|
|
| 343 |
return category_html, None, f"Analysis complete ({category_label}), but error generating audio/response."
|
| 344 |
|
| 345 |
# --- Elite Fashion / Techno CSS (Keep your existing CSS) ---
|
| 346 |
+
custom_css = """:root {
|
| 347 |
+
--primary-bg-color: #0D0D0D;
|
| 348 |
+
--secondary-bg-color: #1A1A1A;
|
| 349 |
+
--text-color: #FFFFFF;
|
| 350 |
+
--accent-color: #7F5AF0; /* Electric purple */
|
| 351 |
+
--accent-hover: #C084FC;
|
| 352 |
+
--success-color: #2CB67D;
|
| 353 |
+
--error-color: #F25F4C;
|
| 354 |
+
--border-color: #2F2F2F;
|
| 355 |
+
--input-bg-color: #1A1A1A;
|
| 356 |
+
--button-text-color: #FFFFFF;
|
| 357 |
+
--body-text-size: 16px;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
body,
|
| 361 |
+
.gradio-container {
|
| 362 |
+
background-color: var(--primary-bg-color) !important;
|
| 363 |
+
color: var(--text-color) !important;
|
| 364 |
+
font-family: 'Inter', 'Segoe UI', sans-serif;
|
| 365 |
+
font-size: var(--body-text-size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
}
|
| 367 |
+
|
| 368 |
+
footer {
|
| 369 |
+
display: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
}
|
| 371 |
+
|
| 372 |
+
.gr-block {
|
| 373 |
+
background-color: var(--secondary-bg-color) !important;
|
| 374 |
+
border: 1px solid var(--border-color) !important;
|
| 375 |
+
border-radius: 16px !important;
|
| 376 |
+
padding: 20px !important;
|
| 377 |
+
box-shadow: 0 0 15px rgba(127, 90, 240, 0.1);
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
.gr-input,
|
| 381 |
+
.gr-output,
|
| 382 |
+
.gr-textbox textarea,
|
| 383 |
+
.gr-dropdown select,
|
| 384 |
+
.gr-checkboxgroup input {
|
| 385 |
+
background-color: var(--input-bg-color) !important;
|
| 386 |
+
color: var(--text-color) !important;
|
| 387 |
+
border: 1px solid var(--border-color) !important;
|
| 388 |
+
border-radius: 10px !important;
|
| 389 |
+
padding: 10px;
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
.gr-textbox textarea::placeholder {
|
| 393 |
+
color: #888888 !important;
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
.gr-label span,
|
| 397 |
+
.gr-label .label-text {
|
| 398 |
+
color: var(--text-color) !important;
|
| 399 |
+
font-weight: 500 !important;
|
| 400 |
+
font-size: 0.95em !important;
|
| 401 |
+
margin-bottom: 8px !important;
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
.gr-image {
|
| 405 |
+
background-color: var(--primary-bg-color) !important;
|
| 406 |
+
border: 2px dashed var(--border-color) !important;
|
| 407 |
+
border-radius: 12px !important;
|
| 408 |
+
overflow: hidden;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
.gr-image img {
|
| 412 |
+
border-radius: 10px !important;
|
| 413 |
+
object-fit: contain;
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
.gr-image .no-image,
|
| 417 |
+
.gr-image .upload-button {
|
| 418 |
+
color: #AAAAAA !important;
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
+
.gr-audio > div:first-of-type {
|
| 422 |
+
border: 1px solid var(--border-color) !important;
|
| 423 |
+
background-color: var(--secondary-bg-color) !important;
|
| 424 |
+
border-radius: 10px !important;
|
| 425 |
+
padding: 12px !important;
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
.gr-audio audio {
|
| 429 |
+
width: 100%;
|
| 430 |
+
filter: invert(1) hue-rotate(180deg);
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
.gr-button {
|
| 434 |
+
border: none !important;
|
| 435 |
+
border-radius: 10px !important;
|
| 436 |
+
transition: background-color 0.2s ease, transform 0.1s ease;
|
| 437 |
+
font-weight: 600 !important;
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
.gr-button-primary {
|
| 441 |
+
background-color: var(--accent-color) !important;
|
| 442 |
+
color: var(--button-text-color) !important;
|
| 443 |
+
font-size: 1.1em !important;
|
| 444 |
+
padding: 14px 24px !important;
|
| 445 |
+
letter-spacing: 0.5px;
|
| 446 |
+
text-transform: uppercase;
|
| 447 |
+
box-shadow: 0 0 10px rgba(127, 90, 240, 0.2);
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
.gr-button-primary:hover {
|
| 451 |
+
background-color: var(--accent-hover) !important;
|
| 452 |
+
transform: scale(1.03);
|
| 453 |
+
box-shadow: 0 0 15px 3px rgba(192, 132, 252, 0.6);
|
| 454 |
}
|
| 455 |
+
|
| 456 |
+
.gr-button-primary:active {
|
| 457 |
+
transform: scale(0.97);
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
h1, h2, h3 {
|
| 461 |
+
color: var(--text-color) !important;
|
| 462 |
+
font-weight: 600;
|
| 463 |
+
letter-spacing: 0.5px;
|
| 464 |
+
}
|
| 465 |
+
|
| 466 |
+
.prose h1 {
|
| 467 |
+
text-align: center;
|
| 468 |
+
margin-bottom: 25px !important;
|
| 469 |
+
font-size: 2em !important;
|
| 470 |
+
text-transform: uppercase;
|
| 471 |
+
letter-spacing: 1.5px;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
.prose p {
|
| 475 |
+
color: #CCCCCC !important;
|
| 476 |
+
font-size: 0.95em;
|
| 477 |
+
text-align: center;
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
.results-container {
|
| 481 |
+
text-align: center;
|
| 482 |
+
padding: 20px;
|
| 483 |
+
border: 1px solid var(--accent-color);
|
| 484 |
+
border-radius: 16px;
|
| 485 |
+
background: linear-gradient(145deg, var(--secondary-bg-color), #2a2a2a);
|
| 486 |
+
backdrop-filter: blur(10px);
|
| 487 |
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
.result-category {
|
| 491 |
+
color: var(--accent-color) !important;
|
| 492 |
+
font-size: 1.6em;
|
| 493 |
+
margin-bottom: 5px;
|
| 494 |
+
font-weight: 700;
|
| 495 |
+
text-transform: uppercase;
|
| 496 |
+
letter-spacing: 1px;
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
.result-score {
|
| 500 |
+
color: var(--text-color) !important;
|
| 501 |
+
font-size: 1.2em;
|
| 502 |
+
margin-bottom: 5px;
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
.result-error {
|
| 506 |
+
color: var(--error-color) !important;
|
| 507 |
+
font-size: 0.9em;
|
| 508 |
+
margin-top: 5px;
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
.gradio-container {
|
| 512 |
+
max-width: 850px !important;
|
| 513 |
+
margin: auto !important;
|
| 514 |
+
padding-top: 30px;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.gr-row {
|
| 518 |
+
gap: 25px !important;
|
| 519 |
}"""
|
| 520 |
|
| 521 |
# --- Gradio Interface (Using the custom CSS) ---
|