The Menpo Project package for state-of-the-art 2D deformable modelling techniques. Currently, the techniques that have been implemented include:
- Lucas-Kanade Image Alignment
- Optimization algorithms: Forward Additive, Forward/Inverse Compositional
- Residuals: SSD, Fourier SSD, ECC, Gradient Correlation, Gradient Images
- Active Template Model
- Model variants: Holistic, Patch-based, Masked, Linear, Linear Masked
- Optimization algorithm: Lucas-Kanade Gradient Descent (Forward/Inverse Compositional)
- Active Appearance Model
- Model variants: Holistic, Patch-based, Masked, Linear, Linear Masked
- Optimization algorithms: Lucas-Kanade Gradient Descent (Alternating, Modified Alternating, Project Out, Simultaneous, Wiberg), Casaded-Regression
- Active Pictorial Structures
- Model variant: Generative
- Optimization algorithm: Weighted Gauss-Newton Optimisation with fixed Jacobian and Hessian
- Constrained Local Model
- Active Shape Models
- Regularized Landmark Mean-Shift
- Unified Active Appearance Model and Constrained Local Model
- Alternating/Project Out Regularized Landmark Mean-Shift
- Ensemble of Regression Trees
- [provided by DLib]
- Supervised Descent Method
- Model variants: Non Parametric, Parametric Shape, Parametric Appearance, Fully Parametric
MenpoFit requires Python 3.11 or newer and Menpo 0.13 or newer:
> pip install menpofit
or from conda-forge:
> conda install -c conda-forge menpofit
Optional extras: pip install "menpofit[dlib]" (the menpofit.dlib wrapper, needs dlib)
and pip install "menpofit[fft]" (faster FFTs with pyFFTW).
See our documentation on ReadTheDocs
Any pretrained models are provided under the assumption that they are used only for academic purposes and may not be used for commercial applications. Please see the license of the 300W project - upon which our pretrained models are trained.
Specifically, the pretrained models in menpofit.aam.pretrained may only be used for academic purposes.
With uv installed, uv run pytest sets up an environment and runs the unit and
smoke tests, and uv run ruff check . lints and uv run ruff format . formats the code (CI checks both). To keep git blame useful after the one-off reformatting, run
git config blame.ignoreRevsFile .git-blame-ignore-revs (GitHub does this automatically). The docs are built with Sphinx (pip install -r docs/requirements.txt,
then sphinx-build docs/source docs/_build).
Versions come from git tags (via setuptools-scm). To release, tag the commit on master
(git tag -a v0.8.1 -m "menpofit 0.8.1" && git push origin v0.8.1) and approve the pypi deployment on the
resulting Release workflow run. Before anything is
published the workflow validates .readthedocs.yaml and builds the docs on the tagged commit (Read the Docs reads its
configuration from the tag, so a broken docs setup cannot be repaired afterwards); it then uploads the sdist and wheel
to PyPI with trusted publishing, creates a GitHub release (tags like v0.8.1rc1 or v0.8.1.dev1 are pre-releases), and
finally waits for Read the Docs to build stable. A manual run with publish: testpypi is a dry run. Do not put two
release tags on the same commit: the version is derived from the tag.
