File size: 943 Bytes
4274361
5fe6d3f
4274361
 
5c202cd
 
 
4274361
5fe6d3f
4274361
 
5fe6d3f
 
5c202cd
5fe6d3f
 
 
 
 
 
 
 
4274361
 
 
 
5fe6d3f
 
 
 
 
4274361
 
5fe6d3f
 
 
 
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
import streamlit as st
from streamlit_option_menu import option_menu
from PIL import Image

from apps import home, dashboard, models,demo

#st.set_page_config(layout="wide")
image = Image.open('data/logo.png')
image=image.resize((100,100))
header = st.container()

apps = [
    {"func": home.app, "title": "Home", "icon": "house"},
    {"func": dashboard.app, "title": "Dashboard", "icon": "bar-chart"},
    {"func": models.app, "title": "Models", "icon": "cpu"},
    {"func": demo.app, "title": "Demo", "icon": "cloud-upload"},
]

titles = [app["title"] for app in apps]
titles_lower = [title.lower() for title in titles]
icons = [app["icon"] for app in apps]

#Using "with" notation

with st.sidebar:
    logo = st.image(image)
    selected = option_menu(
        "Main Menu",
        options=titles,
        icons=icons,
        menu_icon="cast",
    )

for app in apps:
    if app["title"] == selected:
        app["func"]()
        break