From 97cb800a40eb1fcbfa43b4d9b1e3500c6e50dcb7 Mon Sep 17 00:00:00 2001 From: Brandon Amos Date: Fri, 11 Dec 2015 10:22:15 -0500 Subject: [PATCH] Fix pep8 errors. --- openface/alignment/naive_dlib.py | 3 ++- openface/data.py | 1 + util/align-dlib.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openface/alignment/naive_dlib.py b/openface/alignment/naive_dlib.py index fa266aa..f74e222 100644 --- a/openface/alignment/naive_dlib.py +++ b/openface/alignment/naive_dlib.py @@ -62,6 +62,7 @@ TEMPLATE = np.float32([ TPL_MIN, TPL_MAX = np.min(TEMPLATE, axis=0), np.max(TEMPLATE, axis=0) MINMAX_TEMPLATE = (TEMPLATE - TPL_MIN) / (TPL_MAX - TPL_MIN) + class NaiveDlib: # https://github.com/cmusatyalab/openface/blob/master/images/dlib-landmark-mean.png INNER_EYES_AND_BOTTOM_LIP = np.array([39, 42, 57]) @@ -103,7 +104,7 @@ class NaiveDlib: if method == 'affine': H = cv2.getAffineTransform(npLandmarks[landmarkIndices], - size*MINMAX_TEMPLATE[landmarkIndices]) + size * MINMAX_TEMPLATE[landmarkIndices]) thumbnail = cv2.warpAffine(rgbImg, H, (size, size)) else: raise Exception('Unrecognized method: {}'.format(method)) diff --git a/openface/data.py b/openface/data.py index 82f4400..b46ccdb 100644 --- a/openface/data.py +++ b/openface/data.py @@ -16,6 +16,7 @@ import os import cv2 + class Image: def __init__(self, cls, name, path): diff --git a/util/align-dlib.py b/util/align-dlib.py index e3394a3..6f4cafb 100755 --- a/util/align-dlib.py +++ b/util/align-dlib.py @@ -101,7 +101,7 @@ def alignMain(args): if not os.path.isfile(imgName): rgb = imgObject.getRGB() outRgb = align.alignImg('affine', args.size, rgb, - landmarkIndices = landmarkIndices) + landmarkIndices=landmarkIndices) if args.fallbackLfw and outRgb is None: nFallbacks += 1 deepFunneled = "{}/{}.jpg".format(os.path.join(args.fallbackLfw,