vsrinivas commited on
Commit
ed01448
·
verified ·
1 Parent(s): 5d62c98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
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
- exact_match = filtered_df.loc[filtered_df['productDisplayName']==query, 'productDisplayName'].iat[0]
109
- print(f"Exact match: {exact_match}")
110
- exact_img = filtered_df.loc[filtered_df['productDisplayName']==query, 'image'].iat[0]
111
-
112
- if exact_match:
 
 
113
  imgs.insert(0, exact_img)
114
- matches.insert(0, exact_match)
 
 
 
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)}")