Spaces:
Sleeping
Sleeping
Avishek8136 commited on
Commit ·
cce5403
1
Parent(s): eed65a1
Complete UI Redesign with Premium Glassmorphism Theme
Browse files
app.py
CHANGED
|
@@ -473,22 +473,53 @@ def generate_pdf_report(history: list, logs: str) -> str | None:
|
|
| 473 |
pdf.output(tf.name)
|
| 474 |
return tf.name
|
| 475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 476 |
CSS = """
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
.
|
| 480 |
-
|
| 481 |
-
.main-header {
|
| 482 |
-
|
| 483 |
-
.
|
| 484 |
-
.upload-box { border: 2px dashed
|
| 485 |
-
.upload-box
|
| 486 |
-
|
| 487 |
-
.
|
| 488 |
-
.
|
| 489 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 490 |
footer { visibility: hidden; }
|
| 491 |
-
@keyframes
|
| 492 |
"""
|
| 493 |
|
| 494 |
def create_gradio_ui():
|
|
@@ -534,7 +565,7 @@ def create_gradio_ui():
|
|
| 534 |
hist = (hist or []) + [{"role": "user", "content": "👤 " + (msg or "[Image]")}, {"role": "assistant", "content": "🤖 " + answer}]
|
| 535 |
return hist, "", state, logs
|
| 536 |
|
| 537 |
-
with gr.Blocks(title="HyperDerm — AI Dermatology", css=CSS, theme=
|
| 538 |
gr.HTML('<div class="main-header"><h1>🏥 HyperDerm</h1><p>AI Dermatology — Neo4j Graph + NVIDIA Vision · 245 Diseases · 5 Agents</p></div>')
|
| 539 |
|
| 540 |
with gr.Row(equal_height=True):
|
|
|
|
| 473 |
pdf.output(tf.name)
|
| 474 |
return tf.name
|
| 475 |
|
| 476 |
+
custom_theme = gr.themes.Base(
|
| 477 |
+
primary_hue="cyan",
|
| 478 |
+
secondary_hue="indigo",
|
| 479 |
+
neutral_hue="slate",
|
| 480 |
+
font=[gr.themes.GoogleFont("Outfit"), "sans-serif"],
|
| 481 |
+
).set(
|
| 482 |
+
body_background_fill="linear-gradient(135deg, #09090b 0%, #18181b 100%)",
|
| 483 |
+
body_text_color="#f8fafc",
|
| 484 |
+
block_background_fill="rgba(39, 39, 42, 0.4)",
|
| 485 |
+
block_border_width="1px",
|
| 486 |
+
block_border_color="rgba(255, 255, 255, 0.08)",
|
| 487 |
+
block_radius="16px",
|
| 488 |
+
button_primary_background_fill="linear-gradient(135deg, #0ea5e9, #6366f1)",
|
| 489 |
+
button_primary_text_color="white",
|
| 490 |
+
button_primary_border_color="transparent",
|
| 491 |
+
button_secondary_background_fill="rgba(255, 255, 255, 0.05)",
|
| 492 |
+
button_secondary_border_color="rgba(255, 255, 255, 0.1)",
|
| 493 |
+
button_secondary_text_color="#f8fafc",
|
| 494 |
+
input_background_fill="rgba(0, 0, 0, 0.2)",
|
| 495 |
+
input_border_color="rgba(255, 255, 255, 0.1)",
|
| 496 |
+
)
|
| 497 |
+
|
| 498 |
CSS = """
|
| 499 |
+
.gradio-container { max-width: 1200px !important; margin: 0 auto !important; }
|
| 500 |
+
body { background: transparent !important; }
|
| 501 |
+
.main-header { text-align: center; padding: 30px 0 10px; animation: fadeInDown 0.8s ease-out; }
|
| 502 |
+
.main-header h1 { background: -webkit-linear-gradient(45deg, #0ea5e9, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 3.5rem; font-weight: 800; margin: 0; letter-spacing: -1px; }
|
| 503 |
+
.main-header p { color: #94a3b8; font-size: 1.15rem; margin: 8px 0 0; font-weight: 300; }
|
| 504 |
+
|
| 505 |
+
.upload-box, .output-panel { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4); }
|
| 506 |
+
.upload-box { border: 2px dashed rgba(255, 255, 255, 0.15) !important; padding: 25px; text-align: center; min-height: 240px; transition: all 0.3s ease; }
|
| 507 |
+
.upload-box:hover { border-color: #0ea5e9 !important; background: rgba(39, 39, 42, 0.6) !important; }
|
| 508 |
+
|
| 509 |
+
.chatbot { border: none !important; background: transparent !important; }
|
| 510 |
+
.message.user { background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.15)) !important; border: 1px solid rgba(14, 165, 233, 0.3) !important; }
|
| 511 |
+
.message.bot { background: rgba(0, 0, 0, 0.2) !important; border: 1px solid rgba(255, 255, 255, 0.05) !important; }
|
| 512 |
+
|
| 513 |
+
.log-panel { background: rgba(9, 9, 11, 0.8) !important; border: 1px solid rgba(255, 255, 255, 0.05) !important; border-radius: 12px; padding: 16px; font-size: 12.5px; font-family: 'JetBrains Mono', 'Courier New', monospace; color: #34d399 !important; box-shadow: inset 0 4px 20px rgba(0,0,0,0.6); line-height: 1.6; max-height: 300px; overflow-y: auto; }
|
| 514 |
+
|
| 515 |
+
.diagnose-btn { box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3) !important; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; }
|
| 516 |
+
.diagnose-btn:hover { transform: translateY(-3px) scale(1.02) !important; box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5) !important; }
|
| 517 |
+
|
| 518 |
+
.test-gallery img { border-radius: 12px; border: 2px solid transparent; transition: all 0.4s ease; cursor: pointer; }
|
| 519 |
+
.test-gallery img:hover { border-color: #0ea5e9; transform: scale(1.08) translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.4); }
|
| 520 |
+
|
| 521 |
footer { visibility: hidden; }
|
| 522 |
+
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
|
| 523 |
"""
|
| 524 |
|
| 525 |
def create_gradio_ui():
|
|
|
|
| 565 |
hist = (hist or []) + [{"role": "user", "content": "👤 " + (msg or "[Image]")}, {"role": "assistant", "content": "🤖 " + answer}]
|
| 566 |
return hist, "", state, logs
|
| 567 |
|
| 568 |
+
with gr.Blocks(title="HyperDerm — AI Dermatology", css=CSS, theme=custom_theme) as gradio_ui_blocks:
|
| 569 |
gr.HTML('<div class="main-header"><h1>🏥 HyperDerm</h1><p>AI Dermatology — Neo4j Graph + NVIDIA Vision · 245 Diseases · 5 Agents</p></div>')
|
| 570 |
|
| 571 |
with gr.Row(equal_height=True):
|