Skip to content

Native Windows video motion capture with ExMR, FlowHMR and GVHMR, contact correction, humanoid retargeting, and FBX/VMD export.

Python

Align automatic MAMMA cameras with GeoCalib background gravity

toyxyzcbe5c160daa9
diff --git a/AGENTS.md b/AGENTS.md
index c84777b..312b6af 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -10,7 +10,7 @@ setup from custom builds and requires actual CUDA verification before registerin
a manually built environment. For optional PromptHMR setup and its separate SAM2
build, follow [docs/models/PROMPTHMR.md](docs/models/PROMPTHMR.md).
-- This is the Windows Git/CMD distribution. Preserve the separate pinned runtimes and model-specific behavior. `install.cmd` covers ExMR/FlowHMR/GVHMR and PEAR's small shared-runtime support overlay; MAMMA and PromptHMR remain optional through their separate setup commands. Do not merge their packages or assume `update.cmd` installs them.
+- This is the Windows Git/CMD distribution. Preserve the separate pinned runtimes and model-specific behavior. `install.cmd` covers ExMR/FlowHMR/GVHMR and the small shared-runtime camera support overlay used by PEAR and MAMMA gravity; MAMMA and PromptHMR remain optional through their separate setup commands. Do not merge their packages or assume `update.cmd` installs them.
- PEAR is a transient single-person bone preview. Selecting it must not start models or modify an offline project. Start/Stop controls the resident worker; see `docs/models/PEAR.md` for fixed bones, Reset Bones, One Euro filtering and World Position. Keep inference and capture off the GUI thread, use bounded latest-frame queues and preserve offline state on exit.
- Treat local `models/`, `projects/`, `cache/`, `character_scenes/`, runtime folders, external project folders and registered model data as user-owned. Do not delete, overwrite, upload or migrate them without appropriate user authorization. Ignore rules are not backups.
- Preserve inference and selected-result behavior when working on preview, contacts or export. Review the relevant code and validation records before changing numerical processing.
diff --git a/README.md b/README.md
index 7f3af84..8450936 100644
--- a/README.md
+++ b/README.md
@@ -131,7 +131,7 @@ do not put passwords or account tokens in the agent chat.
videos; thumbnails switch the preview and one timeline trim applies to all views.
2. For ExMR, FlowHMR or GVHMR, optionally use **Find person** to select people.
PromptHMR tracks people together during reconstruction.
- MAMMA detects people during reconstruction; keep **VGGT (Automatic)** and
+ MAMMA detects people during reconstruction; keep **VGGT-Omega + GeoCalib (Automatic)** and
enter an approximate **Reference Height (m)**, or import camera calibration.
Click **Reconstruct 3D**.
3. Review the motion, edit contacts if needed and **Apply Correction**.
@@ -162,21 +162,21 @@ motion quality was lower than **ExMR**. It does not support finger tracking.
Requires 64-bit Windows, a compatible NVIDIA GPU/driver and OpenGL 4.3.
Model files are acquired separately; some require registration and license acceptance.
-**Installed models and runtimes:** approximately **67.8 GB (63.1 GiB)** for the
-five offline models, including supported add-ons, Blender and FFmpeg. Measured without
+**Installed models and runtimes:** approximately **67.9 GB (63.2 GiB)** for the
+five offline models, including supported add-ons, Blender and FFmpeg. Based on the measured inventory plus GeoCalib for automatic MAMMA gravity, excluding
projects, caches or retained downloads; shared files are counted once.
| Configuration | Runtime | Models | Total |
| --- | ---: | ---: | ---: |
| ExMR + FlowHMR + GVHMR and supported add-ons | 12.35 GiB | 28.89 GiB | 41.23 GiB |
-| MAMMA additional files | 6.11 GiB | 3.42 GiB | 9.54 GiB |
+| MAMMA additional files | 6.11 GiB | 3.53 GiB | 9.65 GiB |
| PromptHMR additional files | 6.22 GiB | 6.13 GiB | 12.34 GiB |
-| **Five offline models** | **24.68 GiB** | **38.44 GiB** | **63.11 GiB** |
-| PEAR live preview, additional | Small support overlay; shared runtime reused | ~2.95 GiB | ~2.96 GiB |
+| **Five offline models** | **24.68 GiB** | **38.55 GiB** | **63.22 GiB** |
+| PEAR live preview, additional | Small support overlay; shared runtime reused | ~2.84 GiB | ~2.85 GiB |
Including PEAR, the estimated combined model/runtime total is about
-**66.07 GiB (70.9 GB)**, before the additional space listed below. PEAR includes about **0.11 GiB** for GeoCalib weights and reuses VGGT; see its
-[detailed guide](docs/models/PEAR.md#multiple-fixed-cameras-and-camera-align).
+**66.07 GiB (70.9 GB)**, before the additional space listed below. GeoCalib weights (about **0.11 GiB**) are shared by MAMMA and PEAR and counted once; both also reuse VGGT. See the
+[PEAR camera guide](docs/models/PEAR.md#multiple-fixed-cameras-and-camera-align).
**MAMMA and PromptHMR require separate runtime installation:** run
`Setup_MAMMA.cmd` or `Setup_PromptHMR.cmd` after `install.cmd`, as described
diff --git a/SOURCE_MANIFEST.json b/SOURCE_MANIFEST.json
index 1f8b3d6..2ccc0b1 100644
--- a/SOURCE_MANIFEST.json
+++ b/SOURCE_MANIFEST.json
@@ -16,8 +16,8 @@
},
{
"path": "AGENTS.md",
- "bytes": 2139,
- "sha256": "b365e79eb890dbd5ea081274462b2170d0226973a4ac15e1828789e3b23585a1"
+ "bytes": 2174,
+ "sha256": "9b25172bb63b4441a582c48a2bf3df1906aca6a3f0ffed8307a08ce7d37ecd89"
},
{
"path": "LICENSE",
@@ -26,8 +26,8 @@
},
{
"path": "README.md",
- "bytes": 11014,
- "sha256": "eb050623300c8060384c946c1e4b9dedb257c0e72fc4477751b9af3c38ee175f"
+ "bytes": 11138,
+ "sha256": "5f845886d42e36d5efd06e530fa4cac0b95b5f01a1a84664f2f34365a360c6ba"
},
{
"path": "RGBMoCap.cmd",
@@ -46,8 +46,8 @@
},
{
"path": "THIRD_PARTY_NOTICES.md",
- "bytes": 9190,
- "sha256": "12fdb67ddce790b575bcd94e4e584d959617761cbebae0d0def6c69c00bc7450"
+ "bytes": 9231,
+ "sha256": "ec3f55194be2b53f0102914c13f16ae0378f0cef0d0f9cb95defaed7f4786f88"
},
{
"path": "app.py",
@@ -96,28 +96,28 @@
},
{
"path": "docs/AGENT_GUIDE.md",
- "bytes": 49676,
- "sha256": "52244d5b7802e92b077248c0cb4b795119db079bb99ca99369bbc3f0ffc9f531"
+ "bytes": 50399,
+ "sha256": "51f0c8cb9df08d176f0d68ded6e78053beb1b22a44e4342af9992dc36f5c338e"
},
{
"path": "docs/BUILD.md",
- "bytes": 12130,
- "sha256": "35bbd75bd41239ed1919ad2c2cac911daf84737856385f4b53ad507eefbe2c1b"
+ "bytes": 12591,
+ "sha256": "74b42d2ecf5ecd565105ec94171aadc016368411a7c7629ffe1a2d99ccd8cdc8"
},
{
"path": "docs/CITATIONS.md",
- "bytes": 6463,
- "sha256": "f244bc8076ab740be6ca58f567009b6a7d9d37b3d7aee68182d7e0005e07032e"
+ "bytes": 6491,
+ "sha256": "c6db246a24c3b718cffbe7277a691145d366bb3df019c3cd7eff9f7040270a9f"
},
{
"path": "docs/MAMMA.md",
- "bytes": 23465,
- "sha256": "eb1e97d8bb92d20847445678cc58ea6eea8b90e354186c8431748b16def1fbe1"
+ "bytes": 25483,
+ "sha256": "838d3d7aa5b28c6f56ed7228d5742bedd8b5efc069f77b7774b4377f0e0671d2"
},
{
"path": "docs/MAMMA_AGENT_SETUP.md",
- "bytes": 22119,
- "sha256": "8f832c9403cf067b773f71b18321b8b31400ec629d9b3c25fd37917a5c945368"
+ "bytes": 22466,
+ "sha256": "39bd2ad349d37f2efa6246ffd76c345f422ffe5155eea010d4d46c96f1b23851"
},
{
"path": "docs/PERFORMANCE.md",
@@ -126,13 +126,13 @@
},
{
"path": "docs/USER_GUIDE.md",
- "bytes": 49391,
- "sha256": "ba20ad84994aa955a60e339b838fc94b58716113d94475130b3d5468da84d34a"
+ "bytes": 49858,
+ "sha256": "726fc7ec5743fb488819acea02e96ccf66de3709d5f73d77cbfd1048e9ab72aa"
},
{
"path": "docs/VALIDATION.md",
- "bytes": 105423,
- "sha256": "caddc91166f8d58fb661ee5d2fca9604ef0dddcd8731f080e6370d1776e36fcd"
+ "bytes": 107524,
+ "sha256": "18fb8ceb46e30b15eef9a6a9e3d23adf2497118ae87372fa8c1f73e3c41998a7"
},
{
"path": "docs/images/exmr-interaction-contact.png",
@@ -181,8 +181,8 @@
},
{
"path": "docs/models/README.md",
- "bytes": 6195,
- "sha256": "b898a9b0a9401337577bb0e34d8a83b7dd22f01667c86d9fdd4eb1d02be6d817"
+ "bytes": 6444,
+ "sha256": "37ef2661ad95de803143316fa350abd7ea155ef9460918b5c1c545e55d3fd102"
},
{
"path": "docs/samples/character-retargeting.jpg",
@@ -1301,8 +1301,8 @@
},
{
"path": "mocap/gui.py",
- "bytes": 102188,
- "sha256": "94f53dbedf05a733894bfe38047d3d6737baf14f3dc78d25221c8a850f239546"
+ "bytes": 102216,
+ "sha256": "725feca92477a634341ae6a8f406505b242004693464a8693c49911ab98c25ed"
},
{
"path": "mocap/gvhmr_attention.py",
@@ -1351,8 +1351,18 @@
},
{
"path": "mocap/mamma_camera.py",
- "bytes": 8576,
- "sha256": "f56120436807a44ca4f6bc6e52a33876754d11bf7c9e86745a64eab1f21a4a5a"
+ "bytes": 8741,
+ "sha256": "704e7b53c59a845dbe026bc5b5766520bb4e6c8d15531a2054edcbb73c9b72ec"
+ },
+ {
+ "path": "mocap/mamma_gravity.py",
+ "bytes": 7565,
+ "sha256": "99885b2166a7fd1d0c59c080dc2cf4fa9e28a5f60b6e30220d9830bdd3088b94"
+ },
+ {
+ "path": "mocap/mamma_gravity_worker.py",
+ "bytes": 5870,
+ "sha256": "41e94ffa5c96f7d07ae674e7438319b26df3cf526c7e8aa1637642a9c14c62e4"
},
{
"path": "mocap/mamma_inputs.py",
@@ -1366,13 +1376,13 @@
},
{
"path": "mocap/mamma_models.py",
- "bytes": 4188,
- "sha256": "9493cbbed80f0efdbdba90963b6f1188fdf308ed7645016edb38806b6caac288"
+ "bytes": 4203,
+ "sha256": "fa307ff0ba8b029a2ddc56a4d936ff27abeaca48d2bda7a3c5ca3a1c815f2db6"
},
{
"path": "mocap/mamma_pipeline.py",
- "bytes": 18885,
- "sha256": "e120762e7c7cc06cd203e052e1c3f0c43328af19d416f2c3ce66ae33389a95b2"
+ "bytes": 19453,
+ "sha256": "21dd73e239904ab95bf147b0544bdd460cccf6979b35975095106363dfc2b069"
},
{
"path": "mocap/mamma_publish.py",
@@ -1391,8 +1401,8 @@
},
{
"path": "mocap/mamma_ui.py",
- "bytes": 29451,
- "sha256": "ce76f0722729c9730e2318a2de41831744367a9dbaa24eb5949d70c13117f04d"
+ "bytes": 29971,
+ "sha256": "70493202fccd258015802631c679eae879b0c7d433c62326b81fd1c04fbe916c"
},
{
"path": "mocap/memory_mode.py",
@@ -1426,8 +1436,8 @@
},
{
"path": "mocap/model_guide.py",
- "bytes": 11197,
- "sha256": "68237776b415954cfc862689d3c82c6cae295fec73c010f05ef1f48f812c28bc"
+ "bytes": 11486,
+ "sha256": "a0e2adc9404ef05171bbafa88558aa3b851c75404ab6ef5e60163cd84581742f"
},
{
"path": "mocap/model_session.py",
@@ -1436,8 +1446,8 @@
},
{
"path": "mocap/models.py",
- "bytes": 32610,
- "sha256": "790613eab917ca5d6cc7652b78c89a895de1fa47ce367ea3367767fb3b0e91eb"
+ "bytes": 32625,
+ "sha256": "ca1de9ef959cfa2383827945ebf7335834afb8ad47b5aba730f20b913bf4eee8"
},
{
"path": "mocap/motion_tools.py",
@@ -1586,8 +1596,8 @@
},
{
"path": "mocap/pear_models.py",
- "bytes": 5732,
- "sha256": "3f4ec4ff81d1e5eab20009bb95482c114b0e4e95ff1d89e61de46652e5103555"
+ "bytes": 5889,
+ "sha256": "b60ba5d4c697a8ac038780628ddb62204a2414508956fae325de9104156c8826"
},
{
"path": "mocap/pear_multi_ui.py",
@@ -1986,8 +1996,8 @@
},
{
"path": "mocap/worker_progress.py",
- "bytes": 2198,
- "sha256": "36901d810180105953dbea6004ba15965a3fce001616dee51c9cce42bbffe789"
+ "bytes": 2327,
+ "sha256": "e939e422806d59ed7d68d8444f556740a0e2f75da0e36a564e9c2ba552785f6b"
},
{
"path": "mocap/workspace_ui.py",
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
index 1ad0f5a..20f0070 100644
--- a/THIRD_PARTY_NOTICES.md
+++ b/THIRD_PARTY_NOTICES.md
@@ -85,7 +85,7 @@ body data is neither committed nor redistributed by RGB MoCap. See the
[PEAR guide](docs/models/PEAR.md) and [PEAR paper citation](docs/CITATIONS.md#pear).
-PEAR's automatic Camera Align uses [GeoCalib](https://github.com/cvg/GeoCalib)
+PEAR's automatic Camera Align and MAMMA's automatic pre-fitting gravity use [GeoCalib](https://github.com/cvg/GeoCalib)
(Apache-2.0), with original license retained beside the downloaded source;
Kornia/Kornia-rs keep their wheel licenses. Setup pins sources/wheels in
`installer/pear-alignment.json` and installs a separate support overlay over the
diff --git a/docs/AGENT_GUIDE.md b/docs/AGENT_GUIDE.md
index 31412f9..405361a 100644
--- a/docs/AGENT_GUIDE.md
+++ b/docs/AGENT_GUIDE.md
@@ -10,7 +10,7 @@ This guide is for agents helping users operate or modify RGB MoCap. It describes
- Base worker commands use explicit `-X utf8`, including isolated `-I` launches. Isolated mode ignores `PYTHONIOENCODING`/`PYTHONUTF8` from the parent environment. Any redirected/discarded text log stream must also specify UTF-8. Keep byte-oriented PEAR IPC unchanged.
- Close the app before `update.cmd`. The updater requires a clean tracked worktree and the `main` branch, uses `git pull --ff-only`, then verifies/repairs runtime configuration. It refuses tracked local edits. A plain `git pull` does not perform runtime repair; use `install.cmd` after dependency changes when needed. Do not discard local edits or force an update.
- For setup failure, read the message, check connectivity and free space, then retry `install.cmd`. Preserve models, projects and `.setup` state. Do not repeatedly reinstall or redownload models without evidence.
-- Base installation currently estimates at least 32.4 GiB free before models; ExMR/FlowHMR/GVHMR and add-ons were previously measured around 29 GiB of weights. Optional MAMMA and PromptHMR add separate runtimes and model files; see [MAMMA](MAMMA.md) and [PromptHMR](models/PROMPTHMR.md). The five offline model/runtime sets total about **63.11 GiB (67.8 GB)** excluding caches, projects, downloads and compiler tools, counting shared files once. See the [installed-size table](USER_GUIDE.md#installed-size); installed size and temporary setup headroom are different. Measurements are not guarantees.
+- Base installation currently estimates at least 32.4 GiB free before models; ExMR/FlowHMR/GVHMR and add-ons were previously measured around 29 GiB of weights. Optional MAMMA and PromptHMR add separate runtimes and model files; see [MAMMA](MAMMA.md) and [PromptHMR](models/PROMPTHMR.md). The five offline model/runtime sets total about **63.22 GiB (67.9 GB)** excluding caches, projects, downloads and compiler tools, counting shared files once. See the [installed-size table](USER_GUIDE.md#installed-size); installed size and temporary setup headroom are different. Measurements are not guarantees.
Multi-person reconstruction groups supported ExMR, FlowHMR and GVHMR phases
into sequential, bounded worker requests. `mocap/queue_groups.py` builds the queue;
@@ -69,7 +69,7 @@ input. Do not replace the YAML or invalidate motion to add this metadata.
| ExMR | Default; generally fast, good quality in the project's subjective tests. SMPL-X. | Fingers included; static/moving camera and smoothing options. |
| FlowHMR | Slower; best overall quality in those tests, not a universal ranking. SMPL-H. | Fingers included; Fast SAM and camera/sampling choices. Moving camera needs VGGT-Omega. |
| GVHMR | Lower overall quality in those tests but sometimes better for unusual poses such as backflips. SMPL-X. | Fingers via optional HandFlow. HTD refines body motion; FootMR refines ankles. Both are separate from contact correction. |
-| MAMMA | Optional multi-view SMPL-X capture from two or more synchronized fixed cameras, without a fixed camera-count maximum. Practical capacity depends on RAM/VRAM. Not part of the single-video quality ranking. | Fingers included; separate setup and locked-head body assets. VGGT or compatible manual calibration. |
+| MAMMA | Optional multi-view SMPL-X capture from two or more synchronized fixed cameras, without a fixed camera-count maximum. Practical capacity depends on RAM/VRAM. Not part of the single-video quality ranking. | Fingers included; separate setup and locked-head body assets. VGGT-Omega + GeoCalib or compatible manual calibration. |
| PromptHMR | Multiple people reconstructed jointly from one video; can improve relative placement and interactions. Overall motion quality was lower than ExMR in our subjective tests. Fixed-camera Windows path, up to eight people; placement can still be wrong. | No finger tracking; fixed neutral fingers. Setup_PromptHMR.cmd; People defaults to 2, Interaction Prompt on. |
| PEAR | Live single-person bone preview from a webcam or the video timeline; transient, with lightweight live foot lock and no recording/export or offline correction. | Fingers included; Start/Stop, fixed lengths/Reset Bones, One Euro filter, Rotation and default-on World Position. Shared support is installed by install.cmd. |
@@ -155,7 +155,16 @@ trim and thumbnail preview switching. There is no fixed camera-count maximum;
retain existing RAM/Windows allocation-headroom monitoring, CUDA allocator
budgets and OOM failure handling. Do not replace the removed camera-count cap
with another arbitrary count limit. See [MAMMA scope](MAMMA.md).
-VGGT is the default; compatible manual calibration is optional. Original and
+VGGT-Omega plus GeoCalib is the automatic default; compatible manual calibration is optional.
+GeoCalib supplies background gravity before MAMMA 3D fitting, replacing the
+initial person's head-to-sole vertical axis. Run it in the pinned Flow/Python 3.10
+alignment overlay from `install.cmd`, never inside MAMMA's Python 3.11 process.
+Model Manager exposes its shared `pear_geocalib` checkpoint. Manual camera data
+bypasses both VGGT-Omega and GeoCalib; do not rotate supplied calibration.
+Unreliable gravity must fail clearly rather than silently reverting to a person's
+pose. The initial reference-height scale and sole height are still estimates.
+Keep support/model/code identities in inference receipts and preserve old results
+until the user explicitly reconstructs. Original and
corrected native actors feed the usual contact editing and FBX paths. See
[MAMMA.md](MAMMA.md) for the exact environment, registered assets, scale/world
assumptions and adapter limits. The optional setup downloads official restricted source and builds native
diff --git a/docs/BUILD.md b/docs/BUILD.md
index 8b492f9..ce3fcbe 100644
--- a/docs/BUILD.md
+++ b/docs/BUILD.md
@@ -210,6 +210,13 @@ weights are obtained in Model Manager. This support enables camera alignment;
if it is unavailable, PEAR can still track the selected camera with a warning,
provided its base support and model files are ready.
+MAMMA automatic cameras reuse this overlay through the `flow_mamma_gravity`
+child worker. Its numeric gravity result is passed back to MAMMA before 3D
+fitting; cp310 GeoCalib/Kornia packages must not enter MAMMA's Python 3.11
+environment. Missing or unreliable gravity is an actionable failure for MAMMA
+automatic cameras. Manual camera data bypasses this support and both camera
+checkpoints. A separate GeoCalib package installation into MAMMA is not needed.
+
Changed upstream files receive an adaptation notice. Each support generation
also records pinned source URLs/hashes and the adapter hash in
`RGB_MOCAP_PROVENANCE.json`, alongside the retained provider license files.
diff --git a/docs/CITATIONS.md b/docs/CITATIONS.md
index ac835a1..9dc041d 100644
--- a/docs/CITATIONS.md
+++ b/docs/CITATIONS.md
@@ -142,10 +142,10 @@ mesh workflow or reported throughput.
When using ExMR, also cite FootMR and the original GVHMR work.
Cite optional HTD-Refine and HandFlow when using those add-ons. The
application's use of Kimodo MotionCorrection does not imply use of the Kimodo
-text-to-motion generator.
+text-to-motion generator.
-## GeoCalib (PEAR Camera Align)
+## GeoCalib (PEAR Camera Align and MAMMA background gravity)
[Original project and citation](https://github.com/cvg/GeoCalib) ·
[Code license](https://github.com/cvg/GeoCalib/blob/1dedb29f94fc11b896c5f572005978aeebccd67f/LICENSE) ·
diff --git a/docs/MAMMA.md b/docs/MAMMA.md
index 389e38d..7397440 100644
--- a/docs/MAMMA.md
+++ b/docs/MAMMA.md
@@ -50,15 +50,18 @@ and other GPUs have not been verified.
| Item | Storage |
| --- | ---: |
| Active runtime excluding caches / earlier setup-report size | 6.11 GiB / 6.19 GiB |
-| Model files, when the shared VGGT-Omega model is already installed | 3.42 GiB additional |
-| Model files including VGGT-Omega | 7.69 GiB |
+| Model files, when the shared VGGT-Omega model is already installed | About 3.53 GiB additional |
+| Model files including VGGT-Omega | About 7.80 GiB |
| Free space needed during runtime setup, before models and compiler tools | About 18 GiB |
The setup downloads approximately 3.57 GiB of package/source archives, excluding
Python and models. Retained downloads, videos and generated projects use extra
space. These figures are separate from the base installation's storage estimate.
-The latest cache-free additional runtime/model total is about **9.54 GiB** when
-VGGT is already installed. See the [all-model inventory](USER_GUIDE.md#installed-size)
+The cache-free additional runtime/model total is about **9.65 GiB** when
+VGGT is already installed. GeoCalib adds about 0.108 GiB of weights if PEAR has
+not already installed that shared checkpoint. The existing base camera-alignment
+support is reused; MAMMA's Python 3.11 environment is not upgraded.
+See the [all-model inventory](USER_GUIDE.md#installed-size)
for shared-file accounting and setup versus installed-space differences.
## Install the runtime
@@ -97,7 +100,8 @@ public files. For registered files, choose **Manual Download...**, register or
sign in on the provider's site and accept its terms, then use **Import...** in
that window or in the model list. The app does not ask for provider passwords.
-The manager lists nine assets. The paths below are relative to the app's
+The manager lists ten assets. Automatic cameras require both VGGT-Omega and
+GeoCalib; manual cameras do not require either checkpoint. The paths below are relative to the app's
`models/` folder; importing places the file in its expected location.
| Asset | How to obtain it | Destination inside `models/` |
@@ -109,6 +113,7 @@ The manager lists nine assets. The paths below are relative to the app's
| YOLO12x | Automatic download | `mamma/yolo12x.pt` |
| OpenCLIP ViT-B/32 | Automatic download | `mamma/open_clip_model.safetensors` |
| VGGT-Omega 512 | Model Manager's manual download instructions; shared with FlowHMR | `flowhmr/vggt_omega_1b_512.pt` |
+| Scene Gravity / GeoCalib | Automatic download; shared with PEAR | `pear/geocalib-pinhole.tar` |
For the MAMMA checkpoint and surface landmarks, open the
[official MAMMA website](https://mamma.is.tue.mpg.de/) and click **Data**.
@@ -151,14 +156,13 @@ every clip fits memory; the full 60-second limit has not been validated.
fit per row. One common 30 fps timeline and trim applies to every video;
duration is limited by the shortest input. Drag the ends of the timeline's
**Video** track to trim all views together without modifying the originals.
-3. Keep **VGGT (Automatic)** or use **Import Camera Data...**. **People: 0**
+3. Keep **VGGT-Omega + GeoCalib (Automatic)** or use **Import Camera Data...**. **People: 0**
automatically detects the count; specify 1–8 if someone is missed or background people interfere.
MAMMA finds people during reconstruction, so **Find person** is hidden.
Enter only the number in **Reference Height (m)**, for example `1.70` for
- 170 cm. It sets approximate VGGT
- scale using initially standing people;
- it is an assumption, not a measured height or a reliable gravity estimate for
- an initially crouching scene.
+ 170 cm. It sets approximate metric scale from the initial head-to-sole distance.
+ This still assumes a suitable reference pose and height; crouching, occlusion
+ or uncertain landmarks can bias scale. It is not used to infer the vertical axis.
4. **Reconstruct 3D** prepares aspect-preserving inputs within 1920×1080, creates
SAM 2.1 masks, predicts FP32 landmarks, estimates/loads cameras, runs the full
MAMMA body fit, then prepares native people, correction and export bones.
@@ -233,10 +237,34 @@ reliable speed improvement. It can require more RAM. The mode does not reduce
views, fitting iterations or precision, and cannot guarantee that fitting fits.
See [common benchmark conditions and memory definitions](PERFORMANCE.md).
+## Automatic camera orientation
+
+VGGT-Omega estimates relative fixed-camera placement and intrinsics. GeoCalib
+estimates background gravity at the sampled times, with the VGGT focal length
+held fixed and detected people excluded from the geometric confidence maps.
+The camera rotations carry these directions into one common world. A
+camera-balanced spherical estimate rejects unreliable or conflicting samples.
+This does not guarantee that every background provides reliable gravity.
+
+The resulting vertical axis aligns the camera world **before MAMMA 3D fitting**.
+There is no additional GeoCalib rotation after fitting and no automatic fallback
+to a head-to-foot vertical axis. If background gravity cannot be estimated
+reliably, processing stops with an actionable message to import manual calibration
+or use clearer background views. GeoCalib does not measure absolute floor height:
+the initial sole datum and reference-height metric scale remain estimates.
+
+GeoCalib runs sequentially in the already installed Flow/Python 3.10 camera
+support overlay. Its packages are not imported into MAMMA's Python 3.11 process.
+If support is missing, close the app and run `install.cmd`; obtain its shared
+checkpoint through Model Manager. `Setup_MAMMA.cmd` still prepares the separate
+MAMMA/SAM 2/SDF runtime. Existing saved results are not changed just by opening
+them; an explicit new reconstruction uses the new camera-generation identity.
+
## Manual cameras
-Selecting Manual Camera Data disables the reference-height control: metric
-calibration supplies scale. With VGGT, Reference Height accepts 0.50–2.50 m
+Selecting Manual Camera Data bypasses VGGT-Omega and GeoCalib, and disables the
+reference-height control: supplied calibration defines orientation and scale.
+With automatic cameras, Reference Height accepts 0.50–2.50 m
(default 1.70 m); it is an approximate scene-scale assumption, not a measurement.
Reconstruct after changing camera, count or height settings; Apply Correction
does not re-estimate cameras or poses.
diff --git a/docs/MAMMA_AGENT_SETUP.md b/docs/MAMMA_AGENT_SETUP.md
index 731c319..96b403f 100644
--- a/docs/MAMMA_AGENT_SETUP.md
+++ b/docs/MAMMA_AGENT_SETUP.md
@@ -97,8 +97,12 @@ Do not promise a 5090-only test validates a 4090, 3090 or every 50-series GPU.
Measured optional runtime: **6.19 GiB**. Allow about **18 GiB free during setup**,
excluding separately installed compiler tools, models and projects. Downloaded
package/source archives are about **3.57 GiB**, excluding Python and weights.
-The nine models total **7.69 GiB**, or **3.42 GiB additional** if shared VGGT is
-already available. Confirm space on the app drive, not just a different drive.
+The ten models total about **7.80 GiB**, or **3.53 GiB additional** if shared VGGT is
+already available. GeoCalib is also shared with PEAR (about 0.108 GiB); count it
+once. Automatic camera gravity uses the base Flow/Python 3.10 alignment overlay
+installed by `install.cmd`, in a separate child process before 3D fitting. Do not
+inject its cp310 packages into MAMMA's Python 3.11 runtime. Manual camera data
+bypasses both automatic camera models. Confirm space on the app drive, not just a different drive.
## 4. Supported automatic installation
diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md
index 82a1bff..0043371 100644
--- a/docs/USER_GUIDE.md
+++ b/docs/USER_GUIDE.md
@@ -170,8 +170,8 @@ other PCs; connection speed and storage performance affect the time.
### Installed size
-The current registered model files and active runtimes measured approximately
-**67.8 GB (63.1 GiB)** with the five offline models and supported add-ons installed.
+The measured model/runtime inventory, plus GeoCalib for automatic MAMMA gravity, totals approximately
+**67.9 GB (63.2 GiB)** with the five offline models and supported add-ons installed.
Blender and FFmpeg are included. The inventory excludes projects, imported
characters, exports, caches (including Python bytecode), retained download
archives, obsolete runtime generations and separately installed compiler tools.
@@ -180,10 +180,10 @@ Shared model files and hardlinks are counted once.
| Configuration | Runtime | Models | Total |
| --- | ---: | ---: | ---: |
| ExMR + FlowHMR + GVHMR, including supported add-ons | 12.35 GiB | 28.89 GiB | 41.23 GiB |
-| MAMMA additional files | 6.11 GiB | 3.42 GiB | 9.54 GiB |
+| MAMMA additional files | 6.11 GiB | 3.53 GiB | 9.65 GiB |
| PromptHMR additional files | 6.22 GiB | 6.13 GiB | 12.34 GiB |
-| **Five offline models** | **24.68 GiB** | **38.44 GiB** | **63.11 GiB** |
-| PEAR live preview, additional | Small support overlay; shared runtime reused | ~2.95 GiB | ~2.96 GiB |
+| **Five offline models** | **24.68 GiB** | **38.55 GiB** | **63.22 GiB** |
+| PEAR live preview, additional | Small support overlay; shared runtime reused | ~2.84 GiB | ~2.85 GiB |
Adding PEAR to all five offline sets gives an estimated combined total of about
**66.07 GiB (70.9 GB)**. This includes about **0.11 GiB** of required GeoCalib weights; existing VGGT weights are reused. The approximately
@@ -193,7 +193,7 @@ geometry ZIP needs additional download space.
Totals use unrounded bytes; rounded cells may not sum exactly. These are local
observations, not universal requirements. App source files add space beyond this
model/runtime inventory. MAMMA's added model size assumes the base installation's
-VGGT-Omega is present; without it, its model set totals about 7.69 GiB. PromptHMR's
+VGGT-Omega is present; without it, its model set totals about 7.80 GiB. GeoCalib adds about 0.108 GiB for automatic gravity, counted once between MAMMA and PEAR. These totals include that addition to the earlier measured inventory. PromptHMR's
added model size includes SMPL Neutral, while its standard SMPL-X Neutral is
already counted in the base set. Its specific weights/support files alone total
about 6.09 GiB. Installed Python packages remain separate; verified identical
@@ -442,10 +442,11 @@ The app does not need your provider password or access token.
| ExMR / GVHMR HandFlow | [MANO](https://mano.is.tue.mpg.de/download.php): `MANO_RIGHT.pkl` from `mano_v1_2.zip`. |
| ExMR / FlowHMR | [SAM 3D Body](https://huggingface.co/facebook/sam-3d-body-dinov3): supported `model.ckpt`, `model_config.yaml` and `assets/mhr_model.pt`, each in its matching row. |
| FlowHMR moving camera / MAMMA automatic cameras | [VGGT-Omega](https://huggingface.co/facebook/VGGT-Omega): supported `vggt_omega_1b_512.pt`, shared under `models/flowhmr/`. Not needed for FlowHMR Static Camera or MAMMA Manual Camera Data. |
+| MAMMA automatic cameras / PEAR Camera Align | [GeoCalib](https://github.com/cvg/GeoCalib): background vertical direction, shared `models/pear/geocalib-pinhole.tar`. MAMMA manual calibration bypasses it. |
| MAMMA | [Registered MAMMA downloads](https://mamma.is.tue.mpg.de/): `mamma_mask_full_cvpr.ckpt` and `verts_512.pkl`. Follow the matching Model Manager rows. |
| MAMMA | [SMPL-X with removed head bun (NPZ, 392 MB)](https://smpl-x.is.tue.mpg.de/download.php): import the neutral, male and female locked-head bodies into `models/mamma/smplx/`. Standard SMPL-X v1.1 is not interchangeable. |
-MAMMA's [complete nine-asset checklist](MAMMA.md#prepare-model-files) also covers
+MAMMA's [complete ten-asset checklist](MAMMA.md#prepare-model-files) also covers
SAM 2.1, YOLO12x and OpenCLIP. Its runtime setup and model imports are separate
steps; a ready runtime does not mean the models are ready.
@@ -492,7 +493,7 @@ selected result is missing, reconstruct it; the app reports it as unavailable.
| **GVHMR → FootMR** | Refine ankle angles from foot observations. Separate from foot contact locking. |
| **GVHMR → HandFlow** | Add finger tracking while preserving the selected body and wrist motion. Requires additional weights and MANO. |
| **Analyze 2D** | Prepare GVHMR refinement observations separately. Reconstruct 3D includes this step when needed. |
-| **MAMMA → Camera Calibration** | VGGT (Automatic) estimates fixed cameras. Manual Camera Data uses an imported compatible JSON/MAMMA YAML file for the selected videos. |
+| **MAMMA → Camera Calibration** | VGGT-Omega + GeoCalib estimates fixed-camera placement and background vertical direction before 3D fitting. Manual Camera Data uses your compatible JSON/MAMMA YAML calibration without automatic gravity changes. |
| **MAMMA → Import Camera Data...** | Import calibration with camera names matching video filenames without extensions, original pixel intrinsics and metric translations. See the exact [camera format](MAMMA.md#manual-cameras). |
| **MAMMA → People** | Default 0 automatically detects people during reconstruction; set 1–8 if someone is missed or background people are included. Count each person once across all cameras. Find person is hidden. |
| **MAMMA → Reference Height (m)** | Numeric approximate standing height, default 1.70 m. Sets VGGT scene scale, not every actor's height; unused with metric manual calibration. |
diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md
index 0a4cd4e..a0344c1 100644
--- a/docs/VALIDATION.md
+++ b/docs/VALIDATION.md
@@ -1,5 +1,38 @@
# Source package validation
+## MAMMA background gravity before fitting (2026-11-02)
+
+Automatic calibration now uses VGGT-Omega camera placement with GeoCalib
+background gravity before MAMMA 3D fitting. GeoCalib executes in the existing
+Flow/Python 3.10 support overlay in a separate process; the optional MAMMA
+Python 3.11 environment is unchanged. Manual calibration bypasses both models.
+The camera-balanced gravity estimator rejects uncertain/conflicting samples;
+there is no silent person-direction fallback. Its acceptance thresholds have
+limited scene coverage, not universal calibration guarantees.
+
+On the documented test PC, the integrated camera path was exercised on an
+outdoor four-camera, 450-frame sequence. It loaded both camera models afresh,
+reused the existing masks/landmarks and completed in 47.59 seconds. Up-axis
+difference from the dataset calibration was 0.75 degrees, versus approximately
+11.09 degrees in the prior person-direction result. Full 450-frame MAMMA 3D
+fitting then completed in 120.09 seconds with finite output. Peak PyTorch
+allocated VRAM was 1.57 GiB and peak process RSS 2.19 GiB during fitting.
+These are camera/fitting measurements, not end-to-end reconstruction timings
+or total desktop GPU memory. Reference-height scale and initial sole height
+remain estimates; a known camera calibration is not ground-truth human motion.
+
+A second indoor four-camera, 422-frame camera-path check completed in 46.34
+seconds, with a 0.76-degree up-axis difference from its dataset calibration.
+Three cameras supported the accepted gravity consensus; the remaining camera's
+uncertain observations were rejected. This was a camera-path check, not a second
+complete fitting or end-to-end reconstruction benchmark.
+
+Targeted checks cover manual-camera extrinsic preservation and pixel resizing,
+Unicode camera IDs, vertical-looking reference cameras, conflicting gravity,
+invalid background/duplicate observations, model scoping and isolated worker
+routing. Existing runtime pins and other models' inference paths were retained.
+Tests and generated data remain outside the publishable source checkout.
+
The Git-based distribution was tested on the Windows PC listed in the
[user guide](USER_GUIDE.md#install). It has not been tested on a clean Windows
installation or on other GPUs or drivers.
diff --git a/docs/models/README.md b/docs/models/README.md
index e079260..d61497b 100644
--- a/docs/models/README.md
+++ b/docs/models/README.md
@@ -21,6 +21,9 @@ MAMMA detects and matches people across views during reconstruction; its
PromptHMR also tracks people during reconstruction. It defaults to two people
and Interaction Prompt on; see its guide for setup and fixed-camera limits.
For manual MAMMA cameras, see the [calibration format and JSON example](../MAMMA.md#manual-cameras).
+Automatic MAMMA cameras combine VGGT-Omega placement with GeoCalib background
+vertical direction before 3D fitting; both checkpoints appear in its Model Manager.
+GeoCalib reuses the base Flow support overlay rather than MAMMA's separate runtime.
PEAR support is prepared by `install.cmd` and `update.cmd` over the shared runtime;
its weights/body data are obtained separately. It is a live preview without motion
recording, offline contact correction, retargeting or export. Camera Align is
diff --git a/mocap/gui.py b/mocap/gui.py
index bb83afe..cbc6b4c 100644
--- a/mocap/gui.py
+++ b/mocap/gui.py
@@ -444,7 +444,7 @@ class MainWindow(PearWorkspace,PromptHMRWorkspace,MammaWorkspace,CharacterWorksp
from .models import STAGE_REQUIREMENTS, BY_KEY
required = {key for stage in stages for key in STAGE_REQUIREMENTS.get(stage, ())}
if tool.key=='flowhmr' and self.flow_sampling.currentData()==-1:required.discard('flow_vggt')
- if tool.key=='mamma' and self.mamma_camera_mode.currentData()=='manual':required.discard('flow_vggt')
+ if tool.key=='mamma' and self.mamma_camera_mode.currentData()=='manual':required.difference_update(('flow_vggt','pear_geocalib'))
unavailable = [BY_KEY[key] for key in sorted(required) if not ready(BY_KEY[key])]
count = len(required) - len(unavailable)
text = f"{tool.label}: {count}/{len(required)} models ready"
diff --git a/mocap/mamma_camera.py b/mocap/mamma_camera.py
index f959204..2550584 100644
--- a/mocap/mamma_camera.py
+++ b/mocap/mamma_camera.py
@@ -70,6 +70,8 @@ def infer(work,job,emit):
centres=-np.einsum('nij,nj->ni',es[:,:,:3].transpose(0,2,1),es[:,:,3])
RR.append(r);tt.append([email protected](centres,0));KK.append(np.median(K[ci==c],0))
RR,tt,KK=np.array(RR),np.array(tt),np.array(KK)
+ from .mamma_gravity import infer as background_gravity
+ up=background_gravity(work,entries,selected,RR,KK,emit)
uv=[];vis=[]
for entry in entries:
with np.load(work/'landmarks/motion'/(entry['id']+'.npz'),allow_pickle=False) as z:
@@ -95,10 +97,11 @@ def infer(work,job,emit):
lens=np.linalg.norm(vectors,axis=-1)
valid=(lens>max(1e-6,np.percentile(lens,10)*.5))&(lens<np.percentile(lens,90)*2)
if not valid.any():raise ValueError('Cannot estimate camera scale from visible standing subjects.')
- up=np.median((vectors/np.maximum(lens[...,None],1e-9))[valid],axis=0);up/=np.linalg.norm(up)
- forward=RR[0][email protected]([0.,0.,1.]);forward-=up*np.dot(forward,up);forward/=np.linalg.norm(forward)
- right=np.cross(forward,up);right/=np.linalg.norm(right);Q=np.stack([right,forward,up])
- heights=heads@up-feet@up;height=float(np.median(heights[valid]))
+ from .mamma_gravity import world_basis
+ Q=world_basis(up,RR[0])
+ # Reference size remains a human-height assumption, independent of gravity.
+ # Do not use body lean to rotate the camera world or shrink projected height.
+ height=float(np.median(lens[valid]))
ratio=(np.median(neutral[head,1])-np.median(neutral[sole,1]))/np.ptp(neutral[:,1])
scale=float(job['options'].get('height_m',1.7))*ratio/height
if not np.isfinite(scale) or scale<=0:raise ValueError('Invalid estimated metric camera scale.')
@@ -108,7 +111,8 @@ def infer(work,job,emit):
r=RR[c]@Q.T;t=scale*tt[c]+r@origin
cameras[entry['id']]=dict(intrinsic_matrix=KK[c].tolist(),extrinsics_matrix=np.column_stack((r,t)).tolist(),image_size=entry['size'],distortion_coeffs=[0.]*4)
atomic_json(work/'camera-estimation.json',dict(assumed_height_m=job['options'].get('height_m',1.7),scale=scale,
- initial_frames=train.tolist(),floor_is_measured=False,warning='VGGT metric scale/up/floor assume visible, initially standing people. They are not measured camera calibration or ground truth.'))
+ initial_frames=train.tolist(),gravity_source='GeoCalib background consensus',gravity_applied_before_3d_fit=True,
+ floor_is_measured=False,warning='VGGT-Omega camera geometry and GeoCalib background gravity are estimates. Metric scale assumes the reference person height; the initial sole datum is not measured ground.'))
return cameras
diff --git a/mocap/mamma_gravity.py b/mocap/mamma_gravity.py
new file mode 100644
index 0000000..ace60f2
--- /dev/null
+++ b/mocap/mamma_gravity.py
@@ -0,0 +1,128 @@
+"""Camera-balanced GeoCalib gravity and isolated Flow-runtime bridge for MAMMA."""
+import numpy as np
+
+def unit(x):
+ x=np.asarray(x,float);n=np.linalg.norm(x,axis=-1,keepdims=True)
+ if not np.isfinite(x).all() or np.any(n<1e-8):raise ValueError('Nonfinite or zero gravity vector')
+ return x/n
+
+def angular(a,b):
+ a,b=np.asarray(a),np.asarray(b)
+ return np.degrees(np.arctan2(np.linalg.norm(np.cross(a,b),axis=-1),np.sum(a*b,axis=-1)))
+
+def spherical(values,weights=None):
+ values=unit(values);weights=np.ones(len(values)) if weights is None else np.asarray(weights,float)
+ u=unit(np.sum(weights[:,None]*values,axis=0))
+ for _ in range(12):
+ residual=np.radians(angular(values,u));robust=np.minimum(1.,np.radians(2.)/np.maximum(residual,1e-8))
+ nxt=unit(np.sum((weights*robust)[:,None]*values,axis=0))
+ if angular(u,nxt)<1e-8:break
+ u=nxt
+ return u
+
+def estimate(observations,expected_cameras,check_holdouts=True):
+ if len(set(expected_cameras))!=len(expected_cameras):raise ValueError('Duplicate expected camera identity')
+ pairs=[(r['camera'],r['frame']) for r in observations]
+ if len(set(pairs))!=len(pairs):raise ValueError('Duplicate camera-time observation')
+ if any(r['camera'] not in expected_cameras for r in observations):raise ValueError('Unexpected camera identity')
+ rows=[];rejected=[]
+ for row in observations:
+ sigma=row.get('uncertainty_radians',{}).get('gravity_uncertainty',np.nan)
+ bg=row.get('background_fraction',0.)
+ if not np.isfinite(sigma) or sigma<0 or sigma>np.radians(10) or not np.isfinite(bg) or bg<.25:
+ rejected.append((row['camera'],row['frame']));continue
+ try:u=unit(row['up_saved_world'])
+ except ValueError:rejected.append((row['camera'],row['frame']));continue
+ rows.append((row,u))
+ cameras=sorted(set(row['camera'] for row,_ in rows));centres=[];names=[];kept=[]
+ for c in cameras:
+ group=[(row,u) for row,u in rows if row['camera']==c]
+ if len(group)<2:continue
+ v=np.array([u for row,u in group]);dist=angular(v[:,None],v[None,:]);medoid=v[np.argmin(np.sum(np.minimum(dist,6),axis=1))]
+ group=[x for x in group if angular(x[1],medoid)<=6]
+ if len(group)<2:continue
+ centres.append(spherical([u for row,u in group]));names.append(c);kept.extend(group)
+ need=max(2,int(np.ceil(len(expected_cameras)*.75)))
+ if len(centres)<need:raise ValueError('Too few independent cameras support gravity')
+ centres=np.array(centres);dist=angular(centres[:,None],centres[None,:]);counts=(dist<=6).sum(1)
+ best=int(counts.max());candidates=np.flatnonzero(counts==best)
+ if any(dist[i,j]>8 for i in candidates for j in candidates):raise ValueError('Competing gravity modes')
+ seed=candidates[np.argmin(np.sum(np.minimum(dist[candidates],6),axis=1))];good=dist[seed]<=6
+ if good.sum()<need:raise ValueError('Camera gravity estimates disagree')
+ names=[c for c,g in zip(names,good) if g];centres=centres[good];up=spherical(centres)
+ residual=angular(centres,up)
+ accepted=[(r,u) for r,u in kept if r['camera'] in names and angular(u,up)<=6]
+ if len(accepted)<int(np.ceil(len(observations)*.75)):raise ValueError('Insufficient accepted camera-time samples')
+ # Equal total camera influence; do not multiply identical static views' influence by sample count.
+ sample_residual=np.array([angular(u,up) for _,u in accepted]);rms=float(np.sqrt(np.mean(residual**2)))
+ if rms>2 or np.percentile(sample_residual,90)>3:raise ValueError('Gravity angular dispersion too large')
+ result=dict(up=up.tolist(),cameras=names,accepted_samples=len(accepted),total_samples=len(observations),camera_rms_deg=rms,sample_residual_p90_deg=float(np.percentile(sample_residual,90)),rejected_samples=rejected,estimator='equal-camera bounded angular Huber / spherical mean',thresholds_are_provisional=True)
+ if check_holdouts:
+ loo=[angular(spherical(np.delete(centres,k,axis=0)),up) for k in range(len(centres))] if len(centres)>2 else [float(residual.max())]
+ lot=[]
+ for t in sorted(set(row['frame'] for row,_ in accepted)):
+ vals=[]
+ for c in names:
+ v=[u for row,u in accepted if row['frame']!=t and row['camera']==c]
+ if v:vals.append(spherical(v))
+ if len(vals)>=need:lot.append(angular(spherical(vals),up))
+ if max(loo)>1.5 or (lot and max(lot)>1):raise ValueError('Gravity estimate changes under camera/time holdout')
+ result.update(camera_holdout_max_deg=float(max(loo)),time_holdout_max_deg=float(max(lot)) if lot else None)
+ return result
+
+def support_identity():
+ from .pear.alignment_support import configuration,identity
+ from .runtime_registry import PROFILES
+ from .storage import sha256
+ folder=configuration()
+ return dict(identity=identity(),provenance=sha256(folder/'PROVENANCE.json'),
+ profile=PROFILES['flow'],python=PROFILES['shared']['python'])
+
+
+def world_basis(up,reference_rotation):
+ up=unit(up);r=np.asarray(reference_rotation,float)
+ [email protected]([0.,0.,1.]);forward-=up*np.dot(forward,up)
+ if np.linalg.norm(forward)<1e-6:
+ # Looking straight down/up has no observable projected forward yaw.
+ [email protected]([1.,0.,0.]);right-=up*np.dot(right,up)
+ forward=np.cross(up,unit(right))
+ forward=unit(forward);right=unit(np.cross(forward,up))
+ return np.stack([right,forward,up])
+
+
+def infer(work,entries,frames,rotations,intrinsics,emit):
+ import json,subprocess,uuid
+ from .paths import ROOT
+ from .storage import atomic_json,sha256
+ support=support_identity();token=uuid.uuid4().hex
+ request=work/'gravity-request.json';output=work/'gravity-result.json'
+ atomic_json(request,dict(version=1,token=token,support=support,frames=list(frames),
+ cameras=[dict(id=e['id'],rotation=r.tolist(),intrinsics=k.tolist())
+ for e,r,k in zip(entries,rotations,intrinsics)]))
+ digest=sha256(request)
+ process=subprocess.Popen([str(ROOT/'runtime/python.exe'),'-I','-X','utf8','-B','-u',
+ str(ROOT/'worker_boot.py'),'flow_mamma_gravity',str(request)],stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,text=True,encoding='utf-8',errors='replace',creationflags=0x08000000)
+ tail=[]
+ try:
+ while True:
+ line=process.stdout.readline(65537)
+ if not line:break
+ if len(line)>65536:raise RuntimeError('Invalid GeoCalib worker output.')
+ tail.append(line.rstrip());tail=tail[-20:]
+ if line.startswith('@@MOCAP@@'):
+ event=json.loads(line[len('@@MOCAP@@'):]);kind=event.pop('type')
+ emit(kind,**event)
+ if process.wait():raise RuntimeError('MAMMA GeoCalib failed. '+ '\n'.join(tail)[-3500:])
+ if sha256(request)!=digest or output.stat().st_size>2*1024**2:
+ raise ValueError('MAMMA gravity inputs changed during processing.')
+ result=json.loads(output.read_text('utf8'))
+ if result['token']!=token or result['request_sha256']!=digest or result['support']!=support_identity():
+ raise ValueError('Stale or changed MAMMA gravity result.')
+ checked=estimate(result['observations'],[e['id'] for e in entries])
+ atomic_json(work/'gravity-estimation.json',{**result,'consensus':checked})
+ return unit(checked['up'])
+ finally:
+ if process.poll() is None:
+ process.kill();process.wait(timeout=10)
+ process.stdout.close()
diff --git a/mocap/mamma_gravity_worker.py b/mocap/mamma_gravity_worker.py
new file mode 100644
index 0000000..44c2805
--- /dev/null
+++ b/mocap/mamma_gravity_worker.py
@@ -0,0 +1,83 @@
+"""GeoCalib in the pinned Python 3.10 Flow overlay; never import it into MAMMA."""
+from pathlib import Path
+import json,sys,time
+import numpy as np
+from .storage import atomic_json,sha256
+
+
+def main():
+ from .mamma_pipeline import emit
+ path=Path(sys.argv[-1]).resolve()
+ if path.name!='gravity-request.json' or path.stat().st_size>2*1024**2:
+ raise ValueError('Invalid MAMMA gravity request.')
+ work=path.parent
+ if work.parent.name!='inference' or work.parent.parent.name!='mamma':
+ raise ValueError('Gravity work must belong to a MAMMA inference generation.')
+ job=json.loads(path.read_text('utf8'));digest=sha256(path)
+ from .mamma_gravity import support_identity,estimate
+ if job.get('version')!=1 or job['support']!=support_identity():
+ raise ValueError('Camera alignment support changed. Close RGB MoCap and run install.cmd.')
+ cameras=job['cameras'];frames=job['frames'];names=[c['id'] for c in cameras]
+ if len(cameras)<2 or len(set(names))!=len(names) or not 1<=len(frames)<=3 or len(set(frames))!=len(frames):
+ raise ValueError('Invalid camera/gravity samples.')
+ if any(not isinstance(f,int) or not 0<=f<1800 for f in frames):raise ValueError('Invalid gravity sample time.')
+ for c in cameras:
+ if not isinstance(c['id'],str) or Path(c['id']).name!=c['id'] or len(c['id'])>120 or any(x in c['id'] for x in '/\\:'):
+ raise ValueError('Invalid camera identity.')
+ r=np.asarray(c['rotation']);k=np.asarray(c['intrinsics'])
+ if r.shape!=(3,3) or k.shape!=(3,3) or not np.isfinite(r).all() or not np.isfinite(k).all() or np.max(np.abs([email protected](3)))>1e-3 or np.linalg.det(r)<.999 or min(k[0,0],k[1,1])<=0:
+ raise ValueError('Invalid VGGT camera matrices.')
+ from .pear.alignment_support import activate
+ activate()
+ import cv2,torch
+ from geocalib import GeoCalib
+ from .models import BY_KEY
+ from .result_artifacts import file_stat
+ from .compute_policy import gpu_memory_fraction
+ from .image_io import read_image
+ weight=BY_KEY['pear_geocalib'];stamp=file_stat(weight.path)
+ if sha256(weight.path)!=weight.expected_sha256:raise ValueError('Prepare Scene Gravity / GeoCalib in Model Manager.')
+ torch.set_num_threads(4);cv2.setNumThreads(1);free,total=torch.cuda.mem_get_info()
+ torch.cuda.set_per_process_memory_fraction(gpu_memory_fraction(free,total));torch.cuda.reset_peak_memory_stats()
+ emit('progress',current=0,total=0,message='MAMMA: loading GeoCalib background gravity')
+ start=time.perf_counter();model=GeoCalib(str(weight.path)).cuda().eval();active=None
+ def exclude_actor(module,args,out):
+ for key in ('up_confidence','latitude_confidence'):
+ mask=torch.nn.functional.interpolate(active,size=out[key].shape[-2:],mode='nearest')
+ out[key]=out[key]*(mask[:,0] if out[key].ndim==3 else mask)
+ return out
+ hook=model.model.perspective_decoder.register_forward_hook(exclude_actor);observations=[];done=0
+ try:
+ with torch.inference_mode():
+ for frame in frames:
+ for ci,c in enumerate(cameras):
+ video=work/'videos'/(c['id']+'.mp4')
+ if not video.resolve().is_relative_to(work):raise ValueError('Linked gravity video leaves its generation.')
+ cap=cv2.VideoCapture(str(video))
+ try:
+ width=cap.get(cv2.CAP_PROP_FRAME_WIDTH);height=cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
+ if not 0<width<=1920 or not 0<height<=1080:raise ValueError('Gravity sample exceeds working-video bounds.')
+ cap.set(cv2.CAP_PROP_POS_FRAMES,frame);ok,im=cap.read()
+ finally:cap.release()
+ if not ok:raise ValueError('Cannot read a GeoCalib camera frame.')
+ background=read_image(work/'camera-images'/f'{frame:06}-{ci}.png')
+ if background is None or background.shape!=im.shape:raise ValueError('Invalid GeoCalib background sample.')
+ mask=(background.max(-1)>0).astype('float32')
+ tensor=torch.from_numpy(im[...,::-1].copy()).permute(2,0,1).float().cuda()/255
+ active=model.image_processor(torch.from_numpy(mask).cuda()[None,None])['image']
+ result=model.calibrate(tensor,priors={'focal':tensor.new_tensor(float(c['intrinsics'][1][1]))})
+ up=result['gravity'].vec3d[0].cpu().numpy();world=np.asarray(c['rotation']).T@up
+ uncertainty={key:float(value.detach().reshape(-1)[0].cpu()) for key,value in result.items() if 'uncertainty' in key}
+ observations.append(dict(camera=c['id'],frame=frame,up_saved_world=world.tolist(),up_camera=up.tolist(),uncertainty_radians=uncertainty,background_fraction=float(mask.mean())))
+ done+=1;emit('progress',current=done,total=len(frames)*len(cameras),message=f'MAMMA: GeoCalib background gravity {done}/{len(frames)*len(cameras)}')
+ try:consensus=estimate(observations,names)
+ except ValueError as error:raise ValueError('Cannot determine reliable background gravity. Import manual camera calibration or use clearer background views. '+str(error)) from error
+ if sha256(path)!=digest or stamp!=file_stat(weight.path) or support_identity()!=job['support']:
+ raise ValueError('GeoCalib inputs or support changed during processing.')
+ atomic_json(work/'gravity-result.json',dict(version=1,token=job['token'],request_sha256=digest,support=job['support'],observations=observations,consensus=consensus,seconds=time.perf_counter()-start,peak_allocated_vram_gib=torch.cuda.max_memory_allocated()/2**30))
+ return 0
+ finally:
+ hook.remove();del model
+
+
+if __name__=='__main__':raise SystemExit(main())
diff --git a/mocap/mamma_models.py b/mocap/mamma_models.py
index 67f25a4..8fc82c2 100644
--- a/mocap/mamma_models.py
+++ b/mocap/mamma_models.py
@@ -29,7 +29,7 @@ ASSETS = (
url='https://smpl-x.is.tue.mpg.de/', minimum_bytes=137193916,
expected_sha256='a32f91b24e13023b979ec0b5c8e9086f5918197132329c8a258ad1f1c6c557f6'),
)
-KEYS = tuple(entry['key'] for entry in ASSETS)+('flow_vggt',)
+KEYS = tuple(entry['key'] for entry in ASSETS)+('flow_vggt','pear_geocalib')
INSTRUCTIONS = {
'mamma': '1. Open the official MAMMA website below and click Data.\n2. Register for an account if needed, review and accept the provider terms, then sign in.\n3. On the download page, download mamma_mask_full_cvpr.ckpt.\n4. Return to this window, click Import and select the single CKPT file.\nThe app does not request your password or account token.',
diff --git a/mocap/mamma_pipeline.py b/mocap/mamma_pipeline.py
index 4f072de..16e4c7b 100644
--- a/mocap/mamma_pipeline.py
+++ b/mocap/mamma_pipeline.py
@@ -81,7 +81,7 @@ def prepare(path, job):
n = round((job['end']-job['start'])*30)
if not 4 <= n <= 1800:
raise ValueError('Use 4–1,800 frames for the MAMMA integration; no frames were dropped.')
- if any(m.key!='flow_vggt' or job['options']['camera_mode']!='manual' for m in missing('mamma_assets')):
+ if any(m.key not in {'flow_vggt','pear_geocalib'} or job['options']['camera_mode']!='manual' for m in missing('mamma_assets')):
raise ValueError('Prepare the missing MAMMA models in Model Manager first.')
options = job['options']
if options['camera_mode'] == 'manual':
@@ -95,12 +95,17 @@ def prepare(path, job):
from .models import BY_KEY, STAGE_REQUIREMENTS
identity = dict(version=1, inputs=[dict(path=str(Path(v['path']).resolve()),stat=file_stat(v['path']),id=v['id']) for v in job['inputs']],
start=job['start'], end=job['end'], frames=n, options=options,
- engine=runtime['engine_files'], models={k:file_stat(BY_KEY[k].path) for k in STAGE_REQUIREMENTS['mamma_assets'] if options['camera_mode']!='manual' or k!='flow_vggt'})
+ engine=runtime['engine_files'], models={k:file_stat(BY_KEY[k].path) for k in STAGE_REQUIREMENTS['mamma_assets'] if options['camera_mode']!='manual' or k not in {'flow_vggt','pear_geocalib'}})
+ if options['camera_mode']!='manual':
+ from .mamma_gravity import support_identity
+ try:identity['gravity_support']=support_identity()
+ except (OSError,ValueError,KeyError,TypeError) as error:
+ raise RuntimeError('MAMMA background gravity support is unavailable. Close RGB MoCap and run install.cmd, then prepare Scene Gravity / GeoCalib in Model Manager.') from error
identity['runtime']=dict(packages=runtime['packages'],managed_id=runtime.get('managed_id'))
# All connector code contributes, not just the model prediction script.
from .paths import ROOT
from .storage import sha256
- identity['code']={name:sha256(ROOT/'mocap'/name) for name in ('mamma_pipeline.py','mamma_camera.py','mamma_inputs.py','image_io.py','memory_mode.py','gpu_offload.py')}
+ identity['code']={name:sha256(ROOT/'mocap'/name) for name in ('mamma_pipeline.py','mamma_camera.py','mamma_gravity.py','mamma_gravity_worker.py','mamma_inputs.py','image_io.py','memory_mode.py','gpu_offload.py','worker_progress.py','runtime_registry.py','pear/alignment_support.py')}
token=hashlib.sha256(json.dumps(identity,sort_keys=True).encode()).hexdigest()[:24]
slot=job['root']/'mamma'/'inference'/token
cached=False
diff --git a/mocap/mamma_ui.py b/mocap/mamma_ui.py
index dc23827..c00bdd6 100644
--- a/mocap/mamma_ui.py
+++ b/mocap/mamma_ui.py
@@ -102,15 +102,15 @@ class MammaWorkspace:
box.setSpacing(10);box.setAlignment(Qt.AlignTop)
box.addWidget(QLabel('Camera Calibration'))
self.mamma_camera_mode=QComboBox()
- self.mamma_camera_mode.addItem('VGGT (Automatic)','vggt')
+ self.mamma_camera_mode.addItem('VGGT-Omega + GeoCalib (Automatic)','vggt')
self.mamma_camera_mode.addItem('Manual Camera Data','manual')
- self.mamma_camera_mode.setToolTip('VGGT estimates fixed camera positions from the videos. Manual uses a calibration file for these exact camera videos.')
+ self.mamma_camera_mode.setToolTip('VGGT-Omega estimates fixed-camera placement. GeoCalib estimates background vertical direction before MAMMA 3D fitting. Manual uses your calibration without automatic gravity changes.')
self.mamma_camera_mode.currentIndexChanged.connect(self.mamma_settings_changed)
box.addWidget(self.mamma_camera_mode)
self.mamma_camera_import=QPushButton('Import Camera Data...')
self.mamma_camera_import.setToolTip('Load JSON or MAMMA YAML calibration for these videos. Camera names must match filenames without extensions; use original image sizes and metres. See docs/MAMMA.md for the format and docs/samples/mamma-camera-example.json for a synthetic example.')
self.mamma_camera_import.clicked.connect(self.choose_mamma_calibration);box.addWidget(self.mamma_camera_import)
- self.mamma_camera_note=QLabel('VGGT (Automatic)');self.mamma_camera_note.setWordWrap(True)
+ self.mamma_camera_note=QLabel('VGGT-Omega + GeoCalib (Automatic)');self.mamma_camera_note.setWordWrap(True)
self.mamma_camera_note.setMaximumHeight(72)
self.mamma_camera_note.setTextFormat(Qt.PlainText)
box.addWidget(self.mamma_camera_note)
@@ -367,7 +367,12 @@ class MammaWorkspace:
configuration()
options=self.mamma_options()
if options['camera_mode']=='manual':match_calibration(options['calibration'],self.mamma_inputs)
- absent=[m for m in missing('mamma_assets') if options['camera_mode']!='manual' or m.key!='flow_vggt']
+ else:
+ from .mamma_gravity import support_identity
+ try:support_identity()
+ except (OSError,ValueError,KeyError,TypeError) as error:
+ raise ValueError('Automatic MAMMA cameras need background gravity support. Close RGB MoCap and run install.cmd, then prepare Scene Gravity / GeoCalib in Model Manager.') from error
+ absent=[m for m in missing('mamma_assets') if options['camera_mode']!='manual' or m.key not in {'flow_vggt','pear_geocalib'}]
if absent:
self.status.setText('Prepare the missing MAMMA models first.');self.open_model_manager();return
first,end=self.processing_range()
diff --git a/mocap/model_guide.py b/mocap/model_guide.py
index 58e22d1..7f9c964 100644
--- a/mocap/model_guide.py
+++ b/mocap/model_guide.py
@@ -27,7 +27,7 @@ PROJECT_URLS = {
DESCRIPTIONS = {
'pear':'Experimental support. Tracking and pose estimates may be unstable. Real-time tracking of webcam or video input, with a single-person body and finger bone preview from one or multiple fixed-camera views. Select synchronized videos with Open Video, or assign distinct webcam devices using the camera-count slots and thumbnails. Start Live Tracking attempts Camera Align first, including one camera; VGGT and GeoCalib are needed for alignment. A single view uses estimated body/depth scale; multiple views use triangulation. If alignment fails or its support/models are missing, tracking continues from the selected camera with a visible warning, without camera fusion or aligned foot lock. Use Camera Align to retry. Fixed bone lengths are calibrated once; Reset Bones recalibrates from the displayed pose, then aligns cameras again. World Position is on by default; off fixes pelvis translation while preserving rotation. Body mesh is not computed per live frame. Select a webcam in the table below the video for image preview without loading PEAR; click Start Live Tracking to attempt alignment and begin tracking. Capture stays connected during Start and Camera Align; opened videos can play while models load or align. Choose None for video. Stop releases models and the webcam. Uses YOLOv8s person detection; detector boxes can affect the resulting pose. Rotation and One Euro Filter apply to both sources. One Euro Filter has independent Bone Rotation and World Position checkboxes, both on by default, with shared Filter Strength. The position-filter checkbox is separate from the World Position movement switch. Filtering reduces tremors with some motion-dependent lag and no extra inference. Seeks start from the selected frame; filtering continues during playback. After successful alignment, default-on lightweight Foot Lock stabilizes low, slow feet with smooth causal transitions, fixed lengths and preserved ankle/toe directions. Reach limits and incorrect ground estimates can leave residual sliding. No Find person, recording, offline Motion Correction, retargeting or motion export in this live mode. Single-view pelvis placement assumes a fixed camera. Camera Align estimates background gravity, camera positions, scale and floor; these are not measured calibration and feet can still slide. Changed inputs and Reset Bones trigger realignment. After moving physical cameras, click Camera Align again. Webcam arrival-time pairing is approximate, not hardware sync. Support files are included in install.cmd and update.cmd, reusing the shared runtime without upgrading its packages or requiring a CUDA compiler. Prepare the checkpoint and registered SMPL-X 2020/FLAME geometry bundle in Model Manager. See docs/models/PEAR.md.',
'prompthmr': 'Reconstructs multiple people together from one video. In our subjective tests, it could give more accurate relative placement and interactions, but overall motion quality was lower than ExMR. Contacts, depth and intersections can still be wrong. Fixed cameras only in this Windows integration. People defaults to 2; 0 detects automatically, up to 8. Find person is not needed. Interaction Prompt defaults on; off follows the official default video path. Body motion uses SMPL-X. No finger tracking; untracked fingers use a fixed neutral pose. Supports the usual optional foot/hand contact correction, retargeting and FBX export. Requires Setup_PromptHMR.cmd and separate weights. Non-commercial scientific research license. See docs/models/PROMPTHMR.md.',
- 'mamma': 'Multi-view reconstruction of one or several people from two or more synchronized fixed-camera videos of the same performance. No fixed camera-count maximum; practical capacity depends on available RAM and VRAM. Detects people automatically; Find person is not needed. Uses SAM 2.1 masks, FP32 landmarks and VGGT cameras, or your compatible camera calibration. Body and finger motion, original results and contact-corrected results are preserved. Best suited to views that complement each other; occlusion and bad masks can cause errors. Slower than single-video methods. Requires the separate Setup_MAMMA.cmd runtime and registered restricted-use models. See Model Manager > Runtime Setup and docs/MAMMA.md.',
+ 'mamma': 'Multi-view reconstruction of one or several people from two or more synchronized fixed-camera videos of the same performance. No fixed camera-count maximum; practical capacity depends on available RAM and VRAM. Detects people automatically; Find person is not needed. Uses SAM 2.1 masks and FP32 landmarks. Automatic cameras combine VGGT-Omega placement with GeoCalib background gravity before 3D fitting; manual calibration bypasses both. GeoCalib uses the base Flow support overlay and a shared checkpoint in Model Manager. Unreliable gravity needs manual calibration or clearer views; it does not fall back to the person as a vertical reference. Body and finger motion, original results and contact-corrected results are preserved. Best suited to views that complement each other; occlusion and bad masks can cause errors. Slower than single-video methods. Requires the separate Setup_MAMMA.cmd runtime and registered restricted-use models. See Model Manager > Runtime Setup and docs/MAMMA.md.',
'gvhmr': 'Lowest overall motion quality in our tests, but sometimes better for unusual poses such as backflips. '
'No native finger tracking. Optional HandFlow adds finger motion; FootMR refines ankles, and HTD refines body motion. These add processing time.',
'flowhmr': 'Slow, but the best overall motion quality in our tests. Tracks body and fingers together without a separate finger add-on. With Fast SAM and Adaptive Batching on, Automatic selects 1-16 frames from available memory and image size; Low Memory uses one. Tests of 4 to 16 frames reduced warm feature time by 16-23%, with allocated VRAM 3.84 to 5.43 GiB and small numerical motion differences. Short whole jobs benefit much less because model loading dominates. Batch selection, GPU Hand Crops and OOM batch retries appear in Console and CMD. See docs/models/FLOWHMR.md.',
diff --git a/mocap/models.py b/mocap/models.py
index bc4115b..6f68d4f 100644
--- a/mocap/models.py
+++ b/mocap/models.py
@@ -249,7 +249,7 @@ STAGE_REQUIREMENTS = {
'mamma_prepare': MAMMA_KEYS,
'mamma_masks': ('mamma_sam2','mamma_yolo','mamma_clip'),
'mamma_landmarks': ('mamma','mamma_vertices'),
- 'mamma_camera': ('flow_vggt',),
+ 'mamma_camera': ('flow_vggt','pear_geocalib'),
'mamma_fit': ('mamma_vertices','mamma_body','mamma_body_male','mamma_body_female'),
'mamma_publish': ('mamma_body','mamma_vertices'),
}
diff --git a/mocap/pear_models.py b/mocap/pear_models.py
index 817bda4..3d81c4e 100644
--- a/mocap/pear_models.py
+++ b/mocap/pear_models.py
@@ -13,9 +13,9 @@ ASSETS=[dict(key='pear',name='Live Pose / PEAR',relative='pear/pear_model.pt',ur
download_url='https://github.com/ultralytics/assets/releases/download/v8.3.0/yolov8s.pt',
expected_sha256='1f47a78bf100391c2a140b7ac73a1caae18c32779be7d310658112f7ac9aa78a'),
dict(key='pear_geometry',name='PEAR / SMPL-X 2020 + FLAME Geometry',relative='pear/geometry.json',url='https://github.com/Pixel-Talk/PEAR#-preparation',minimum_bytes=1)]
-ASSETS.append(dict(key='pear_geocalib',name='PEAR Camera Align / GeoCalib',relative='pear/geocalib-pinhole.tar',url='https://github.com/cvg/GeoCalib',minimum_bytes=116074121,download_url='https://github.com/cvg/GeoCalib/releases/download/v1.0/geocalib-pinhole.tar',expected_sha256='86d6aeacd8bbd974c59ce39f61854e00d36911c732ad89be471476fd708722ac'))
+ASSETS.append(dict(key='pear_geocalib',name='Scene Gravity / GeoCalib',relative='pear/geocalib-pinhole.tar',url='https://github.com/cvg/GeoCalib',minimum_bytes=116074121,download_url='https://github.com/cvg/GeoCalib/releases/download/v1.0/geocalib-pinhole.tar',expected_sha256='86d6aeacd8bbd974c59ce39f61854e00d36911c732ad89be471476fd708722ac'))
KEYS=('pear','pear_geometry','pear_yolo','flow_vggt','pear_geocalib')
-INSTRUCTIONS={'pear_geocalib':'Used by automatic Camera Align, including one camera. Alignment is optional for tracking: if its support or models are missing, PEAR continues in the selected camera view with a warning, without fusion or aligned foot lock. Download geocalib-pinhole.tar from the official v1.0 release, then import the original TAR file here without extracting it. Code: Apache-2.0; checkpoint: CC BY 4.0. See the official GeoCalib LICENSE-WEIGHTS. Existing VGGT weights are reused.',
+INSTRUCTIONS={'pear_geocalib':'Shared by PEAR Camera Align and automatic MAMMA background gravity. MAMMA applies it before 3D fitting and requires it only without manual calibration. PEAR uses it for automatic Camera Align, including one camera. Alignment is optional for tracking: if its support or models are missing, PEAR continues in the selected camera view with a warning, without fusion or aligned foot lock. Download geocalib-pinhole.tar from the official v1.0 release, then import the original TAR file here without extracting it. Code: Apache-2.0; checkpoint: CC BY 4.0. See the official GeoCalib LICENSE-WEIGHTS. Existing VGGT weights are reused.',
'pear':'Download pear_model.pt from the linked official checkpoint, then import it here.',
'pear_geometry':'1. Review and accept the SMPL-X and FLAME provider terms; register or sign in where required. PEAR needs SMPL-X 2020 and FLAME 2020, not the standard SMPL-X v1.1 or MAMMA locked-head models.\n2. Open PEAR Preparation below. Use its official Google Drive assets bundle link to obtain assets.zip.\n3. Import the original assets.zip here. The app validates its SHA-256 and extracts only the required geometry files. The source ZIP is left unchanged and is not copied into the models folder.\n4. The geometry bundle has separate provider restrictions; it is not redistributed by RGB MoCap.'}
diff --git a/mocap/worker_progress.py b/mocap/worker_progress.py
index a167d1c..3f968c5 100644
--- a/mocap/worker_progress.py
+++ b/mocap/worker_progress.py
@@ -12,6 +12,9 @@ def emit(kind,**value):
def main():
stage=sys.argv[1] if len(sys.argv)>1 else ''
+ if stage=='flow_mamma_gravity':
+ from .mamma_gravity_worker import main as gravity_main
+ return gravity_main()
if stage=='pear_camera_preview':
from .pear.camera_preview import main as camera_main
return camera_main()