Install & Compatibility
Where this runs
tested against v1.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
5427MB installed
● package 5427MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FaceAlignment
✓ from face_alignment import FaceAlignment
✗ import face_alignment
The class is not the module; must import explicitly.
LandmarksType
✓ from face_alignment import LandmarksType
NetworkSize
✓ from face_alignment import NetworkSize
Load an image, run face alignment, and print 2D landmarks.
import cv2
from face_alignment import FaceAlignment, LandmarksType, NetworkSize
fa = FaceAlignment(LandmarksType.TWO_D, network_size=NetworkSize.LARGE)
img = cv2.imread('input.jpg')
preds = fa.get_landmarks(img)
print(preds)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'face_alignment'
Package not installed or installed with wrong name.
fixpip install face-alignment
TypeError: 'NoneType' object is not iterable
get_landmarks returned None because no face detected.
fixCheck: if preds is not None: ...
RuntimeError: Model not found. Please download the model first.
Missing model weights; network issue prevented download.
fixRun once with internet, or manually download from torch.hub.
AttributeError: module 'face_alignment' has no attribute 'FaceAlignment'
Wrong import statement: import face_alignment instead of from face_alignment import FaceAlignment.
fixUse: from face_alignment import FaceAlignment
ValueError: Cannot load model with given network size
Incorrect NetworkSize argument.
fixUse NetworkSize.LARGE or NetworkSize.LARGE2 (4GB+ VRAM) as appropriate.
Upgrade
Version history
1.5.0latest on PyPI · released Apr 6, 2026
Audit
Dependencies
torchrequiredDeep learning framework for model inference.
numpyrequiredArray operations.
opencv-pythonrequiredImage loading and processing.
scikit-imagerequiredImage transformation utilities.