← Open Source

Menpo's 2D deformable modelling toolkit (AAMs/CLMs/SDMs).

Model DevelopmentClassical MLPython
Momentum
+0stars in 24 hours0.0%
132
Stars
61
Forks
+0
This week
10
Contributors
Created 2014-10-27 · Updated 2026-11-30 · #28117 today
Top developers
README



menpofit - A deformable modelling toolkit

The Menpo Project package for state-of-the-art 2D deformable modelling techniques. Currently, the techniques that have been implemented include:

Affine Image Alignment

  • Lucas-Kanade Image Alignment
    • Optimization algorithms: Forward Additive, Forward/Inverse Compositional
    • Residuals: SSD, Fourier SSD, ECC, Gradient Correlation, Gradient Images

Deformable Image Alignment

  • Active Template Model
    • Model variants: Holistic, Patch-based, Masked, Linear, Linear Masked
    • Optimization algorithm: Lucas-Kanade Gradient Descent (Forward/Inverse Compositional)

Landmark Localization

  • 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

Installation

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).

Documentation

See our documentation on ReadTheDocs

Pretrained Models

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.

Development

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).

Releasing

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.

Nearby in the ranking
Similar items

AI Rank for iPhone

Follow AI model rankings

Download on the App Store