Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,11 @@ def shot(input, category, level):
|
|
54 |
face_embeddings = get_face_embeddings(ast.literal_eval(str(input)))
|
55 |
cropped_images, product_crops = get_cropped_images(ast.literal_eval(str(input)), category)
|
56 |
print(product_crops)
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
|
59 |
# Ensure all outputs are JSON serializable
|
60 |
output_dict['colors'] = {
|
|
|
54 |
face_embeddings = get_face_embeddings(ast.literal_eval(str(input)))
|
55 |
cropped_images, product_crops = get_cropped_images(ast.literal_eval(str(input)), category)
|
56 |
print(product_crops)
|
57 |
+
if len(product_crops) == 0:
|
58 |
+
print("No product crops found. Using image urls instead.")
|
59 |
+
subColour, mainColour, score = get_colour(ast.literal_eval(str(input)), category)
|
60 |
+
else:
|
61 |
+
subColour, mainColour, score = get_colour(product_crops, category)
|
62 |
|
63 |
# Ensure all outputs are JSON serializable
|
64 |
output_dict['colors'] = {
|