File size: 3,240 Bytes
2ce673b
5a3b83f
 
 
 
 
 
 
 
 
2ce673b
 
5a3b83f
2ce673b
5a3b83f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2ce673b
 
5a3b83f
 
 
 
 
 
 
 
2ce673b
 
5a3b83f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import dash
from dash import html
import dash_bootstrap_components as dbc

app = dash.Dash(
    __name__,
    use_pages=True,
    external_stylesheets=[dbc.themes.DARKLY, dbc.icons.BOOTSTRAP],
    suppress_callback_exceptions=True,
    title="AutoSense - Engine Anomaly Detection",
)

server = app.server

sidebar = html.Div([
    html.Div([
        html.Div([
            html.I(className="bi bi-cpu-fill fs-2", style={"color": "#1d9e75"})
        ], style={
            "width": "45px", "height": "45px",
            "display": "flex", "alignItems": "center", "justifyContent": "center",
            "background": "rgba(255,255,255,0.05)",
            "borderRadius": "12px",
            "boxShadow": "0 0 20px rgba(29, 158, 117, 0.3)",
            "border": "1px solid rgba(29, 158, 117, 0.2)",
        }),
        html.Div([
            html.H3("AutoSense", className="ms-3 mb-0 fw-bold text-white",
                    style={"letterSpacing": "2px"}),
            html.Small("Engine Anomaly Detection", className="ms-3 text-muted"),
        ]),
    ], className="d-flex align-items-center mb-5"),

    dbc.Nav([
        dbc.NavLink([html.I(className="bi bi-house-door me-3"), "Overview"],
                    href="/", active="exact", className="mb-2 nav-link-custom"),
        dbc.NavLink([html.I(className="bi bi-info-circle me-3"), "The Problem"],
                    href="/problem", active="exact", className="mb-2 nav-link-custom"),
        dbc.NavLink([html.I(className="bi bi-database me-3"), "The Data"],
                    href="/data", active="exact", className="mb-2 nav-link-custom"),
        dbc.NavLink([html.I(className="bi bi-bar-chart-line me-3"), "Model Comparison"],
                    href="/comparison", active="exact", className="mb-2 nav-link-custom"),
        dbc.NavLink([html.I(className="bi bi-activity me-3"), "Anomaly Engine"],
                    href="/engine", active="exact", className="mb-2 nav-link-custom"),
    ], vertical=True, pills=True),

    html.Div([
        html.Hr(style={"borderColor": "rgba(255,255,255,0.1)"}),
        html.Small("Autoencoder - 168 params", className="text-muted d-block"),
        html.Small("Seat Leon OBD-II", className="text-muted d-block"),
    ], className="mt-auto pt-4"),
], className="sidebar-container d-flex flex-column")

footer = html.Footer(
    dbc.Container(
        dbc.Row([
            dbc.Col(html.Hr(style={"borderTop": "1px solid rgba(255,255,255,0.1)",
                                   "marginBottom": "20px"}), width=12),
            dbc.Col(
                html.P([
                    html.Span("AutoSense ", className="text-info fw-bold"),
                    html.Span("- unsupervised engine health monitoring with autoencoders.",
                              className="text-muted"),
                ], className="small text-center mb-0 pb-3"),
                width=12),
        ]),
        fluid=True,
    ),
    style={"marginTop": "auto"},
)

app.layout = html.Div([
    html.Div(className="bg-glow"),
    sidebar,
    html.Div([
        dash.page_container,
        footer,
    ], className="content-container d-flex flex-column", style={"minHeight": "100vh"}),
])

if __name__ == "__main__":
    app.run(debug=True, port=7860)