Pairavi commited on
Commit
8d4e1cd
·
1 Parent(s): 5a1c9ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -126,11 +126,11 @@ def main():
126
  start_index = (tabs - 1) * images_per_page
127
  end_index = min(start_index + images_per_page, length)
128
 
129
- # Loop through each row in the CSV data for the selected page
130
  for index in range(start_index, end_index):
131
- img_id = df.loc[index, 'seller_img_id']
132
- img_path = df.loc[index, 'img_path']
133
- product_id = df.loc[index, 'product_id']
134
 
135
  # Construct the full path to the image
136
  full_img_path = img_path
@@ -142,6 +142,7 @@ def main():
142
  # Determine the column to place the image in
143
  col_index = index % num_columns
144
  st.image(resized_image, caption=f'Product ID: {product_id}\nImage ID: {img_id}', width=image_width)
 
145
 
146
  if __name__ == '__main__':
147
  main()
 
126
  start_index = (tabs - 1) * images_per_page
127
  end_index = min(start_index + images_per_page, length)
128
 
129
+ # Loop through each similar image
130
  for index in range(start_index, end_index):
131
+ img_id = similar_images[index]
132
+ img_path = df.loc[df['seller_img_id'] == img_id, 'img_path'].values[0]
133
+ product_id = df.loc[df['seller_img_id'] == img_id, 'product_id'].values[0]
134
 
135
  # Construct the full path to the image
136
  full_img_path = img_path
 
142
  # Determine the column to place the image in
143
  col_index = index % num_columns
144
  st.image(resized_image, caption=f'Product ID: {product_id}\nImage ID: {img_id}', width=image_width)
145
+
146
 
147
  if __name__ == '__main__':
148
  main()