Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -10,8 +10,8 @@ class EndpointHandler():
|
|
| 10 |
image_path = data.pop("inputs",data)
|
| 11 |
|
| 12 |
# Perform image segmentation
|
| 13 |
-
pillow_mask = self.pipe(
|
| 14 |
-
pillow_image = self.pipe(
|
| 15 |
|
| 16 |
# Save the segmented image at the root folder
|
| 17 |
output_image_path = "segmented_image.png"
|
|
|
|
| 10 |
image_path = data.pop("inputs",data)
|
| 11 |
|
| 12 |
# Perform image segmentation
|
| 13 |
+
pillow_mask = self.pipe(image_path, return_mask=True) # outputs a pillow mask
|
| 14 |
+
pillow_image = self.pipe(image_path) # outputs the segmented image
|
| 15 |
|
| 16 |
# Save the segmented image at the root folder
|
| 17 |
output_image_path = "segmented_image.png"
|