rfmantoan commited on
Commit
2bd9f7e
1 Parent(s): 1daa566

Fix image path

Browse files
utils/embedding_generation.py CHANGED
@@ -8,7 +8,7 @@ def get_info(catalog, column):
8
  text_descriptions = []
9
 
10
  for index, row in catalog.iterrows():
11
- path = "/content/drive/MyDrive/images/" + str(row["Id"]) + ".jpg"
12
  image_paths.append(path)
13
  text_descriptions.append(row[column])
14
 
 
8
  text_descriptions = []
9
 
10
  for index, row in catalog.iterrows():
11
+ path = "/home/user/app/images" + str(row["Id"]) + ".jpg"
12
  image_paths.append(path)
13
  text_descriptions.append(row[column])
14
 
utils/refine_metadata.py CHANGED
@@ -47,7 +47,7 @@ def refine_metadata(catalog, column):
47
 
48
  # Ensure the image ID is converted to a string
49
  #image_path = "/content/drive/MyDrive/images/" + str(row["Id"]) + ".jpg"
50
- image_path = "/images/" + str(row["Id"]) + ".jpg"
51
 
52
  # Generate the image description using LLaVA
53
  refined_metadata = refine_metadata(metadata, image_path)
 
47
 
48
  # Ensure the image ID is converted to a string
49
  #image_path = "/content/drive/MyDrive/images/" + str(row["Id"]) + ".jpg"
50
+ image_path = "/home/user/app/images/" + str(row["Id"]) + ".jpg"
51
 
52
  # Generate the image description using LLaVA
53
  refined_metadata = refine_metadata(metadata, image_path)
utils/vector_database.py CHANGED
@@ -67,7 +67,7 @@ def search_in_milvus(collection, search_field, query_embedding, top_k=6):
67
 
68
  # Load the image (you can use PIL to load the image)
69
  #image_path = "/content/drive/MyDrive/images/" + str(image_id) + ".jpg"
70
- image_path = "/images/" + str(image_id) + ".jpg"
71
  image = Image.open(image_path)
72
 
73
  # Append the image, metadata, and score to the search results
 
67
 
68
  # Load the image (you can use PIL to load the image)
69
  #image_path = "/content/drive/MyDrive/images/" + str(image_id) + ".jpg"
70
+ image_path = "/home/user/app/images/" + str(image_id) + ".jpg"
71
  image = Image.open(image_path)
72
 
73
  # Append the image, metadata, and score to the search results