Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -7,7 +7,7 @@ class EndpointHandler():
|
|
| 7 |
self.pipe = pipeline("image-segmentation", model=path, trust_remote_code=True)
|
| 8 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 9 |
# Extract the image path from the input data
|
| 10 |
-
image_path = data.pop("
|
| 11 |
|
| 12 |
# Perform image segmentation
|
| 13 |
pillow_mask = self.pipe(image_path, return_mask=True) # outputs a pillow mask
|
|
|
|
| 7 |
self.pipe = pipeline("image-segmentation", model=path, trust_remote_code=True)
|
| 8 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 9 |
# Extract the image path from the input data
|
| 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
|