Update app.py
Browse files
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
|
| 130 |
for index in range(start_index, end_index):
|
| 131 |
-
img_id =
|
| 132 |
-
img_path = df.loc[
|
| 133 |
-
product_id = df.loc[
|
| 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()
|