dcavadia commited on
Commit
14680c1
Β·
1 Parent(s): 8f09793

update style

Browse files
Files changed (1) hide show
  1. 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
- <div style="display: flex; align-items: center; gap: 16px; margin-bottom: 8px;">
43
- <h1 style="margin:0; background: linear-gradient(135deg, #e11d48, #be185d);
44
- -webkit-background-clip: text; -webkit-text-fill-color: transparent;
45
- background-clip: text;">
46
- MelanoScope AI
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
- <p style="font-size: 18px; color: #475569; margin: 8px 0; font-weight: 500;">
57
- <strong>Advanced CNN-based Dermatoscopic Image Classification System</strong>
58
- </p>
59
 
60
- <div style="background: linear-gradient(135deg, #f8fafc, #f1f5f9);
61
- padding: 16px; border-radius: 12px; border-left: 4px solid #e11d48;
62
- margin: 12px 0;">
63
- <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
64
- gap: 12px; font-size: 14px; color: #64748b;">
65
- <div>πŸ“‹ <strong>Research Institution:</strong> Universidad Central de Venezuela</div>
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-top: 12px; color: #64748b; font-size: 14px; line-height: 1.6;">
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 capabilities with sub-second latency and clinical-grade accuracy.
76
- <br><br>
77
- <em style="color: #dc2626; font-weight: 500;">⚠️ Research prototype β€’ Not for clinical diagnosis β€’ Educational purposes only</em>
 
 
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 class='footer' style="background: #f8fafc; padding: 20px; border-radius: 12px; margin-top: 24px;">
89
- <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; text-align: left;">
 
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 Implementation</h4>
102
  <p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
103
- <strong>Model:</strong> NFNet-L0 (99.8M→3.2M parameters)<br>
104
- <strong>Optimization:</strong> ONNX Runtime + Quantization<br>
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 Metrics</h4>
111
  <p style="margin: 0; font-size: 12px; color: #64748b; line-height: 1.4;">
112
- <strong>Accuracy:</strong> 94% on validation set<br>
113
- <strong>Latency:</strong> <50ms inference time<br>
114
  <strong>Efficiency:</strong> 99.8% parameter reduction
115
  </p>
116
  </div>
117
 
118
  </div>
119
 
120
- <div style="border-top: 1px solid #e2e8f0; margin-top: 16px; padding-top: 12px; text-align: center;">
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 (see documentation)<br>"
136
- f"- Note: {AppConfig.MEDICAL_DISCLAIMER}"
 
 
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 &nbsp;β€’&nbsp;
83
+ <strong>πŸ”¬ Domain:</strong> Computer Vision in Medical Diagnostics &nbsp;β€’&nbsp;
84
+ <strong>🎯 Achievement:</strong> 94% Classification Accuracy &nbsp;β€’&nbsp;
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
  )