Maaz1 commited on
Commit
372e660
·
verified ·
1 Parent(s): c7d1c1f

Update backend/supportingfiles/image_processor.py

Browse files
backend/supportingfiles/image_processor.py CHANGED
@@ -47,14 +47,14 @@ class ImageProcessor:
47
  print(f"Error normalizing image: {str(e)}")
48
  return None
49
 
50
- def process_image(image, num_recommendations=5, skip_exact_match=True):
51
- """Process the selected image and return recommendations."""
52
- if isinstance(image, str): # If the input is a file path
53
- image = Image.open(image)
54
 
55
- recommender = JewelryRecommenderService()
56
- recommendations = recommender.get_recommendations(image, num_recommendations, skip_exact_match)
57
- return ResultFormatter.format_html(recommendations)
58
 
59
  def extract_embedding(self, image):
60
  """Extract feature embedding from an image.
 
47
  print(f"Error normalizing image: {str(e)}")
48
  return None
49
 
50
+ # def process_image(image, num_recommendations=5, skip_exact_match=True):
51
+ # """Process the selected image and return recommendations."""
52
+ # if isinstance(image, str): # If the input is a file path
53
+ # image = Image.open(image)
54
 
55
+ # recommender = JewelryRecommenderService()
56
+ # recommendations = recommender.get_recommendations(image, num_recommendations, skip_exact_match)
57
+ # return ResultFormatter.format_html(recommendations)
58
 
59
  def extract_embedding(self, image):
60
  """Extract feature embedding from an image.