Spaces:
Sleeping
Sleeping
dcavadia commited on
Commit Β·
14680c1
1
Parent(s): 8f09793
update style
Browse files- src/ui/styles.py +68 -49
src/ui/styles.py
CHANGED
|
@@ -21,6 +21,35 @@ def get_custom_css() -> str:
|
|
| 21 |
.gradio-container { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
|
| 22 |
.gr-button { transition: all 0.2s ease; }
|
| 23 |
.gr-button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
"""
|
| 25 |
|
| 26 |
def create_theme():
|
|
@@ -38,57 +67,46 @@ def create_theme():
|
|
| 38 |
def get_header_html() -> str:
|
| 39 |
"""Get HTML for application header."""
|
| 40 |
return """
|
| 41 |
-
<div class="header">
|
| 42 |
-
<
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
</h1>
|
| 48 |
-
<span class="badge" style="background: #f1f5f9; color: #334155; font-weight: 600;">
|
| 49 |
-
Research Project
|
| 50 |
-
</span>
|
| 51 |
-
<span class="badge" style="background: #dcfce7; color: #166534; font-weight: 600;">
|
| 52 |
-
Live Demo
|
| 53 |
-
</span>
|
| 54 |
-
</div>
|
| 55 |
|
| 56 |
-
<
|
| 57 |
-
|
| 58 |
-
</
|
| 59 |
|
| 60 |
-
<
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
<
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
<div>π¬ <strong>Domain:</strong> Computer Vision in Medical Diagnostics</div>
|
| 67 |
-
<div>π― <strong>Achievement:</strong> 94% Classification Accuracy</div>
|
| 68 |
-
<div>β‘ <strong>Architecture:</strong> NFNet + ONNX Runtime Optimization</div>
|
| 69 |
-
</div>
|
| 70 |
-
</div>
|
| 71 |
|
| 72 |
-
<p style="margin
|
| 73 |
<strong>Upload a dermatoscopic image</strong> to experience real-time CNN inference with
|
| 74 |
comprehensive medical information retrieval. This system demonstrates production-ready
|
| 75 |
-
AI deployment
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
| 78 |
</p>
|
| 79 |
</div>
|
| 80 |
"""
|
| 81 |
|
| 82 |
-
|
| 83 |
def get_footer_html() -> str:
|
| 84 |
"""Get HTML for application footer."""
|
| 85 |
from ..config.settings import AppConfig
|
| 86 |
|
| 87 |
return f"""
|
| 88 |
-
<div
|
| 89 |
-
|
|
|
|
| 90 |
|
| 91 |
-
<div>
|
| 92 |
<h4 style="color: #1e293b; margin: 0 0 8px 0; font-size: 14px;">π Academic Research</h4>
|
| 93 |
<p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
|
| 94 |
<strong>Institution:</strong> {AppConfig.INSTITUTION}<br>
|
|
@@ -97,27 +115,27 @@ def get_footer_html() -> str:
|
|
| 97 |
</p>
|
| 98 |
</div>
|
| 99 |
|
| 100 |
-
<div>
|
| 101 |
-
<h4 style="color: #1e293b; margin: 0 0 8px 0; font-size: 14px;">βοΈ Technical
|
| 102 |
<p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
|
| 103 |
-
<strong>Model:</strong> NFNet-L0 (
|
| 104 |
-
<strong>Optimization:</strong> ONNX Runtime
|
| 105 |
<strong>Deployment:</strong> Gradio + HuggingFace Spaces
|
| 106 |
</p>
|
| 107 |
</div>
|
| 108 |
|
| 109 |
-
<div>
|
| 110 |
-
<h4 style="color: #1e293b; margin: 0 0 8px 0; font-size: 14px;">π Performance
|
| 111 |
<p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
|
| 112 |
-
<strong>Accuracy:</strong> 94%
|
| 113 |
-
<strong>Latency:</strong> <50ms inference
|
| 114 |
<strong>Efficiency:</strong> 99.8% parameter reduction
|
| 115 |
</p>
|
| 116 |
</div>
|
| 117 |
|
| 118 |
</div>
|
| 119 |
|
| 120 |
-
<div style="border-top: 1px solid #e2e8f0;
|
| 121 |
<p style="margin: 0; font-size: 11px; color: #94a3b8;">
|
| 122 |
Model Version: {AppConfig.VERSION} β’ Last Updated: {AppConfig.LAST_UPDATE} β’
|
| 123 |
Research & Development by Daniel Cavadia
|
|
@@ -126,12 +144,13 @@ def get_footer_html() -> str:
|
|
| 126 |
</div>
|
| 127 |
"""
|
| 128 |
|
| 129 |
-
|
| 130 |
def get_model_info_html() -> str:
|
| 131 |
"""Get HTML for model information."""
|
| 132 |
from ..config.settings import AppConfig
|
| 133 |
return (
|
| 134 |
-
"- Architecture: CNN exported to ONNX format<br>"
|
| 135 |
-
"- Training: Dermatoscopic dataset
|
| 136 |
-
|
|
|
|
|
|
|
| 137 |
)
|
|
|
|
| 21 |
.gradio-container { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
|
| 22 |
.gr-button { transition: all 0.2s ease; }
|
| 23 |
.gr-button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
|
| 24 |
+
|
| 25 |
+
/* Professional header styling */
|
| 26 |
+
.project-header {
|
| 27 |
+
background: linear-gradient(135deg, #f8fafc, #f1f5f9);
|
| 28 |
+
padding: 20px;
|
| 29 |
+
border-radius: 12px;
|
| 30 |
+
border-left: 4px solid #e11d48;
|
| 31 |
+
margin-bottom: 20px;
|
| 32 |
+
}
|
| 33 |
+
.research-badge {
|
| 34 |
+
display: inline-block;
|
| 35 |
+
background: #dcfce7;
|
| 36 |
+
color: #166534;
|
| 37 |
+
padding: 4px 12px;
|
| 38 |
+
border-radius: 20px;
|
| 39 |
+
font-size: 12px;
|
| 40 |
+
font-weight: 600;
|
| 41 |
+
margin-left: 12px;
|
| 42 |
+
}
|
| 43 |
+
.demo-badge {
|
| 44 |
+
display: inline-block;
|
| 45 |
+
background: #fef3c7;
|
| 46 |
+
color: #92400e;
|
| 47 |
+
padding: 4px 12px;
|
| 48 |
+
border-radius: 20px;
|
| 49 |
+
font-size: 12px;
|
| 50 |
+
font-weight: 600;
|
| 51 |
+
margin-left: 8px;
|
| 52 |
+
}
|
| 53 |
"""
|
| 54 |
|
| 55 |
def create_theme():
|
|
|
|
| 67 |
def get_header_html() -> str:
|
| 68 |
"""Get HTML for application header."""
|
| 69 |
return """
|
| 70 |
+
<div class="project-header">
|
| 71 |
+
<h1 style="margin: 0; color: #1e293b; font-size: 28px;">
|
| 72 |
+
π¬ MelanoScope AI
|
| 73 |
+
<span class="research-badge">Research Project</span>
|
| 74 |
+
<span class="demo-badge">Live Demo</span>
|
| 75 |
+
</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
+
<h2 style="margin: 12px 0 8px 0; color: #475569; font-size: 18px; font-weight: 500;">
|
| 78 |
+
Advanced CNN-based Dermatoscopic Image Classification System
|
| 79 |
+
</h2>
|
| 80 |
|
| 81 |
+
<p style="margin: 16px 0; color: #64748b; font-size: 14px; line-height: 1.6;">
|
| 82 |
+
<strong>π Institution:</strong> Universidad Central de Venezuela β’
|
| 83 |
+
<strong>π¬ Domain:</strong> Computer Vision in Medical Diagnostics β’
|
| 84 |
+
<strong>π― Achievement:</strong> 94% Classification Accuracy β’
|
| 85 |
+
<strong>β‘ Architecture:</strong> NFNet + ONNX Runtime
|
| 86 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
+
<p style="margin: 16px 0 8px 0; color: #374151; font-size: 14px; line-height: 1.6;">
|
| 89 |
<strong>Upload a dermatoscopic image</strong> to experience real-time CNN inference with
|
| 90 |
comprehensive medical information retrieval. This system demonstrates production-ready
|
| 91 |
+
AI deployment with sub-second latency and clinical-grade accuracy.
|
| 92 |
+
</p>
|
| 93 |
+
|
| 94 |
+
<p style="margin: 8px 0 0 0; color: #dc2626; font-size: 13px; font-weight: 500;">
|
| 95 |
+
β οΈ Research prototype β’ Not for clinical diagnosis β’ Educational purposes only
|
| 96 |
</p>
|
| 97 |
</div>
|
| 98 |
"""
|
| 99 |
|
|
|
|
| 100 |
def get_footer_html() -> str:
|
| 101 |
"""Get HTML for application footer."""
|
| 102 |
from ..config.settings import AppConfig
|
| 103 |
|
| 104 |
return f"""
|
| 105 |
+
<div style="background: #f8fafc; padding: 20px; border-radius: 12px; margin-top: 24px; text-align: center;">
|
| 106 |
+
|
| 107 |
+
<div style="display: flex; justify-content: space-around; flex-wrap: wrap; gap: 20px; margin-bottom: 16px;">
|
| 108 |
|
| 109 |
+
<div style="min-width: 200px;">
|
| 110 |
<h4 style="color: #1e293b; margin: 0 0 8px 0; font-size: 14px;">π Academic Research</h4>
|
| 111 |
<p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
|
| 112 |
<strong>Institution:</strong> {AppConfig.INSTITUTION}<br>
|
|
|
|
| 115 |
</p>
|
| 116 |
</div>
|
| 117 |
|
| 118 |
+
<div style="min-width: 200px;">
|
| 119 |
+
<h4 style="color: #1e293b; margin: 0 0 8px 0; font-size: 14px;">βοΈ Technical Stack</h4>
|
| 120 |
<p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
|
| 121 |
+
<strong>Model:</strong> NFNet-L0 (3.2M parameters)<br>
|
| 122 |
+
<strong>Optimization:</strong> ONNX Runtime<br>
|
| 123 |
<strong>Deployment:</strong> Gradio + HuggingFace Spaces
|
| 124 |
</p>
|
| 125 |
</div>
|
| 126 |
|
| 127 |
+
<div style="min-width: 200px;">
|
| 128 |
+
<h4 style="color: #1e293b; margin: 0 0 8px 0; font-size: 14px;">π Performance</h4>
|
| 129 |
<p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
|
| 130 |
+
<strong>Accuracy:</strong> 94% validation<br>
|
| 131 |
+
<strong>Latency:</strong> <50ms inference<br>
|
| 132 |
<strong>Efficiency:</strong> 99.8% parameter reduction
|
| 133 |
</p>
|
| 134 |
</div>
|
| 135 |
|
| 136 |
</div>
|
| 137 |
|
| 138 |
+
<div style="border-top: 1px solid #e2e8f0; padding-top: 12px;">
|
| 139 |
<p style="margin: 0; font-size: 11px; color: #94a3b8;">
|
| 140 |
Model Version: {AppConfig.VERSION} β’ Last Updated: {AppConfig.LAST_UPDATE} β’
|
| 141 |
Research & Development by Daniel Cavadia
|
|
|
|
| 144 |
</div>
|
| 145 |
"""
|
| 146 |
|
|
|
|
| 147 |
def get_model_info_html() -> str:
|
| 148 |
"""Get HTML for model information."""
|
| 149 |
from ..config.settings import AppConfig
|
| 150 |
return (
|
| 151 |
+
"- <strong>Architecture:</strong> NFNet CNN exported to ONNX format<br>"
|
| 152 |
+
"- <strong>Training:</strong> Dermatoscopic dataset with data augmentation<br>"
|
| 153 |
+
"- <strong>Optimization:</strong> Model quantization and runtime acceleration<br>"
|
| 154 |
+
"- <strong>Deployment:</strong> Production-ready inference pipeline<br><br>"
|
| 155 |
+
f"<em style='color: #dc2626;'>{AppConfig.MEDICAL_DISCLAIMER}</em>"
|
| 156 |
)
|