From bacd0afb400a46ce4e94bf231624591495d932a2 Mon Sep 17 00:00:00 2001 From: Adrian Bulat Date: Fri, 30 Aug 2024 15:19:23 +0100 Subject: [PATCH] Fix #292 ans #362 --- conda/meta.yaml | 2 +- face_alignment/__init__.py | 2 +- face_alignment/api.py | 4 ++-- setup.cfg | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 83e5637..dcd3598 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "1.4.1" %} +{% set version = "1.4.2" %} package: name: face_alignment diff --git a/face_alignment/__init__.py b/face_alignment/__init__.py index ba91140..6c09889 100644 --- a/face_alignment/__init__.py +++ b/face_alignment/__init__.py @@ -2,6 +2,6 @@ __author__ = """Adrian Bulat""" __email__ = 'adrian@adrianbulat.com' -__version__ = '1.4.1' +__version__ = '1.4.2' from .api import FaceAlignment, LandmarksType, NetworkSize \ No newline at end of file diff --git a/face_alignment/api.py b/face_alignment/api.py index 6b7d987..8df3f47 100644 --- a/face_alignment/api.py +++ b/face_alignment/api.py @@ -153,7 +153,7 @@ def get_landmarks_from_image(self, image_or_path, detected_faces=None, return_bb landmarks = [] landmarks_scores = [] for i, d in enumerate(detected_faces): - center = torch.tensor( + center = np.array( [d[2] - (d[2] - d[0]) / 2.0, d[3] - (d[3] - d[1]) / 2.0]) center[1] = center[1] - (d[3] - d[1]) * 0.12 scale = (d[2] - d[0] + d[3] - d[1]) / self.face_detector.reference_scale @@ -170,7 +170,7 @@ def get_landmarks_from_image(self, image_or_path, detected_faces=None, return_bb out += flip(self.face_alignment_net(flip(inp)).detach(), is_label=True) out = out.to(device='cpu', dtype=torch.float32).numpy() - pts, pts_img, scores = get_preds_fromhm(out, center.numpy(), scale) + pts, pts_img, scores = get_preds_fromhm(out, center, scale) pts, pts_img = torch.from_numpy(pts), torch.from_numpy(pts_img) pts, pts_img = pts.view(68, 2) * 4, pts_img.view(68, 2) scores = scores.squeeze(0) diff --git a/setup.cfg b/setup.cfg index 8323fcb..6b0b1f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.4.1 +current_version = 1.4.2 commit = True tag = True