Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -105,6 +105,8 @@ def segment_image(input_image, text_input):
|
|
105 |
# Append the API result and similarity to the list
|
106 |
results_with_similarity.append({"api_result": api_result, "image": image_base64, "similarity": similarity})
|
107 |
|
|
|
|
|
108 |
results_with_similarity = results_with_similarity[:1]
|
109 |
|
110 |
# Print the top 6 results
|
|
|
105 |
# Append the API result and similarity to the list
|
106 |
results_with_similarity.append({"api_result": api_result, "image": image_base64, "similarity": similarity})
|
107 |
|
108 |
+
results_with_similarity.sort(key=lambda x: x["similarity"], reverse=True)
|
109 |
+
|
110 |
results_with_similarity = results_with_similarity[:1]
|
111 |
|
112 |
# Print the top 6 results
|