image in the right place
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -14,7 +14,7 @@ class EndpointHandler():
|
|
14 |
self.resnet = InceptionResnetV1(pretrained='vggface2', device=self.device).eval()
|
15 |
|
16 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
17 |
-
imageData = data
|
18 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
19 |
face_batch = self.mtcnn([image])
|
20 |
face_batch = [i for i in face_batch if i is not None]
|
|
|
14 |
self.resnet = InceptionResnetV1(pretrained='vggface2', device=self.device).eval()
|
15 |
|
16 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
17 |
+
imageData = data.pop("image", data)
|
18 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
19 |
face_batch = self.mtcnn([image])
|
20 |
face_batch = [i for i in face_batch if i is not None]
|