A Python toolbox for Automatic Face Alignment (AFA)

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

    Similar works

    Full text

    thumbnail-image

    Available Versions