-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
94 lines (82 loc) · 2.72 KB
/
index.py
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
84
85
86
87
88
89
90
91
92
93
94
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
from app import app
from apps import estimation_app
app.layout = html.Div(children=[
dcc.Location(id='url', refresh=False),
html.Div(id='page-content'),
])
first_card = dbc.Card(
[
dbc.CardImg(src="/assets/example.jpeg", top=True),
dbc.CardBody(
[
html.H4("About", className="card-title"),
html.P(
"The problem of engagement estimation is the problem of assessing the level of a person's interest"
"in the process taking place (in particular, a video meeting). "
"Usually it is solved by finding the face, assessing the head posture and direction of the gaze.",
className="card-text",
),
# dbc.Button("Proof of concept", color="primary", href=""),
]
),
],
style={
"width": "20rem",
"margin-left": "200px",
"margin-top": "50px"},
)
second_card = dbc.Card(
[
dbc.CardImg(src="/assets/user_guide.jpg", top=True),
dbc.CardBody(
[
html.H4("User manual", className="card-title"),
html.P(
"To run our system push the button below",
className="card-text",
),
dbc.Button("Run Estimation", color="primary", href='/apps/estimation_app'),
]
),
],
style={
"width": "20rem",
"margin-top": "50px"},
)
cards = dbc.Row([dbc.Col(first_card, width="auto"),
dbc.Col(second_card, width="auto"),])
index_page = html.Div(children=[
dbc.NavbarSimple(
children=[
dbc.NavItem(dbc.NavLink("Github Link", href='https://github.com/Lolik-Bolik/engagement_estimation_system')),
dbc.NavItem(dbc.NavLink("Run Estimation", href='/apps/estimation_app')),
],
brand="Engagement Estimation",
brand_href="#",
color="primary",
dark=True,
),
cards
],
style={
"background-image": 'url(/assets/background_2.jpg)',
"background-repeat": "no-repeat",
"background-position": "center",
"background-size": "cover",
"position": "fixed",
"min-height": "100%",
"min-width": "100%",})
@app.callback(Output('page-content', 'children'),
Input('url', 'pathname'))
def display_page(pathname):
print(pathname)
if pathname == '/apps/estimation_app':
return estimation_app.layout
else:
return index_page
if __name__ == '__main__':
app.run_server(debug=True)