Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,9 +15,15 @@ from sklearn.metrics.pairwise import cosine_similarity
|
|
| 15 |
with open('image_names.pkl', 'rb') as file:
|
| 16 |
image_names = pickle.load(file)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
with open('features_matrix.pkl', 'rb') as file:
|
| 19 |
features_matrix = pickle.load(file)
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
image_df = pd.read_csv('images.csv')
|
| 22 |
|
| 23 |
# VGG16
|
|
@@ -62,4 +68,5 @@ def get_recommendations_from_image(uploaded_image):
|
|
| 62 |
image_input = gr.Image(type="pil", label="Upload Image")
|
| 63 |
outputs = gr.Gallery(label="Recommended Images", columns=3) # Set the number of columns to fit images better
|
| 64 |
|
| 65 |
-
gr.Interface(fn=get_recommendations_from_image, inputs=image_input, outputs=outputs,
|
|
|
|
|
|
| 15 |
with open('image_names.pkl', 'rb') as file:
|
| 16 |
image_names = pickle.load(file)
|
| 17 |
|
| 18 |
+
# with open('similarity_matrix.pkl', 'rb') as file:
|
| 19 |
+
# similarity_matrix = pickle.load(file)
|
| 20 |
+
|
| 21 |
with open('features_matrix.pkl', 'rb') as file:
|
| 22 |
features_matrix = pickle.load(file)
|
| 23 |
|
| 24 |
+
# with open('styles_df', 'rb') as file:
|
| 25 |
+
# styles_df = pickle.load(file)
|
| 26 |
+
|
| 27 |
image_df = pd.read_csv('images.csv')
|
| 28 |
|
| 29 |
# VGG16
|
|
|
|
| 68 |
image_input = gr.Image(type="pil", label="Upload Image")
|
| 69 |
outputs = gr.Gallery(label="Recommended Images", columns=3) # Set the number of columns to fit images better
|
| 70 |
|
| 71 |
+
gr.Interface(fn=get_recommendations_from_image, inputs=image_input, outputs=outputs, examples=['shirt.jpg','perfume.jpg','shoes.jpg','kurti.jpg','watches.jpg','heels.jpg','necklace.jpg'],
|
| 72 |
+
title="Fashion Image Recommender").launch()
|