DataAIDemo / app.py
themeetjani's picture
Update app.py
1d3ffcf verified
raw
history blame
No virus
5.77 kB
import streamlit as st
import pandas as pd
import base64
import json
from st_pages import Page, Section, show_pages, add_page_title,add_indentation
st.set_page_config(
page_title="app",
page_icon="πŸ“ˆ",
)
st.markdown("<h1 style='text-align: center; color: black;'> Welcome to DataAI! πŸ‘‹</h1>", unsafe_allow_html=True)
st.sidebar.success("Please select a demo above.")
def get_base64_of_bin_file(png_file):
with open(png_file, "rb") as f:
data = f.read()
return base64.b64encode(data).decode()
def build_markup_for_logo(
png_file,
background_position="50% 10%",
margin_top="10%",
image_width="60%",
image_height="",
):
binary_string = get_base64_of_bin_file(png_file)
return """
<style>
[data-testid="stSidebarNav"] {
background-image: url("data:image/png;base64,%s");
background-repeat: no-repeat;
background-position: %s;
margin-top: %s;
background-size: %s %s;
}
</style>
""" % (
binary_string,
background_position,
margin_top,
image_width,
image_height,
)
def add_logo(png_file):
logo_markup = build_markup_for_logo(png_file)
st.markdown(
logo_markup,
unsafe_allow_html=True,
)
add_logo("logoo.png")
st.markdown("<h2 style='text-align: center; color: black;'>This is the demo for the usecases we've worked on.</h1>", unsafe_allow_html=True)
st.markdown("<h3 style='text-align: center; color: black;'>Select a demo from the sidebar to see some examples of what we can do!!! </h2>", unsafe_allow_html=True)
paragraph = """
<span style="color:black;">As a data AI team, our capabilities are demonstrated through the functionalities showcased on our demo site.
The team has developed a diverse set of applications that leverage artificial intelligence and machine learning techniques.
The "Home" page serves as a central hub, providing access to various sections.
Within the "GenAI" section, we showcase advanced technologies such as an AI Chatbot, auto code generation, report generation, and score generation.
The "Deep Learning" section features demonstrations in image analytics, video analytics, and speech recognition.
In the "Machine Learning" section, we exhibit our proficiency in regression, forecasting, clustering, and optimization.
Our team's expertise lies in delivering innovative solutions that harness the power of data and AI, addressing a wide range of challenges and applications.</span>
"""
# Display the paragraph with black color within a Streamlit HTML element
st.markdown(paragraph, unsafe_allow_html=True)
st.markdown("<h3 style='text-align: center; color: black;'>What is GenAI?!!! </h2>", unsafe_allow_html=True)
g_p = """"<span style="color:black;">GenAI" likely stands for "General Artificial Intelligence," which refers to the concept of developing intelligent systems capable of performing tasks across a broad spectrum of domains, similar to the versatility and adaptability observed in human intelligence. In a short summary, "GenAI" embodies the pursuit of creating AI systems that can comprehend, learn, and apply knowledge across various contexts, aiming for a more generalized and flexible form of artificial intelligence.</span>"""
st.markdown(paragraph, unsafe_allow_html=True)
footer="""<style>
a:link , a:visited{
color: blue;
background-color: transparent;
text-decoration: underline;
}
a:hover, a:active {
color: red;
background-color: transparent;
text-decoration: underline;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: white;
color: black;
text-align: center;
}
</style>
<div class="footer">
<p>Developed with ❀ by DataAi Team. Please contact us at +91 12-32130332</p>
</div>
"""
st.markdown(footer,unsafe_allow_html=True)
main_bg_ext = "jpg"
main_bg = "vally4.jpg"
st.markdown(
f"""
<style>
.stApp {{
background: url(data:image/{main_bg_ext};base64,{base64.b64encode(open(main_bg, "rb").read()).decode()});
background-size: cover
}}
</style>
""",
unsafe_allow_html=True
)
add_indentation()
# Specify what pages should be shown in the sidebar, and what their titles and icons
# should be
show_pages(
[
Page("app.py", "Home", "🏠"),
Section("GenAI", icon="πŸ€–"),
Page("pages/AI_Chatbot.py", "AI Chatbot", "πŸ“ˆ",in_section=True),
# Pages after a section will be indented
Page("pages/Auto_Code_Generation.py", "Auto Code Generation", "πŸ“ˆ"),
Page("pages/Auto_Report_Generation.py", "Auto Report Generation", "πŸ“ˆ"),
Page("pages/Auto_Score_Generation.py", "Auto Score Generation", "πŸ“ˆ"),
Page("pages/core_risk.py", "Core Risk Classification", "πŸ“ˆ"),
Page("pages/jury_records.py", "Jury Records", "πŸ“ˆ"),
Page("pages/topic_classification.py", "Topic Classification", "πŸ“ˆ"),
Section("Deep Learning", icon="πŸ€–"),
Page(path = "pages/deep_learning_demo.py", name = "Image Analytics", icon = "πŸ“ˆ"),
Page(path = "pages/deep_learning_demo2.py",name = "Video Analytics", icon ="πŸ“ˆ"),
Page(path = "pages/deep_learning_demo3.py",name = "Speech Recognization", icon = "πŸ“ˆ"),
Section("Machine Learning", icon="πŸ€–"),
Page(path = "pages/machine_learning_demo.py",name = "Regression", icon = "πŸ“ˆ"),
Page(path = "pages/machine_learning_demo2.py",name = "Forecasting", icon = "πŸ“ˆ"),
Page(path = "pages/machine_learning_demo3.py",name = "Clustering", icon = "πŸ“ˆ"),
Page(path = "pages/machine_learning_demo4.py",name = "Optimization", icon ="πŸ“ˆ")
]
)