Skip to content

Commit

Permalink
Use pip installed stasm. Clean up plotter and videoer
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaq committed May 30, 2018
1 parent c372129 commit 293c743
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 89,696 deletions.
1 change: 0 additions & 1 deletion facemorpher/aligner.py
@@ -1,7 +1,6 @@
"""
Align face and image sizes
"""
from __future__ import division
import cv2
import numpy as np

Expand Down
16 changes: 8 additions & 8 deletions facemorpher/averager.py
Expand Up @@ -25,14 +25,14 @@
import os
import cv2
import numpy as np
import scipy.ndimage
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

from facemorpher import locator
from facemorpher import aligner
from facemorpher import warper
from facemorpher import blender
from facemorpher import plotter

def list_imgpaths(imgfolder):
for fname in os.listdir(imgfolder):
Expand All @@ -46,8 +46,8 @@ def sharpen(img):
return cv2.addWeighted(img, 1.4, blured, -0.4, 0)

def load_image_points(path, size):
img = scipy.ndimage.imread(path)[..., :3]
points = locator.face_points(path)
img = cv2.imread(path)
points = locator.face_points(img)

if len(points) == 0:
print('No face in %s' % path)
Expand Down Expand Up @@ -96,12 +96,12 @@ def averager(imgpaths, dest_filename=None, width=500, height=600, alpha=False,
mask = cv2.blur(mask, (blur_radius, blur_radius))
if alpha:
dest_img = np.dstack((dest_img, mask))
mpimg.imsave(out_filename, dest_img)

if plot:
plt.axis('off')
plt.imshow(dest_img)
plt.show()
print('Averaged {} images'.format(num_images))
plt = plotter.Plotter(plot, num_images=1, out_filename=out_filename)
plt.save(dest_img)
plt.plot_one(dest_img)
plt.show()

def main():
args = docopt(__doc__, version='Face Averager 1.0')
Expand Down
Binary file removed facemorpher/bin/stasm_util_linux_cv3.4.1
Binary file not shown.
Binary file removed facemorpher/bin/stasm_util_osx_cv3.4.1
Binary file not shown.
11 changes: 0 additions & 11 deletions facemorpher/cvver.py

This file was deleted.

0 comments on commit 293c743

Please sign in to comment.