From 5e5a7d09774bde195fe31ae143704eb124a764ac Mon Sep 17 00:00:00 2001 From: adamhrv Date: Mon, 7 Jan 2019 02:26:34 +0100 Subject: add demos, in progress --- megapixels/app/processors/face_landmarks_3d.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'megapixels/app/processors/face_landmarks_3d.py') diff --git a/megapixels/app/processors/face_landmarks_3d.py b/megapixels/app/processors/face_landmarks_3d.py index 470d263c..5a0d6097 100644 --- a/megapixels/app/processors/face_landmarks_3d.py +++ b/megapixels/app/processors/face_landmarks_3d.py @@ -26,14 +26,15 @@ class FaceAlignment3D(Landmarks3D): # Estimates 3D facial landmarks import face_alignment - def __init__(self, gpu=0, flip_input=False): + def __init__(self, gpu=0, flip_input=True): super().__init__() device = f'cuda:{gpu}' if gpu > -1 else 'cpu' self.fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, device=device, flip_input=flip_input) - def landmarks(self, im, as_type=str): + def landmarks(self, im, bbox, as_type=str): '''Calculates the 3D facial landmarks :param im: (numpy.ndarray) image + :param bbox: (BBox) dimensioned to real (int) sizes :param as_type: (str) or (list) type to return data ''' preds = self.fa.get_landmarks(im) -- cgit v1.2.3-70-g09d2