792x / face-alignment-dlib

Batch detect and align faces in images using dlib and opencv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Batch Face Detection Alignment

This is a script for detecting and aligning faces in images for batch processing. Alignment is a process of rotating a face to a vertically straight orientation, should the original face image is tilted.

Setup:

  1. Run pip install -r requirements.txt, or alternatively install dependencies manually.
  2. Download and extract shape predictor 68 landmarks at this link.
  3. Place the extracted predictor in the root directory of this project.
  4. Find some images with faces, most images from portraits to group photos should work as long as the resolution not too small.

Run:

python app.py inputfolder outputfolder

Example:

Example input Input Example output Output

Dependencies:

Known bugs:

  • Sometimes faces do not get detected and thus fail to get extracted.

About

Batch detect and align faces in images using dlib and opencv


Languages

Language:Python 100.0%