Skip to main content

Python facial landmarking and analysis

Project description

pfla: Python Facial Landmark Analysis

GitHub release PyPI license PyPI version PyPI pyversions Documentation Status Build Status DOI

A simple command line interface to automate facial analysis. pfla uses a pre-trained neural networks to detect faces and annotate them with 68 landmarks. The program also compyte four commonly used facial metrics. The output is saved to a file to allow for easy statistical analysis by the user.


This software was published in JOSS. Since version 1.0.0, the packaged has changed considerably. The publication release is still available here.


If you use this software please use this citation:

doi = {10.21105/joss.00855},
url = {},
year = 2018,
month = {dec},
publisher = {The Open Journal},
volume = {3},
number = {32},
pages = {855},
author = {Maxime Rousseau and Jean-Marc Retrouvey},
title = {pfla: A Python Package for Dental Facial Analysis using Computer Vision and Statistical Shape Analysis},
journal = {Journal of Open Source Software}}


  • Face detection using mtcnn
  • Landmark placement
  • Facial metric calculations

Requirements and Dependencies

  • Python 3.5 (or higher)
  • Python packages:
    • numpy
    • pandas
    • pytest
    • pillow
    • facenet-pytorch
    • face-alignment
    • pytest-cov
    • pytorch


Install with pip:

pip install -r requirements-pytorch.txt \ # pytorch for CPU
pip install -r requirements.txt # other dependencies
pip install pfla


usage: pfla [-h] [-d] [-l] [-m] [-o OUTPUT] [-v] path

PFLA: python facial landmark analysis. This program will read the image(s)
given as input and can apply a face detection algorithm, landmark placement
and computation of metrics. The results are returned as a text stream.

positional arguments:
  path                  path to the image or directory of images

optional arguments:
  -h, --help            show this help message and exit
  -d, --detect          detect faces and output bounding box
  -l, --landmark        annotate detected faces and output coordinates
  -m, --metrics         compute metrics and output results
  -o OUTPUT, --output OUTPUT
                        specify output filename and format/filetype of the
  -v, --verbose         increase output verbosity

AUTHOR: Maxime Rousseau LICENSE: MIT


To test your installation run the following commands:



Documentation of the package can be found here:



The project is licensed under the MIT license.


Maxime Rousseau, DMD candidate 2020 McGill University, Faculty of Dentistry

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfla-1.0.0.tar.gz (10.4 kB view hashes)

Uploaded source

Built Distribution

pfla-1.0.0-py3-none-any.whl (11.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page