diff --git a/edsa_recommender.py b/edsa_recommender.py index f1192112..a59cc3b7 100644 --- a/edsa_recommender.py +++ b/edsa_recommender.py @@ -31,12 +31,33 @@ # Data handling dependencies import pandas as pd import numpy as np +import requests +from PIL import Image +from streamlit_lottie import st_lottie + # Custom Libraries from utils.data_loader import load_movie_titles from recommenders.collaborative_based import collab_model from recommenders.content_based import content_model +movie_image = Image.open(r'resources/imgs/Movies_AI.webp') +logo_a= Image.open(r'resources/imgs/lens.jpeg') + +def load_lottieurl(url): + r = requests.get(url) + if r.status_code != 200: + return None + return r.json() + +# Load your raw data +raw_m = pd.read_csv("resources/data/movies.csv") +raw_r= pd.read_csv("resources/data/ratings.csv") + +#load lottie urls +data_lottie = load_lottieurl("https://assets7.lottiefiles.com/packages/lf20_8gmx5ktv.json") +info_lottie = load_lottieurl("https://assets1.lottiefiles.com/packages/lf20_HhOOsG.json") + # Data Loading title_list = load_movie_titles('resources/data/movies.csv') @@ -45,7 +66,7 @@ def main(): # DO NOT REMOVE the 'Recommender System' option below, however, # you are welcome to add more options to enrich your app. - page_options = ["Recommender System","Solution Overview"] + page_options = ["Home", "Recommender System","Top Rated Movies", "Solution Overview", "Latest Movie News", "About Us"] # ------------------------------------------------------------------- # ----------- !! THIS CODE MUST NOT BE ALTERED !! ------------------- @@ -53,8 +74,10 @@ def main(): page_selection = st.sidebar.selectbox("Choose Option", page_options) if page_selection == "Recommender System": # Header contents - st.write('# Movie Recommender Engine') - st.write('### EXPLORE Data Science Academy Unsupervised Predict') + head, im = st.columns(2) + head.title('DATA LENS ANALYTICS') + im.image('resources/imgs/lens.jpeg', caption = 'See the Real-Time World Through our Eyes', width = 125) + st.write('### Movie Recommender Engine') st.image('resources/imgs/Image_header.png',use_column_width=True) # Recommender System algorithm selection sys = st.radio("Select an algorithm", @@ -100,13 +123,254 @@ def main(): # ------------------------------------------------------------------- # ------------- SAFE FOR ALTERING/EXTENSION ------------------- + if page_selection == 'Home': + + + #define a function to access lottiee files + + def load_lottieurl(url): + r = requests.get(url) + if r.status_code != 200: + return None + return r.json() + + lottie_coding = load_lottieurl("https://lottie.host/c010cc98-6a3f-479a-a00a-78a84a9c56b5/iHcqx2032P.json") + phonecall_lottie = load_lottieurl("https://lottie.host/96d1924e-b132-4167-ad2a-fcbfb8918dbd/6TdAaxPO28.json") + + # header section + with st.container(): + + st.subheader("Welcome :wave:, We are Data Lens Analytics") + st.image(logo_a, use_column_width=True) + st.write('---') + st.title('A Data Science Based Team Focused on Creating Real-World Data-Driven Solutions') + st.write(""" \n We are passionate about the use of intricately collected and analysed data to allow + companies and individuals to make well informed decisions""") + + #what do we do? + with st.container(): + st.write('---') + left_column, right_column = st.columns(2) + + with left_column: + st.header("What do we do?") + st.write('##') + st.markdown( + """ +