Spaces:
Runtime error
Runtime error
Commit
•
c94fcf8
1
Parent(s):
0743a92
Update app.py
Browse files
app.py
CHANGED
@@ -88,10 +88,17 @@ option_selected = st.selectbox(
|
|
88 |
movie_list
|
89 |
)
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
if st.button('Show Recommendation'):
|
92 |
recommended_movie_names, recommended_movie_posters = recommend(option_selected)
|
|
|
93 |
col1, col2, col3, col4, col5 = st.columns(5)
|
94 |
-
st.header("Movies Based on
|
95 |
with col1:
|
96 |
st.image(recommended_movie_posters[0], caption=recommended_movie_names[0])
|
97 |
with col2:
|
@@ -104,7 +111,7 @@ if st.button('Show Recommendation'):
|
|
104 |
with col5:
|
105 |
st.image(recommended_movie_posters[4], caption=recommended_movie_names[4])
|
106 |
|
107 |
-
st.header("Top Popular
|
108 |
popular = []
|
109 |
for row in top_popular_movies.loc[:,['title','movie_id']].values:
|
110 |
popular.append(row)
|
@@ -126,8 +133,8 @@ if st.button('Show Recommendation'):
|
|
126 |
st.image(full_path, caption=popular[4][0])
|
127 |
|
128 |
|
129 |
-
st.header("Top
|
130 |
-
top_gener_based = top_genre_based_movies(
|
131 |
genre_popular = []
|
132 |
for row in top_gener_based.loc[:, ['title', 'movie_id']].values:
|
133 |
genre_popular.append(row)
|
@@ -148,27 +155,7 @@ if st.button('Show Recommendation'):
|
|
148 |
full_path = fetch_poster(genre_popular[4][1])
|
149 |
st.image(full_path, caption=genre_popular[4][0])
|
150 |
|
151 |
-
|
152 |
-
top_gener_based = top_genre_based_movies('Action').head(5)
|
153 |
-
genre_popular = []
|
154 |
-
for row in top_gener_based.loc[:, ['title', 'movie_id']].values:
|
155 |
-
genre_popular.append(row)
|
156 |
-
col16, col17, col18, col19, col20 = st.columns(5)
|
157 |
-
with col16:
|
158 |
-
full_path = fetch_poster(genre_popular[0][1])
|
159 |
-
st.image(full_path, caption=genre_popular[0][0])
|
160 |
-
with col17:
|
161 |
-
full_path = fetch_poster(genre_popular[1][1])
|
162 |
-
st.image(full_path, caption=genre_popular[1][0])
|
163 |
-
with col18:
|
164 |
-
full_path = fetch_poster(genre_popular[2][1])
|
165 |
-
st.image(full_path, caption=genre_popular[2][0])
|
166 |
-
with col19:
|
167 |
-
full_path = fetch_poster(genre_popular[3][1])
|
168 |
-
st.image(full_path, caption=genre_popular[3][0])
|
169 |
-
with col20:
|
170 |
-
full_path = fetch_poster(genre_popular[4][1])
|
171 |
-
st.image(full_path, caption=genre_popular[4][0])
|
172 |
|
173 |
|
174 |
|
|
|
88 |
movie_list
|
89 |
)
|
90 |
|
91 |
+
genre_list = ['Action','Romance','Adventure','Science Fiction','Comedy']
|
92 |
+
genre_selected = st.selectbox(
|
93 |
+
'Type or Select Genre from Dropdown',
|
94 |
+
genre_list
|
95 |
+
)
|
96 |
+
|
97 |
if st.button('Show Recommendation'):
|
98 |
recommended_movie_names, recommended_movie_posters = recommend(option_selected)
|
99 |
+
top_popular_movies = get_popular(top_popular)
|
100 |
col1, col2, col3, col4, col5 = st.columns(5)
|
101 |
+
st.header("Movies Based on Content: Similar Movies")
|
102 |
with col1:
|
103 |
st.image(recommended_movie_posters[0], caption=recommended_movie_names[0])
|
104 |
with col2:
|
|
|
111 |
with col5:
|
112 |
st.image(recommended_movie_posters[4], caption=recommended_movie_names[4])
|
113 |
|
114 |
+
st.header("Movies Based on Popularity: Top Popular")
|
115 |
popular = []
|
116 |
for row in top_popular_movies.loc[:,['title','movie_id']].values:
|
117 |
popular.append(row)
|
|
|
133 |
st.image(full_path, caption=popular[4][0])
|
134 |
|
135 |
|
136 |
+
st.header("Movies Based on Genre: Top "+str(genre_selected)+" Movies")
|
137 |
+
top_gener_based = top_genre_based_movies(genre_selected).head(5)
|
138 |
genre_popular = []
|
139 |
for row in top_gener_based.loc[:, ['title', 'movie_id']].values:
|
140 |
genre_popular.append(row)
|
|
|
155 |
full_path = fetch_poster(genre_popular[4][1])
|
156 |
st.image(full_path, caption=genre_popular[4][0])
|
157 |
|
158 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
|
161 |
|