Skip to content

luchaoqi/align_face

Repository files navigation

face alignment using dlib but for multi-processing, forked from: https://gist.github.com/lzhbrian/bde87ab23b499dd02ba4f588258f57d5

may also check other references:
https://github.com/yuval-alaluf/hyperstyle/blob/main/scripts/align_faces_parallel.py

requirements:

pip install numpy pillow dlib scipy
wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
bzip2 -dk shape_predictor_68_face_landmarks.dat.bz2
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ${CONDA_PREFIX}/lib/libstdc++.so.6

usage: python align_face_multi.py --input_dir /path/to/img_dir, you may adjust the number of cores for multi-processing.

For in-code face alignment (no separate data preprocessing through CLI), you may check the following projects (both of them are poorly documented):

  1. facexlib where an example in GFPGAN is given here.

sanity check of facexlib code justifies it with the following links: face_template values · Issue #14 · xinntao/facexlib and source code.

  1. insightface where you may find some examples here.

About

crop/align faces to FFHQ-style using dlib

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages