align-dlib: Fix logic for debug images for #43.

This commit is contained in:
Brandon Amos 2015-10-29 15:24:16 -04:00
parent f9170eb3aa
commit 986db491be
2 changed files with 5 additions and 3 deletions

View File

@ -149,7 +149,7 @@ class NaiveDlib:
"face's bounding box.")
return
if outputPrefix:
if outputDebug:
io.imsave(getName(), cwImg)
return cwImg

View File

@ -89,12 +89,14 @@ def alignMain(args):
nFallbacks = 0
for imgObject in imgs:
outDir = os.path.join(args.outputDir, imgObject.cls)
imgName = "{}/{}.png".format(outDir, imgObject.name)
openface.helper.mkdirP(outDir)
outputPrefix = os.path.join(outDir, imgObject.name)
imgName = outputPrefix + ".png"
if not os.path.isfile(imgName):
rgb = imgObject.getRGB(cache=False)
out = align.alignImg(args.method, args.size, rgb,
outputPrefix=outDir,
outputPrefix=outputPrefix,
outputDebug=args.outputDebugImages)
if args.fallbackLfw and out is None:
nFallbacks += 1