A Python toolbox for Automatic Face Alignment (AFA)

preprint OA: closed
View at publisher

Abstract

We describe AFA, an open-source Python package for automating the most common step in the preparation of facial stimuli for behavioral and neuro-imaging experiments – spatial alignment of faces (https://github.com/SourCherries/auto-face-align ). Face alignment is also important in the analysis of image statistics, and as a preprocessing step for machine learning. Automation of face alignment via AFA provides a reliable and efficient alternative to the very common practice of manual image-editing in graphics editors like Photoshop. As an open-source Python package, AFA encourages a clear and transparent specification of experimental method. AFA is based on facial landmark detection that is powered by the reliable and open-source DLIB library; and critical alignment code based on Generalized Procrustes Analysis (GPA) has been extensively unit-tested. AFA documentation and modularity provides opportunity for the modification and extensibility of AFA by the scientific community. As examples, we include functions for automatically generating image apertures that conceal areas outside the inner face; for image morphing between facial identities; and for shape-based averaging of facial identity. All of these are examples of stimulus preparation that have previously required manual landmark selection.

My notes (saved in your browser only)

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. The paper's references may be in our DB but unresolved to ``paper_id`` (resolution happens at ingest when the cited DOI matches a row we already have). Run the cross-source citation reconcile pass to retry.

Source provenance

europepmc
last seen: 2026-05-19T01:45:01.086888+00:00
unpaywall
last seen: 2026-06-13T06:42:57.164913+00:00