vaniv commited on
Commit
0019967
·
verified ·
1 Parent(s): 764e2fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -70,6 +70,7 @@ def predict(image):
70
  complementary_color, complementary_palette = get_complementary_color(dominant_color)
71
  garment_recommendation = get_outfit_recommendation(pred_class)
72
 
 
73
  output = f"For your {pred_class.lower()}, consider pairing with {garment_recommendation.lower()} in {complementary_color}."
74
 
75
  # Handle monochromatic options
@@ -77,12 +78,12 @@ def predict(image):
77
  if complementary_color.lower() not in monochromatic_options:
78
  monochromatic_options.add(complementary_color.lower())
79
 
80
- output += "\n"
81
- output += f"Monochromatic options:"
82
- for color in monochromatic_options:
83
- output += f" {color},"
84
- output = output[:-1] # Removes the last comma
85
- output += "."
86
 
87
  return output # Return the formatted output
88
 
 
70
  complementary_color, complementary_palette = get_complementary_color(dominant_color)
71
  garment_recommendation = get_outfit_recommendation(pred_class)
72
 
73
+ # Construct output string
74
  output = f"For your {pred_class.lower()}, consider pairing with {garment_recommendation.lower()} in {complementary_color}."
75
 
76
  # Handle monochromatic options
 
78
  if complementary_color.lower() not in monochromatic_options:
79
  monochromatic_options.add(complementary_color.lower())
80
 
81
+ if len(monochromatic_options) > 0:
82
+ output += "\nMonochromatic options:"
83
+ for color in monochromatic_options:
84
+ output += f" {color},"
85
+ output = output[:-1] # Removes the last comma
86
+ output += "."
87
 
88
  return output # Return the formatted output
89