Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -104,14 +104,19 @@ def process_input(query, slider_value):
|
|
104 |
|
105 |
###########
|
106 |
# exact_match = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['productDisplayName']
|
107 |
-
# exact_img = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['image
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
113 |
imgs.insert(0, exact_img)
|
114 |
-
matches.insert(0,
|
|
|
|
|
|
|
115 |
##########
|
116 |
|
117 |
print(f"No. of matching images: {len(imgs)}")
|
|
|
104 |
|
105 |
###########
|
106 |
# exact_match = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['productDisplayName']
|
107 |
+
# exact_img = filtered_df.filter(lambda x: x['productDisplayName'] == query)[0]['image
|
108 |
+
|
109 |
+
# exact_match = filtered_df.loc[filtered_df['productDisplayName']==query, 'productDisplayName'].iat[0]
|
110 |
+
# print(f"Exact match: {exact_match}")
|
111 |
+
# exact_img = filtered_df.loc[filtered_df['productDisplayName']==query, 'image'].iat[0]
|
112 |
+
|
113 |
+
if query in matches:
|
114 |
+
exact_img = filtered_df.loc[filtered_df['productDisplayName']==query, 'image'].iat[0]
|
115 |
imgs.insert(0, exact_img)
|
116 |
+
matches.insert(0, query)
|
117 |
+
# if exact_match:
|
118 |
+
# imgs.insert(0, exact_img)
|
119 |
+
# matches.insert(0, exact_match)
|
120 |
##########
|
121 |
|
122 |
print(f"No. of matching images: {len(imgs)}")
|