test
Browse files- handler.py +11 -10
handler.py
CHANGED
@@ -15,14 +15,15 @@ class EndpointHandler():
|
|
15 |
|
16 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
17 |
imageData = data.pop("image", data)
|
18 |
-
|
19 |
-
|
20 |
-
face_batch = [
|
21 |
-
if
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
else: return None
|
|
|
15 |
|
16 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
17 |
imageData = data.pop("image", data)
|
18 |
+
return imageData
|
19 |
+
# image = Image.open(BytesIO(base64.b64decode(imageData)))
|
20 |
+
# face_batch = self.mtcnn([image])
|
21 |
+
# face_batch = [i for i in face_batch if i is not None]
|
22 |
+
# if face_batch:
|
23 |
+
# aligned = torch.stack(face_batch)
|
24 |
+
# if self.device.type == "cuda":
|
25 |
+
# aligned = aligned.to(self.device)
|
26 |
|
27 |
+
# embeddings = self.resnet(aligned).detach().cpu()
|
28 |
+
# return embeddings.tolist()
|
29 |
+
# else: return None
|