ktllc commited on
Commit
d3f5c13
·
1 Parent(s): 74e5368

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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