Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 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 |
|