user-agent commited on
Commit
fe481f7
1 Parent(s): 51b66fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -13
app.py CHANGED
@@ -53,19 +53,23 @@ def shot(input, category, level):
53
  openai_parsed_response = get_openAI_tags(ast.literal_eval(str(input)))
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'] = {
65
- "main": mainColour,
66
- "sub": subColour,
67
- "score": score
68
- }
 
 
 
 
69
  output_dict['image_mapping'] = openai_parsed_response
70
  output_dict['face_embeddings'] = face_embeddings
71
  output_dict['cropped_images'] = cropped_images
 
53
  openai_parsed_response = get_openAI_tags(ast.literal_eval(str(input)))
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
+
57
+ # Commenting out the color
58
+ # -------------------------
59
+ # if len(product_crops) == 0:
60
+ # print("No product crops found. Using image urls instead.")
61
+ # subColour, mainColour, score = get_colour(ast.literal_eval(str(input)), category)
62
+ # else:
63
+ # subColour, mainColour, score = get_colour(product_crops, category)
64
+
65
+ # # Ensure all outputs are JSON serializable
66
+ # output_dict['colors'] = {
67
+ # "main": mainColour,
68
+ # "sub": subColour,
69
+ # "score": score
70
+ # }
71
+ # -------------------------
72
+
73
  output_dict['image_mapping'] = openai_parsed_response
74
  output_dict['face_embeddings'] = face_embeddings
75
  output_dict['cropped_images'] = cropped_images