Senasu commited on
Commit
b223f7b
·
verified ·
1 Parent(s): 6a0530c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -63,8 +63,11 @@ if file is not None:
63
 
64
  # Display recommendations in a grid layout
65
  cols = st.columns(3) # 3 images per row
 
 
 
66
  for i, idx in enumerate(indices[0]):
67
- product_path = filenames[idx]
68
  st.write(product_path)
69
  product_image = Image.open(product_path)
70
 
 
63
 
64
  # Display recommendations in a grid layout
65
  cols = st.columns(3) # 3 images per row
66
+ base_dir = os.path.dirname(__file__) # Get the directory of the current script
67
+ images_dir = os.path.join(base_dir, "images") # Construct the images folder path
68
+
69
  for i, idx in enumerate(indices[0]):
70
+ product_path = os.path.join(images_dir, filenames[idx])
71
  st.write(product_path)
72
  product_image = Image.open(product_path)
73