Skip to content

Commit

Permalink
Fix #292 ans #362
Browse files Browse the repository at this point in the history
  • Loading branch information
1adrianb committed Aug 30, 2024
1 parent c94dd02 commit bacd0af
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "1.4.1" %}
{% set version = "1.4.2" %}

package:
name: face_alignment
Expand Down
2 changes: 1 addition & 1 deletion face_alignment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

__author__ = """Adrian Bulat"""
__email__ = '[email protected]'
__version__ = '1.4.1'
__version__ = '1.4.2'

from .api import FaceAlignment, LandmarksType, NetworkSize
4 changes: 2 additions & 2 deletions face_alignment/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.4.1
current_version = 1.4.2
commit = True
tag = True

Expand Down

0 comments on commit bacd0af

Please sign in to comment.