Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- frontend/pages/6_About.py +87 -28
frontend/pages/6_About.py
CHANGED
|
@@ -5,24 +5,82 @@ st.set_page_config(page_title="About Project", page_icon="βΉοΈ", layout="wide"
|
|
| 5 |
|
| 6 |
st.markdown("""
|
| 7 |
<style>
|
| 8 |
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
.tech-badge {
|
| 12 |
-
display: inline-block;
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
|
|
|
| 17 |
.tech-badge:hover {
|
| 18 |
-
background: rgba(0, 242, 254, 0.
|
| 19 |
-
border-color: #00f2fe;
|
| 20 |
-
transform: translateY(-
|
|
|
|
| 21 |
}
|
|
|
|
| 22 |
.live-link {
|
| 23 |
-
text-decoration: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
</style>
|
| 27 |
""", unsafe_allow_html=True)
|
| 28 |
|
|
@@ -50,43 +108,44 @@ st.markdown("---")
|
|
| 50 |
|
| 51 |
st.markdown("### ποΈ System Architecture")
|
| 52 |
# Create a Graphviz flowchart for the About page
|
| 53 |
-
graph = graphviz.Digraph(node_attr={'shape': 'box', 'style': 'rounded,filled', 'fontname': 'Helvetica', 'margin': '0.
|
|
|
|
| 54 |
|
| 55 |
# Define UI & API nodes at the top
|
| 56 |
graph.node('UI', 'π₯οΈ Streamlit Frontend\nInteractive Dashboard (IST)', fillcolor='#ff4b4b', fontcolor='white', color='#a30000', penwidth='2')
|
| 57 |
graph.node('API', 'βοΈ FastAPI Backend\nInternal Routing (UTC)', fillcolor='#009688', fontcolor='white', color='#004d40', penwidth='2')
|
| 58 |
-
graph.node('HUB', 'π€ HF Hub Dataset\nCentralized History Store', shape='folder', fillcolor='#ffcc00', fontcolor='
|
| 59 |
graph.node('DB', 'ποΈ SQLite DB\nLocal Instance Cache', shape='cylinder', fillcolor='#9b59b6', fontcolor='white', color='#4a235a', penwidth='2')
|
| 60 |
|
| 61 |
# Core connections
|
| 62 |
-
graph.edge('UI', 'API', label=' internal localhost:8000', color='#
|
| 63 |
-
graph.edge('API', 'DB', label=' Read/Write', color='#
|
| 64 |
-
graph.edge('API', 'HUB', label=' HfApi Sync (Persistent)', color='#
|
| 65 |
|
| 66 |
# Machine Learning Subgraph
|
| 67 |
with graph.subgraph(name='cluster_ml') as ml:
|
| 68 |
-
ml.attr(label='π§ Machine Learning & Inference Pipeline', style='dashed', color='#
|
| 69 |
-
ml.node('ENS', 'Ensemble Engine\nSoft-Voting Aggregator', shape='diamond', fillcolor='#f2c94c', fontcolor='
|
| 70 |
-
ml.node('MODELS', 'Classifiers\n(RF, SVM, LogReg, NN, KNN)', fillcolor='#f2c94c', fontcolor='
|
| 71 |
-
ml.node('SHAP', 'π SHAP Explainer\nFeature Impact Analysis', fillcolor='#f2c94c', fontcolor='
|
| 72 |
|
| 73 |
# Hardware Export Subgraph
|
| 74 |
with graph.subgraph(name='cluster_edge') as edge:
|
| 75 |
-
edge.attr(label='β‘ Hardware & Edge AI Export', style='dashed', color='#
|
| 76 |
edge.node('TRANS', 'C-Code Transpiler\nINT8 Quantization', fillcolor='#2d9cdb', fontcolor='white', color='#106093', penwidth='2')
|
| 77 |
edge.node('HEADER', 'tinyml_model.h\nOptimized Header File', shape='note', fillcolor='#2d9cdb', fontcolor='white', color='#106093', penwidth='2')
|
| 78 |
edge.node('MCU', 'π ESP32 / ARM Cortex-M\nMicrocontroller Node', fillcolor='#2d9cdb', fontcolor='white', color='#106093', penwidth='2')
|
| 79 |
|
| 80 |
# Map Cross-cluster edges
|
| 81 |
-
graph.edge('API', 'ENS', label=' Predict', color='#
|
| 82 |
-
graph.edge('ENS', 'MODELS', color='#
|
| 83 |
|
| 84 |
-
graph.edge('API', 'SHAP', label=' Explain', color='#
|
| 85 |
-
graph.edge('SHAP', 'MODELS', style='dashed', label=' Analyzes Trees', fontcolor='#
|
| 86 |
|
| 87 |
-
graph.edge('API', 'TRANS', label=' Export Config', color='#
|
| 88 |
-
graph.edge('TRANS', 'HEADER', label=' Scale FP32 to INT8', fontcolor='#
|
| 89 |
-
graph.edge('HEADER', 'MCU', label=' Flash Firmware', color='#
|
| 90 |
|
| 91 |
st.graphviz_chart(graph, use_container_width=True)
|
| 92 |
|
|
|
|
| 5 |
|
| 6 |
st.markdown("""
|
| 7 |
<style>
|
| 8 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 9 |
+
|
| 10 |
+
html, body, [class*="css"] {
|
| 11 |
+
font-family: 'Inter', sans-serif;
|
| 12 |
+
color: #e0e0e0;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.main {
|
| 16 |
+
background-color: #0e1117;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
h1 {
|
| 20 |
+
font-weight: 800 !important;
|
| 21 |
+
letter-spacing: -1px !important;
|
| 22 |
+
color: #ffffff !important;
|
| 23 |
+
font-size: 3rem !important;
|
| 24 |
+
margin-bottom: 0.5rem !important;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
h3 {
|
| 28 |
+
font-weight: 700 !important;
|
| 29 |
+
color: #00f2fe !important;
|
| 30 |
+
margin-top: 2rem !important;
|
| 31 |
+
font-size: 1.8rem !important;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
p, li, div {
|
| 35 |
+
font-size: 1.1rem !important;
|
| 36 |
+
line-height: 1.6 !important;
|
| 37 |
+
}
|
| 38 |
|
| 39 |
.tech-badge {
|
| 40 |
+
display: inline-block;
|
| 41 |
+
padding: 6px 16px;
|
| 42 |
+
margin: 0 8px 10px 0;
|
| 43 |
+
border-radius: 50px;
|
| 44 |
+
font-size: 0.9rem;
|
| 45 |
+
font-weight: 600;
|
| 46 |
+
background: rgba(255,255,255,0.05);
|
| 47 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 48 |
+
color: #00f2fe;
|
| 49 |
+
transition: all 0.3s ease;
|
| 50 |
}
|
| 51 |
+
|
| 52 |
.tech-badge:hover {
|
| 53 |
+
background: rgba(0, 242, 254, 0.2);
|
| 54 |
+
border-color: #00f2fe;
|
| 55 |
+
transform: translateY(-2px);
|
| 56 |
+
box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
|
| 57 |
}
|
| 58 |
+
|
| 59 |
.live-link {
|
| 60 |
+
text-decoration: none;
|
| 61 |
+
font-weight: 600;
|
| 62 |
+
color: #4facfe;
|
| 63 |
+
border-bottom: 1px dashed #4facfe;
|
| 64 |
+
transition: all 0.2s ease;
|
| 65 |
}
|
| 66 |
+
|
| 67 |
+
.live-link:hover {
|
| 68 |
+
color: #00f2fe;
|
| 69 |
+
border-bottom-style: solid;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
/* Glass cards for the info/success/etc boxes */
|
| 73 |
+
div[data-testid="stExpander"], .stAlert {
|
| 74 |
+
background: rgba(255, 255, 255, 0.03) !important;
|
| 75 |
+
border: 1px solid rgba(255, 255, 255, 0.05) !important;
|
| 76 |
+
border-radius: 15px !important;
|
| 77 |
+
backdrop-filter: blur(10px);
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.stMarkdown {
|
| 81 |
+
margin-bottom: 1rem;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
</style>
|
| 85 |
""", unsafe_allow_html=True)
|
| 86 |
|
|
|
|
| 108 |
|
| 109 |
st.markdown("### ποΈ System Architecture")
|
| 110 |
# Create a Graphviz flowchart for the About page
|
| 111 |
+
graph = graphviz.Digraph(node_attr={'shape': 'box', 'style': 'rounded,filled', 'fontname': 'Helvetica', 'margin': '0.3', 'fontsize': '12'},
|
| 112 |
+
graph_attr={'rankdir': 'TB', 'splines': 'ortho', 'nodesep': '1.0', 'bgcolor': 'transparent', 'fontcolor': 'white'})
|
| 113 |
|
| 114 |
# Define UI & API nodes at the top
|
| 115 |
graph.node('UI', 'π₯οΈ Streamlit Frontend\nInteractive Dashboard (IST)', fillcolor='#ff4b4b', fontcolor='white', color='#a30000', penwidth='2')
|
| 116 |
graph.node('API', 'βοΈ FastAPI Backend\nInternal Routing (UTC)', fillcolor='#009688', fontcolor='white', color='#004d40', penwidth='2')
|
| 117 |
+
graph.node('HUB', 'π€ HF Hub Dataset\nCentralized History Store', shape='folder', fillcolor='#ffcc00', fontcolor='#1a1a1a', color='#d4a017', penwidth='2')
|
| 118 |
graph.node('DB', 'ποΈ SQLite DB\nLocal Instance Cache', shape='cylinder', fillcolor='#9b59b6', fontcolor='white', color='#4a235a', penwidth='2')
|
| 119 |
|
| 120 |
# Core connections
|
| 121 |
+
graph.edge('UI', 'API', label=' internal localhost:8000', color='#888888', fontcolor='#888888')
|
| 122 |
+
graph.edge('API', 'DB', label=' Read/Write', color='#888888', fontcolor='#888888')
|
| 123 |
+
graph.edge('API', 'HUB', label=' HfApi Sync (Persistent)', color='#888888', fontcolor='#888888')
|
| 124 |
|
| 125 |
# Machine Learning Subgraph
|
| 126 |
with graph.subgraph(name='cluster_ml') as ml:
|
| 127 |
+
ml.attr(label='π§ Machine Learning & Inference Pipeline', style='dashed', color='#555555', fontcolor='#aaaaaa')
|
| 128 |
+
ml.node('ENS', 'Ensemble Engine\nSoft-Voting Aggregator', shape='diamond', fillcolor='#f2c94c', fontcolor='#1a1a1a', color='#b28900', penwidth='2')
|
| 129 |
+
ml.node('MODELS', 'Classifiers\n(RF, SVM, LogReg, NN, KNN)', fillcolor='#f2c94c', fontcolor='#1a1a1a', color='#b28900', penwidth='2')
|
| 130 |
+
ml.node('SHAP', 'π SHAP Explainer\nFeature Impact Analysis', fillcolor='#f2c94c', fontcolor='#1a1a1a', color='#b28900', penwidth='2')
|
| 131 |
|
| 132 |
# Hardware Export Subgraph
|
| 133 |
with graph.subgraph(name='cluster_edge') as edge:
|
| 134 |
+
edge.attr(label='β‘ Hardware & Edge AI Export', style='dashed', color='#555555', fontcolor='#aaaaaa')
|
| 135 |
edge.node('TRANS', 'C-Code Transpiler\nINT8 Quantization', fillcolor='#2d9cdb', fontcolor='white', color='#106093', penwidth='2')
|
| 136 |
edge.node('HEADER', 'tinyml_model.h\nOptimized Header File', shape='note', fillcolor='#2d9cdb', fontcolor='white', color='#106093', penwidth='2')
|
| 137 |
edge.node('MCU', 'π ESP32 / ARM Cortex-M\nMicrocontroller Node', fillcolor='#2d9cdb', fontcolor='white', color='#106093', penwidth='2')
|
| 138 |
|
| 139 |
# Map Cross-cluster edges
|
| 140 |
+
graph.edge('API', 'ENS', label=' Predict', color='#cccccc', fontcolor='#cccccc')
|
| 141 |
+
graph.edge('ENS', 'MODELS', color='#cccccc')
|
| 142 |
|
| 143 |
+
graph.edge('API', 'SHAP', label=' Explain', color='#cccccc', fontcolor='#cccccc')
|
| 144 |
+
graph.edge('SHAP', 'MODELS', style='dashed', label=' Analyzes Trees', fontcolor='#888888', color='#888888')
|
| 145 |
|
| 146 |
+
graph.edge('API', 'TRANS', label=' Export Config', color='#cccccc', fontcolor='#cccccc')
|
| 147 |
+
graph.edge('TRANS', 'HEADER', label=' Scale FP32 to INT8', fontcolor='#888888', color='#888888')
|
| 148 |
+
graph.edge('HEADER', 'MCU', label=' Flash Firmware', color='#cccccc')
|
| 149 |
|
| 150 |
st.graphviz_chart(graph, use_container_width=True)
|
| 151 |
|