Fix pep8 errors.
This commit is contained in:
parent
ec7650cf73
commit
97cb800a40
|
@ -62,6 +62,7 @@ TEMPLATE = np.float32([
|
||||||
TPL_MIN, TPL_MAX = np.min(TEMPLATE, axis=0), np.max(TEMPLATE, axis=0)
|
TPL_MIN, TPL_MAX = np.min(TEMPLATE, axis=0), np.max(TEMPLATE, axis=0)
|
||||||
MINMAX_TEMPLATE = (TEMPLATE - TPL_MIN) / (TPL_MAX - TPL_MIN)
|
MINMAX_TEMPLATE = (TEMPLATE - TPL_MIN) / (TPL_MAX - TPL_MIN)
|
||||||
|
|
||||||
|
|
||||||
class NaiveDlib:
|
class NaiveDlib:
|
||||||
# https://github.com/cmusatyalab/openface/blob/master/images/dlib-landmark-mean.png
|
# https://github.com/cmusatyalab/openface/blob/master/images/dlib-landmark-mean.png
|
||||||
INNER_EYES_AND_BOTTOM_LIP = np.array([39, 42, 57])
|
INNER_EYES_AND_BOTTOM_LIP = np.array([39, 42, 57])
|
||||||
|
@ -103,7 +104,7 @@ class NaiveDlib:
|
||||||
|
|
||||||
if method == 'affine':
|
if method == 'affine':
|
||||||
H = cv2.getAffineTransform(npLandmarks[landmarkIndices],
|
H = cv2.getAffineTransform(npLandmarks[landmarkIndices],
|
||||||
size*MINMAX_TEMPLATE[landmarkIndices])
|
size * MINMAX_TEMPLATE[landmarkIndices])
|
||||||
thumbnail = cv2.warpAffine(rgbImg, H, (size, size))
|
thumbnail = cv2.warpAffine(rgbImg, H, (size, size))
|
||||||
else:
|
else:
|
||||||
raise Exception('Unrecognized method: {}'.format(method))
|
raise Exception('Unrecognized method: {}'.format(method))
|
||||||
|
|
|
@ -16,6 +16,7 @@ import os
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
|
|
||||||
|
|
||||||
class Image:
|
class Image:
|
||||||
|
|
||||||
def __init__(self, cls, name, path):
|
def __init__(self, cls, name, path):
|
||||||
|
|
|
@ -101,7 +101,7 @@ def alignMain(args):
|
||||||
if not os.path.isfile(imgName):
|
if not os.path.isfile(imgName):
|
||||||
rgb = imgObject.getRGB()
|
rgb = imgObject.getRGB()
|
||||||
outRgb = align.alignImg('affine', args.size, rgb,
|
outRgb = align.alignImg('affine', args.size, rgb,
|
||||||
landmarkIndices = landmarkIndices)
|
landmarkIndices=landmarkIndices)
|
||||||
if args.fallbackLfw and outRgb is None:
|
if args.fallbackLfw and outRgb is None:
|
||||||
nFallbacks += 1
|
nFallbacks += 1
|
||||||
deepFunneled = "{}/{}.jpg".format(os.path.join(args.fallbackLfw,
|
deepFunneled = "{}/{}.jpg".format(os.path.join(args.fallbackLfw,
|
||||||
|
|
Loading…
Reference in New Issue