Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def segment_image(input_image, text_input):
|
|
67 |
x, y, w, h = map(int, mask_dict['bbox'])
|
68 |
cropped_region = segmented_region[y:y+h, x:x+w]
|
69 |
|
70 |
-
# Convert to base64 image
|
71 |
_, buffer = cv2.imencode(".png", cropped_region)
|
72 |
segmented_image_base64 = base64.b64encode(buffer).decode()
|
73 |
|
@@ -85,7 +85,6 @@ def segment_image(input_image, text_input):
|
|
85 |
|
86 |
|
87 |
|
88 |
-
|
89 |
# def segment_image(input_image, text_input):
|
90 |
# image_bytes = base64.b64decode(input_image)
|
91 |
# image = Image.open(BytesIO(image_bytes))
|
|
|
67 |
x, y, w, h = map(int, mask_dict['bbox'])
|
68 |
cropped_region = segmented_region[y:y+h, x:x+w]
|
69 |
|
70 |
+
# Convert the cropped region to a base64 image
|
71 |
_, buffer = cv2.imencode(".png", cropped_region)
|
72 |
segmented_image_base64 = base64.b64encode(buffer).decode()
|
73 |
|
|
|
85 |
|
86 |
|
87 |
|
|
|
88 |
# def segment_image(input_image, text_input):
|
89 |
# image_bytes = base64.b64decode(input_image)
|
90 |
# image = Image.open(BytesIO(image_bytes))
|