Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ def segment_image(input_image, text_input):
|
|
77 |
cropped_region = segmented_region[y:y+h, x:x+w]
|
78 |
|
79 |
# Convert to base64 image
|
80 |
-
_, buffer = cv2.imencode(".png", cropped_region)
|
81 |
segmented_image_base64 = base64.b64encode(buffer).decode()
|
82 |
|
83 |
# Calculate similarity for the segmented image
|
|
|
77 |
cropped_region = segmented_region[y:y+h, x:x+w]
|
78 |
|
79 |
# Convert to base64 image
|
80 |
+
_, buffer = cv2.imencode(".png", cv2.cvtColor(cropped_region, cv2.COLOR_BGR2RGB))
|
81 |
segmented_image_base64 = base64.b64encode(buffer).decode()
|
82 |
|
83 |
# Calculate similarity for the segmented image
|