Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion facemorpher/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

DATA_DIR = os.environ.get(
'DLIB_DATA_DIR',
path.join(path.dirname(path.dirname(path.realpath(__file__))), 'data')
#path.join(path.dirname(path.dirname(path.realpath(__file__))), 'data')
)
dlib_detector = dlib.get_frontal_face_detector()
print(path.join(DATA_DIR, 'shape_predictor_68_face_landmarks.dat'))
dlib_predictor = dlib.shape_predictor(path.join(DATA_DIR, 'shape_predictor_68_face_landmarks.dat'))

def boundary_points(points, width_percent=0.1, height_percent=0.1):
Expand Down
19 changes: 13 additions & 6 deletions facemorpher/morpher.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,19 @@
import numpy as np
import cv2

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

import locator
import aligner
import warper
import blender
import plotter
import videoer

def verify_args(args):
if args['--images'] is None:
Expand Down
11 changes: 7 additions & 4 deletions facemorpher/warper.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,22 @@ def test_local():
import cv2
import scipy.misc
import locator
import dlib
import aligner
from matplotlib import pyplot as plt

# Load source image
face_points_func = partial(locator.face_points, '../data')
base_path = '../females/Screenshot 2015-03-04 17.11.12.png'
src_path = '../females/BlDmB5QCYAAY8iw.jpg'
dlib_detector = dlib.get_frontal_face_detector()

base_path = r"F:\Photos\Adi\Actresses\Sara Jay\Screenshots\Sara Jay Sucks Cock in the Closet - Pornhub.com.ts_20210619_103500.199.jpg"
src_path = r"F:\Photos\Adi\Remini\Natalia Lavov\Whatsup\Remini20210509150317225 (3).jpg"
src_img = cv2.imread(src_path)

# Define control points for warps
src_points = face_points_func(src_path)
src_points = face_points_func(src_img)
base_img = cv2.imread(base_path)
base_points = face_points_func(base_path)
base_points = face_points_func(base_img)

size = (600, 500)
src_img, src_points = aligner.resize_align(src_img, src_points, size)
Expand Down