Skip to content

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

Python

Add optional MAMMA multi-view capture and setup

toyxyze530eba9d5f6
diff --git a/AGENTS.md b/AGENTS.md
index bfa919e..4835996 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -2,6 +2,13 @@
Read [docs/AGENT_GUIDE.md](docs/AGENT_GUIDE.md) before operating or changing this project. It covers installation, model selection, GUI workflows, retargeting, projects, resources, data protection and the main code paths. Consult the linked user and developer guides for detail.
+For model-specific files, defaults and workflow, use [docs/models/README.md](docs/models/README.md).
+
+For MAMMA runtime installation, native SAM 2/SDF builds or repair, follow
+[docs/MAMMA_AGENT_SETUP.md](docs/MAMMA_AGENT_SETUP.md). It distinguishes automatic
+setup from custom builds and requires actual CUDA verification before registering
+a manually built environment.
+
- This is the Windows Git/CMD distribution. Preserve the separate pinned runtimes and model-specific behavior.
- 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 04ba250..af59d7d 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,9 @@ https://github.com/user-attachments/assets/1759f1bf-a0d0-409f-84d8-dde9409cfe6f
cd toyxyz_RGBMocap
```
-2. Download and install the required runtimes, Blender and FFmpeg:
+2. Prepare the runtimes for ExMR, FlowHMR and GVHMR with their supported add-ons,
+ Blender, FFmpeg and native motion correction. AI weights and registered body
+ files are downloaded separately in Model Manager:
```cmd
install.cmd
@@ -48,6 +50,49 @@ To update, close the app and run `update.cmd` from the same folder. See the
[installation guide](docs/USER_GUIDE.md#install) for disk space, prerequisites
and recovery.
+### Additional setup for MAMMA
+
+For multi-view capture from synchronized camera videos, complete the base
+installation above, then install **Visual Studio 2022 C++ Build Tools** with the
+Windows SDK and **CUDA Toolkit 12.8**. Close the app and run:
+
+```cmd
+Setup_MAMMA.cmd
+```
+
+Review the upstream restricted-use terms before accepting the setup prompt.
+Reopen the app, select **MAMMA**, and use **Model Manager** to download or import
+its model files. MAMMA and locked-head SMPL-X assets require provider registration
+and manual download. See the [MAMMA installation and usage guide](docs/MAMMA.md)
+for prerequisites, exact files and storage requirements. This optional setup is
+not needed for ExMR, FlowHMR or GVHMR.
+
+### Install with an AI agent
+
+After cloning, open this repository folder in a local coding agent such as Codex.
+The [agent guide](docs/AGENT_GUIDE.md) covers setup, models, capture, retargeting,
+projects and resources. For example, ask:
+
+```text
+Help me install and run RGB MoCap on this Windows PC.
+Read AGENTS.md and docs/AGENT_GUIDE.md first. Check the GPU and free disk space,
+run install.cmd, and launch RGBMoCap.cmd. Help me prepare the ExMR model files.
+Preserve existing models, projects and settings, and keep the pinned runtimes.
+Tell me when I need to sign in, accept provider terms or download a file manually.
+```
+
+For multi-camera capture, add:
+
+```text
+Also enable MAMMA. Follow docs/MAMMA_AGENT_SETUP.md to check the C++/CUDA tools,
+run Setup_MAMMA.cmd after the required license review, and verify the native CUDA
+modules. Help me prepare its models without changing the other model runtimes.
+```
+
+MAMMA's [agent setup guide](docs/MAMMA_AGENT_SETUP.md) includes build checks and
+recovery. Provider login and license acceptance remain your responsibility;
+do not put passwords or account tokens in the agent chat.
+
## Features
- Reconstruct one or several people and preview the body mesh and animation bones.
@@ -59,24 +104,39 @@ and recovery.
## How it works
-1. Open a video, select an AI model and prepare its files in **Model Manager**.
-2. Choose the people to capture and click **Reconstruct 3D**.
+1. Select an AI model and prepare its files in **Model Manager**, then use
+ **File > Open Video**. For MAMMA, select it before opening synchronized camera
+ videos; thumbnails switch the preview and one timeline trim applies to all views.
+2. For a single-video model, optionally use **Find person** to select people.
+ MAMMA detects people during reconstruction; keep **VGGT (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**.
4. Export FBX, or import a character, retarget the motion and export it.
## Supported AI models
-| Model / original project | Body representation | Fingers |
-| --- | --- | --- |
-| [ExMR](https://github.com/twehrbein/ExMR) | SMPL-X | Included |
-| [FlowHMR](https://github.com/flowhmr/flowhmr) | SMPL-H | Included |
-| [GVHMR](https://github.com/zju3dv/GVHMR) | SMPL-X | Optional HandFlow add-on |
+| Model / original project | Body representation | Fingers | Setup and use |
+| --- | --- | --- | --- |
+| [ExMR](https://github.com/twehrbein/ExMR) | SMPL-X | Included | [ExMR guide](docs/models/EXMR.md) |
+| [FlowHMR](https://github.com/flowhmr/flowhmr) | SMPL-H | Included | [FlowHMR guide](docs/models/FLOWHMR.md) |
+| [GVHMR](https://github.com/zju3dv/GVHMR) | SMPL-X | Optional HandFlow add-on | [GVHMR guide](docs/models/GVHMR.md) |
+| [MAMMA](https://mamma.is.tue.mpg.de/) · multi-view motion capture | SMPL-X | Included | [MAMMA guide](docs/MAMMA.md) |
+
+MAMMA uses multiple views of the same performance. Four cameras are not its
+maximum: the [official datasets](https://github.com/cuevhv/mamma/blob/main/docs/DATASETS.md)
+include 16- and 32-camera captures. **RGB MoCap accepts two or more synchronized
+fixed-camera videos without a fixed camera-count maximum.** Practical capacity
+depends on available RAM and VRAM; existing memory protection and OOM handling
+remain active. RGB MoCap does not synchronize inputs automatically. See
+[multi-view requirements and app limits](docs/MAMMA.md#prepare-your-videos).
Requires 64-bit Windows, a compatible NVIDIA GPU/driver and OpenGL 4.3.
Model files are acquired separately; some require registration and license acceptance.
-**Disk space:** allow about **45 GB (42 GiB)** for the app, all AI runtimes,
-Blender and all supported model files, including optional add-ons. Videos,
+**Disk space:** allow about **45 GB (42 GiB)** for the app, runtimes,
+Blender and model files for the three single-video models, including their optional
+add-ons. The optional MAMMA runtime and model files are additional. Videos,
projects, imported characters, exports, generated caches and retained download
archives need additional space. See the [storage details](docs/USER_GUIDE.md#install).
@@ -85,6 +145,9 @@ archives need additional space. See the [storage details](docs/USER_GUIDE.md#ins
## Documentation
- [User guide: installation, controls and settings](docs/USER_GUIDE.md)
+- [Model guides: files, defaults, options and limitations](docs/models/README.md)
+- [Model guides: files, defaults, options and limitations](docs/models/README.md)
+- [MAMMA: additional installation, model files and multi-video workflow](docs/MAMMA.md)
- [Development and builds](docs/BUILD.md)
- [Agent operating and development guide](docs/AGENT_GUIDE.md)
- [Source validation](docs/VALIDATION.md)
diff --git a/SOURCE_MANIFEST.json b/SOURCE_MANIFEST.json
index 217b70c..dfb942d 100644
--- a/SOURCE_MANIFEST.json
+++ b/SOURCE_MANIFEST.json
@@ -1,6 +1,6 @@
{
"schema": 1,
- "date": "2026-10-28",
+ "date": "2026-10-30",
"purpose": "Public source distribution; excludes model weights and runtime binaries",
"version": "git-source",
"files": [
@@ -16,8 +16,8 @@
},
{
"path": "AGENTS.md",
- "bytes": 1052,
- "sha256": "50d15b04e6ede35be222bc5210de6631dc5037162b848e1c7fca437018fac3f4"
+ "bytes": 1424,
+ "sha256": "43fdcce181be5c5011be84f93e51178ee0ac45b77ca3a3eada0eb9a07ce0a104"
},
{
"path": "LICENSE",
@@ -26,18 +26,23 @@
},
{
"path": "README.md",
- "bytes": 3467,
- "sha256": "698773d90917a037e3f078ab480680e37537d8ad91c05c63b0567892de9ac157"
+ "bytes": 6978,
+ "sha256": "70f83950d33ca6b73a91908ff80a4c4cf68d6c7bf366a890ffb34ed6e46473c3"
},
{
"path": "RGBMoCap.cmd",
"bytes": 382,
"sha256": "8c925029ce80ff6c73854ce05b9c22f566fb9f631cb8481f1e6577a969ab70a1"
},
+ {
+ "path": "Setup_MAMMA.cmd",
+ "bytes": 963,
+ "sha256": "2b6004b05ef9160cca0e0b04c64d00dd23c76f4ca3ad4e6c9560a2289ed01376"
+ },
{
"path": "THIRD_PARTY_NOTICES.md",
- "bytes": 6597,
- "sha256": "db2aed410f9d75b2c8d3e9d02dfbeaa9a657640bc90045534c43400262bff99e"
+ "bytes": 7166,
+ "sha256": "4bfbcb6f24fb1aa20bfdafb87b89c4375b40da7fb793907546a93d3b60d11f7a"
},
{
"path": "app.py",
@@ -86,29 +91,59 @@
},
{
"path": "docs/AGENT_GUIDE.md",
- "bytes": 12249,
- "sha256": "4875d1f281c21d2a57e7f1c092ebce8511b64d772b9259290659ca93a2b217d1"
+ "bytes": 15780,
+ "sha256": "8181dd263a7f81860a47971cb8498ccbab9afec9aa0992d75415854738056d0d"
},
{
"path": "docs/BUILD.md",
- "bytes": 8021,
- "sha256": "43d8d7f477a2f9eeb76f8a3c9f5bbfb54ce22e95b903bad568566bd6bd980944"
+ "bytes": 9910,
+ "sha256": "d6bc05d68a8c3df9017a1ed848d1fc4a788aad09a2900b15d02664b36d2e427a"
+ },
+ {
+ "path": "docs/MAMMA.md",
+ "bytes": 18819,
+ "sha256": "9c60a075b66cf7294603101004c71d471bfed439e135e7bedd93a60a56f1a8d9"
+ },
+ {
+ "path": "docs/MAMMA_AGENT_SETUP.md",
+ "bytes": 22119,
+ "sha256": "8f832c9403cf067b773f71b18321b8b31400ec629d9b3c25fd37917a5c945368"
},
{
"path": "docs/USER_GUIDE.md",
- "bytes": 28468,
- "sha256": "82d87a3532d5fe88927e878f73086843673d98f879026a3c764186ac152d6341"
+ "bytes": 35154,
+ "sha256": "7eb658306567125bd4db873fa202b140fd17aef0121b212bc24853956b23a80e"
},
{
"path": "docs/VALIDATION.md",
- "bytes": 12060,
- "sha256": "a14e63734693e32d8af7eb7d5e9263c2976b133d18de787a184c3a1941983f26"
+ "bytes": 27775,
+ "sha256": "9c5c454544097864efed20d6733a9e510720a8eae2e342589795b9f1c2a67151"
},
{
"path": "docs/images/rgbmocap-workspace.png",
"bytes": 775295,
"sha256": "b6ff1d220905d56ba625e3e5243621a3d9d34a1dd3add2373402d87fd0301aea"
},
+ {
+ "path": "docs/models/EXMR.md",
+ "bytes": 3943,
+ "sha256": "5ae467efb2c55aa31aab2d0325070593d47f6bdb4cb7f59a44174adaaa3fdc66"
+ },
+ {
+ "path": "docs/models/FLOWHMR.md",
+ "bytes": 4116,
+ "sha256": "ef73ee4fd10f889c36c59c1ba7e0785f9021338e773b86a158df6ec8a53c8049"
+ },
+ {
+ "path": "docs/models/GVHMR.md",
+ "bytes": 4344,
+ "sha256": "d313f99f84dd6dd110ee5d72f58ad8f58e6b344bf3bd15b322a3f4623567854c"
+ },
+ {
+ "path": "docs/models/README.md",
+ "bytes": 3450,
+ "sha256": "8b05a5469f3e3609992a0d686aae7e0fcfecd76dd3e12b8572f284a667f1f44d"
+ },
{
"path": "docs/samples/character-retargeting.jpg",
"bytes": 39179,
@@ -119,6 +154,11 @@
"bytes": 12408995,
"sha256": "8fce14c6f9042d1bd9799be2b44de3867916257c232ce8e39196b42b406f5c85"
},
+ {
+ "path": "docs/samples/mamma-camera-example.json",
+ "bytes": 838,
+ "sha256": "79a3234e707dcc8648cb5c9e6d40720a1d1ea8551fca36220a31fb602ca4610e"
+ },
{
"path": "docs/samples/motion-capture.jpg",
"bytes": 39716,
@@ -184,10 +224,30 @@
"bytes": 1077,
"sha256": "860e3d7a86b84e6a7012c7a635fc64df475cebc6cce34dfeb73a5982ec58176c"
},
+ {
+ "path": "installer/mamma-runtime-lock.json",
+ "bytes": 75004,
+ "sha256": "0926bd2cea0b9b5fdfd6f42c82ae8146466f089eac56990e8854df3fabe7d98c"
+ },
+ {
+ "path": "installer/mamma_adapters.py",
+ "bytes": 5924,
+ "sha256": "b3fc4c012a5e69b99bc87d3f26cfc7344a5cf1ff9ae2873b956bf73bb5a44829"
+ },
+ {
+ "path": "installer/mamma_helpers/speed_crop.py",
+ "bytes": 1690,
+ "sha256": "e8e273297ff9f28be1f3bbacd827b61d546f9a5538706037458e4bb6ea7e319f"
+ },
+ {
+ "path": "installer/mamma_helpers/speed_landmarks.py",
+ "bytes": 3725,
+ "sha256": "bbea620bc10c7d922720096a2f19892f8dbaadae17a03a4a25b61691a6a5141b"
+ },
{
"path": "installer/runtime-lock.json",
- "bytes": 117711,
- "sha256": "dcc10453e1868f6b127277bce4b7802a910244040b58ce72d8101c8ca1fe477f"
+ "bytes": 117713,
+ "sha256": "40bc4b4bba02255ff1f9fe574580ef336b2c8550612b3534e437ed0dd10f5fbe"
},
{
"path": "installer/runtime_sources/antlr4_python3_runtime-4.9.3-py3-none-any/SOURCE_WHEEL.json",
@@ -889,6 +949,11 @@
"bytes": 3925,
"sha256": "35143421169b9e6e4c4e7955376038313577be417d45477bb965af8bacc33cfb"
},
+ {
+ "path": "installer/verify_mamma.py",
+ "bytes": 3557,
+ "sha256": "eb6ccb88905e686d91ef46449f23644ab539ec890ae5b77bd4f9ce60aa55f454"
+ },
{
"path": "installer/verify_runtime.py",
"bytes": 2416,
@@ -899,6 +964,11 @@
"bytes": 1517,
"sha256": "aeca1cbf79a3cf6c071bba5b2e74a611043d3e80aafcdb2db896ad9c779c3f05"
},
+ {
+ "path": "mamma_worker_boot.py",
+ "bytes": 1787,
+ "sha256": "dae7d34f846273f2bdf1851943ff3ff34a7de06f278e854cc93646b24749fd40"
+ },
{
"path": "mocap/__init__.py",
"bytes": 89,
@@ -1006,8 +1076,8 @@
},
{
"path": "mocap/correction.py",
- "bytes": 45946,
- "sha256": "a445fee2991c18962a9354bc88d481dbc4769d9c6b12fc05fb437740f92f5e21"
+ "bytes": 45959,
+ "sha256": "a9399bb6e66506981d76113f433f012223b172aec245554c692334d7233f9150"
},
{
"path": "mocap/correction_settings.py",
@@ -1036,8 +1106,8 @@
},
{
"path": "mocap/export.py",
- "bytes": 7368,
- "sha256": "526fe252f631a3106b2fa643609b8d57557423e13a756a0a2a491ce72ed38a01"
+ "bytes": 7753,
+ "sha256": "ac46267438327f7bdfd5c231a910621f877470eb58f0d223578fa3e9a0c2cb36"
},
{
"path": "mocap/export_copy.py",
@@ -1121,8 +1191,8 @@
},
{
"path": "mocap/gui.py",
- "bytes": 94171,
- "sha256": "900c3f0c913e20d56cab477663a03767cd6a88d0b83be979b8164a1696365e99"
+ "bytes": 97146,
+ "sha256": "61d97281a4f1b167fe987daaa6661566168e38972f4fec280cd33653f21260da"
},
{
"path": "mocap/gvhmr_attention.py",
@@ -1159,20 +1229,70 @@
"bytes": 6610,
"sha256": "beb72010f72d08c34b775faae7a899d5a952a848026a7f4a9c662044aa2e462e"
},
+ {
+ "path": "mocap/mamma_body.py",
+ "bytes": 8294,
+ "sha256": "b37b4e32ff98c94180de956ba17c79a23081b790f232b4a3479214e6ffb96f0d"
+ },
+ {
+ "path": "mocap/mamma_camera.py",
+ "bytes": 8501,
+ "sha256": "d9ecc05c5b05175a531a0f2926d3269cb887b3bf6b0a98e27549130e86d40b9d"
+ },
+ {
+ "path": "mocap/mamma_inputs.py",
+ "bytes": 7765,
+ "sha256": "7fd567f275174b7d6c0084534540f01ecde12a8195bd8218094b50743b90373c"
+ },
+ {
+ "path": "mocap/mamma_manager.py",
+ "bytes": 4527,
+ "sha256": "4cd4307f21dee8c1788bb037064331be2c692b02427d907e738e665b897878fa"
+ },
+ {
+ "path": "mocap/mamma_models.py",
+ "bytes": 4188,
+ "sha256": "9493cbbed80f0efdbdba90963b6f1188fdf308ed7645016edb38806b6caac288"
+ },
+ {
+ "path": "mocap/mamma_pipeline.py",
+ "bytes": 18335,
+ "sha256": "f8e1649d642536bfa43842aee970b44be569cab388e65828544ecbd86b861407"
+ },
+ {
+ "path": "mocap/mamma_publish.py",
+ "bytes": 9933,
+ "sha256": "ad0c71fc58c2aef5c722100f42e7ca88966ea17e55e13ef734ecf44b4b28c74b"
+ },
+ {
+ "path": "mocap/mamma_runtime.py",
+ "bytes": 5788,
+ "sha256": "e849655d639e8b7c2b42922d10130ee5636bd88d75eb8e843a98b9387a8b2a03"
+ },
+ {
+ "path": "mocap/mamma_scene.py",
+ "bytes": 995,
+ "sha256": "55560bf77ec7128760c09ef6913f19e3ee377b6b8c5a6b47cda1cab2e594ea53"
+ },
+ {
+ "path": "mocap/mamma_ui.py",
+ "bytes": 29297,
+ "sha256": "7f9cce88e6c9842ba6a47001dda2f19d446f0ac4b61d77d8cbdd898a0e6a9510"
+ },
{
"path": "mocap/mesh_data.py",
- "bytes": 7378,
- "sha256": "b8f65bc895a3d1d349f8c38cd118b2d6ef2d9fde380d265605d95940cbcf4914"
+ "bytes": 7416,
+ "sha256": "feec558f7957911972a548ac104d45bee277ef91fe998486dc19d9c4f65df8d3"
},
{
"path": "mocap/mesh_gl.py",
- "bytes": 9118,
- "sha256": "da209654f4870e9cccd976d5b61ca312c87c6f538f4991d75cb48d6547a5ef4b"
+ "bytes": 9018,
+ "sha256": "a05d3a2f46535ff7480e591d83444eecc344a2e2dd22b5372f04cb4a446ceb9c"
},
{
"path": "mocap/mixamo_data.py",
- "bytes": 28987,
- "sha256": "f6b587d201585b58e12e65205b5deec959a2237bd4e24abf01d1f1c3e4b6d54a"
+ "bytes": 29174,
+ "sha256": "a6d8e9a4dfd89d9b4f9103b23be2ad558e55e1831094954a6e2a03cb0f62940a"
},
{
"path": "mocap/mixamo_native.py",
@@ -1186,18 +1306,18 @@
},
{
"path": "mocap/model_guide.py",
- "bytes": 4476,
- "sha256": "8171ee6c2a44fd9e88bdb5dffa192a714aecfa16f8a923f85d69d75c619c11ec"
+ "bytes": 5689,
+ "sha256": "00702e0789973047bd654381ffdf250092904ae633c8d2306f8656a73cf1adf2"
},
{
"path": "mocap/models.py",
- "bytes": 28768,
- "sha256": "f9c8ac8e362036b1a228df67cdd6e4f27fcb2aafaaf06e42180fc01b5576b8ef"
+ "bytes": 29517,
+ "sha256": "a9ff10be7ceffaf0065f620778c07034f0dc30a75804cb333af5ba752feabbda"
},
{
"path": "mocap/motion_tools.py",
- "bytes": 10042,
- "sha256": "88c9e99c134d96100f166d1183f2779d378393f87bd0143d8848048cee7fdc44"
+ "bytes": 10530,
+ "sha256": "3f246a8be51e20e04541cc36d1100121e21db2837ee296269ca648a9c264f7b1"
},
{
"path": "mocap/multilevel_contacts.py",
@@ -1216,8 +1336,8 @@
},
{
"path": "mocap/paths.py",
- "bytes": 582,
- "sha256": "2c60deb3b29a5014c0389a1306e2b8a86e2883dec9a5b474efbae1b9c815b26e"
+ "bytes": 772,
+ "sha256": "355c4644c150607c5db630540e2cd756fcf8b70d3f2a9f5e9a7ff664d91cdcc0"
},
{
"path": "mocap/people_store.py",
@@ -1226,8 +1346,8 @@
},
{
"path": "mocap/people_ui.py",
- "bytes": 37640,
- "sha256": "c5c7ecbd15a7383cced6b17d72a7d6cee4b629b25deb5b8a836997cd256ab9a7"
+ "bytes": 37776,
+ "sha256": "1d5d66d7357f1cc3878fd13d7abc6816d8b27d01adfc5c50241be1539ae4517e"
},
{
"path": "mocap/person_names.py",
@@ -1271,13 +1391,13 @@
},
{
"path": "mocap/project_save.py",
- "bytes": 11073,
- "sha256": "325f57a08517673191e11c999252cdfd362d7a425a386f2e7c835d128a8d51a9"
+ "bytes": 12515,
+ "sha256": "feb75de8110cf29e530a61b89c21cecce534c39943fbaea979d877d7f51bbeb1"
},
{
"path": "mocap/project_save_ui.py",
- "bytes": 4858,
- "sha256": "d847db33208fe63839332808407acaf8decd5a3f3ca489a46fe3843ac27944da"
+ "bytes": 5012,
+ "sha256": "697f6918422e6f72611670b4689d1046b623b7fc74d8eb38a211bcc9941296e5"
},
{
"path": "mocap/project_storage.py",
@@ -1291,8 +1411,8 @@
},
{
"path": "mocap/project_workspace_ui.py",
- "bytes": 8736,
- "sha256": "a49d009da0adcfb911936526db1769270b76692ee6cf6f0dc737782841f1263f"
+ "bytes": 9524,
+ "sha256": "f10ff648688a9c4fcb834eae1e5694afaa1e54d574495ed338c3cbc485a70b5d"
},
{
"path": "mocap/resource_cache.py",
@@ -1301,8 +1421,8 @@
},
{
"path": "mocap/result_artifacts.py",
- "bytes": 5030,
- "sha256": "75b78355369cbf9af6d4821bcb13710b591e4a02d4a43dedb27a9ae1cbb45b70"
+ "bytes": 5448,
+ "sha256": "2c631989d85176e6f13623943e6318cdfddb9561427cdd8c1446b6a2690658c5"
},
{
"path": "mocap/retarget/__init__.py",
@@ -1391,8 +1511,8 @@
},
{
"path": "mocap/retarget/source.py",
- "bytes": 7025,
- "sha256": "0f29f93ed3bae5eab4535bdc5b8f15e0b4685065d7a949032d7de53bc8146bdd"
+ "bytes": 7136,
+ "sha256": "93f416e1464408724ed9a1bc0eba59fe97424ef9107164f95106f2f71f5bfb4f"
},
{
"path": "mocap/retarget/stabilize.py",
@@ -1431,18 +1551,18 @@
},
{
"path": "mocap/runtime_registry.py",
- "bytes": 4727,
- "sha256": "d9caa1b0e8105cbe02a21134f18c89817926bb0a779134e90816782d1febf622"
+ "bytes": 4735,
+ "sha256": "a210a4bee2802b0d7ce539fa53995062245b1d35bbbbf14f112e099e5412d36e"
},
{
"path": "mocap/scene_camera.py",
- "bytes": 9094,
- "sha256": "e75c0da7d16cd76a33b9203c9cd2ab7d9276eff76b8dd4802463858a4d68f7fd"
+ "bytes": 9558,
+ "sha256": "33de9309dbb5ff6fa4609c7474cc11e313e89eaef8dfde04a0152049a7536d4d"
},
{
"path": "mocap/scene_data.py",
- "bytes": 18201,
- "sha256": "02879c138a60b7f64699f81d6d6d8f42a26ffaec87c298c9567a76e8e5d5149b"
+ "bytes": 19021,
+ "sha256": "9144d3f5456f220c7bbb5950fe09e3028eb7cd017fd121254f9d284964224567"
},
{
"path": "mocap/scene_export.py",
@@ -1451,8 +1571,8 @@
},
{
"path": "mocap/scene_floor.py",
- "bytes": 9581,
- "sha256": "ea60cdae5885d6be0846041a639e71f0b9a3e015a2aa70214010d864812fbc64"
+ "bytes": 10219,
+ "sha256": "87642b11a7a50515c634968b60f35ceebf2ba929c538a287086120869338f2a4"
},
{
"path": "mocap/single_actor.py",
@@ -1516,18 +1636,28 @@
},
{
"path": "mocap/timeline_editor.py",
- "bytes": 14341,
- "sha256": "b4fba3d4c0f6223cad73523645f3b855278655037b6cd6e680d5f3f2f9d14c77"
+ "bytes": 14421,
+ "sha256": "b58f80a159b55d5352ec1a56c708b66fe45350acc3aafa319e1fbdbd1346f4c7"
},
{
"path": "mocap/tooltips.py",
"bytes": 799,
"sha256": "64ca19fa8c381fb6e1eb2c619cafd387e04b97f3567856da43ca526ecf54be52"
},
+ {
+ "path": "mocap/ui_refresh.py",
+ "bytes": 805,
+ "sha256": "31264b89c10f76cc409d6d6e4fe1abe91c8a47bfa62dc9b42ea997c985282752"
+ },
+ {
+ "path": "mocap/validation_snapshot.py",
+ "bytes": 1065,
+ "sha256": "5dcee454f346aa810fb5f948a1e4379a9f2a9a7dbf4bfbf409098bbce50082ef"
+ },
{
"path": "mocap/video.py",
- "bytes": 12003,
- "sha256": "535d683e04e6c126f39211707588eb330755c2fb04f691a1a3177e829aafb181"
+ "bytes": 12153,
+ "sha256": "6f739db8dec38a6848d644077bb827596912eacf7928e35b20e8da7ab89bd963"
},
{
"path": "mocap/video_preview.py",
@@ -1536,28 +1666,28 @@
},
{
"path": "mocap/viewer.py",
- "bytes": 8540,
- "sha256": "85990434d9e3678b82a2b8a1d0bb5bbe5915e84033e995aec7217fe3e388ace7"
+ "bytes": 9793,
+ "sha256": "13b3eb7e9bb32ab46a1bec6d18fd87ee7d1ab54cafd57209a1aa118d068f1381"
},
{
"path": "mocap/viewport.py",
- "bytes": 50039,
- "sha256": "3e6a554cc1ebb5b25ef610875c42d6715ce81c7c5ec318b538daff608b09f7ee"
+ "bytes": 50029,
+ "sha256": "1ae0103991357d6db1cfe09a5c0ee4003d3b63b38cf2a7037ed2c10ad5430f11"
},
{
"path": "mocap/worker.py",
- "bytes": 26292,
- "sha256": "0b479a3a33a4f4df3804ee57e233f314dd5554044c1af6a274317878241fc972"
+ "bytes": 27136,
+ "sha256": "50bb259235b7b1d48e95da577941675b2c05576b8888a7f2750d1252b24b52a7"
},
{
"path": "mocap/worker_progress.py",
- "bytes": 1112,
- "sha256": "97d5227a639c556311c2f86dff22c3d9cc2f22a81c214414db1027ce599f9b89"
+ "bytes": 1369,
+ "sha256": "5d29bc7bf8e461277d0f1f16b7887a69e7693e8288ab60f6fb66bcce4314046a"
},
{
"path": "mocap/workspace_ui.py",
- "bytes": 33729,
- "sha256": "7b492f007639a1ad13d16ef92bae1a4655fb22d7520eb48612b2cb025cc69b2b"
+ "bytes": 33759,
+ "sha256": "4fddab25454524539bbaac0f97cc3d60e2bdedf006e7cdd5a3f15d2706daa328"
},
{
"path": "native_compat/LICENSE",
@@ -12231,8 +12361,13 @@
},
{
"path": "tools/check_source.py",
- "bytes": 3587,
- "sha256": "a668a3f17e2900e33513ad3e7face34083bd75884aee19797e9d3d1b2cfecd1a"
+ "bytes": 3921,
+ "sha256": "d90060394d629e3caee30a440de2136c0c34e5152eea811e0da1a4cca069bdb5"
+ },
+ {
+ "path": "tools/configure_mamma.py",
+ "bytes": 610,
+ "sha256": "9a39394eec937f81434d74d719de41004c3d5cc5737fe35938060dc65be3be85"
},
{
"path": "tools/download_models.py",
@@ -12279,6 +12414,11 @@
"bytes": 2695,
"sha256": "0a990562cf09f5d36e6cdd0d58a8fdd27cd6395e13802abc5b41a70bf15cd77b"
},
+ {
+ "path": "tools/setup_mamma.py",
+ "bytes": 14090,
+ "sha256": "783731563bc03da8302d0a6bf2c2d433232b3d76f06a61063e56511d42fe076f"
+ },
{
"path": "tools/stage_assets.py",
"bytes": 2482,
diff --git a/Setup_MAMMA.cmd b/Setup_MAMMA.cmd
new file mode 100644
index 0000000..5ec2ced
--- /dev/null
+++ b/Setup_MAMMA.cmd
@@ -0,0 +1,21 @@
+@echo off
+setlocal DisableDelayedExpansion
+cd /d "%~dp0"
+echo MAMMA optional runtime setup. Close RGB MoCap before continuing.
+echo This installs a separate Python 3.11 environment. Models are obtained separately.
+echo Allow about 18 GiB free for installation, excluding models and compiler tools.
+echo Native compilation needs Visual Studio 2022 C++ Build Tools and CUDA Toolkit 12.8.
+echo Review https://github.com/cuevhv/mamma/blob/main/LICENSE and
+echo https://github.com/cuevhv/pytorch_sdf/blob/main/LICENSE before proceeding.
+echo Restricted components are downloaded from upstream for your permitted local use.
+choice /c YN /n /m "I reviewed these licenses and agree to the permitted use. Continue? [Y/N] "
+if errorlevel 2 exit /b 1
+if not exist "runtime\python.exe" (
+ echo Run install.cmd first.
+ pause
+ exit /b 1
+)
+"runtime\python.exe" -I -X utf8 -B tools\setup_mamma.py --accept-licenses
+set "mamma_result=%errorlevel%"
+pause
+exit /b %mamma_result%
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
index 8c37f20..6f93646 100644
--- a/THIRD_PARTY_NOTICES.md
+++ b/THIRD_PARTY_NOTICES.md
@@ -26,6 +26,7 @@ they are not bundled with the application.
| [SAM 3D Body](https://github.com/facebookresearch/sam-3d-body) / MHR assets | SAM source uses the [SAM License](third_party/FlowHMR/third_party/sam-3d-body/LICENSE). Feature weights and MHR geometry retain provider terms; obtain access and import supported assets locally. |
| [DINOv3](https://github.com/facebookresearch/dinov3) | Separate [DINOv3 License](third_party/FlowHMR/third_party/dinov3/LICENSE.md) for its code/models. |
| [Fast SAM 3D Body](https://github.com/yangtiming/Fast-SAM-3D-Body) | Fork contributions: [MIT](third_party/FlowHMR/third_party/fast-sam-3d-body/LICENSE); upstream-derived code: [SAM License](third_party/FlowHMR/third_party/fast-sam-3d-body/SAM_LICENSE). Uses the same separately licensed model assets. |
+| [MAMMA](https://mamma.is.tue.mpg.de/) (optional multi-view runtime) | Registered noncommercial/restricted-use software and weights, with separate locked-head SMPL-X body-data terms. Obtain the code and assets directly under the provider agreement; neither is bundled in this repository. The original app connector does not relicense them. Restricted MAMMA and pytorch_sdf source/native modules are fetched and built on the user's PC, not bundled. SAM 2 uses Apache-2.0; its weights and OpenCLIP weights retain their provider terms. See [MAMMA setup](docs/MAMMA.md). |
| [VGGT-Omega](https://huggingface.co/facebook/VGGT-Omega) | [FAIR Noncommercial Research License](third_party/FlowHMR/third_party/vggt-omega/LICENSE). Official checkpoint requires provider access and local import. |
| [SMPL / SMPL-X](https://smpl-x.is.tue.mpg.de/modellicense.html), [SMPL-H / MANO](https://mano.is.tue.mpg.de/license.html) | Registered body/hand models and model-derived data retain their provider restrictions. The installed smplx software has separate noncommercial Model & Software terms. Obtain the required files under your own agreement; registration does not authorize public redistribution. |
| [Kimodo MotionCorrection](https://github.com/nv-tlabs/kimodo) | [Apache-2.0](third_party/KimodoMotionCorrection/LICENSE). The correction backend is used; Kimodo motion generation is not included. |
@@ -66,4 +67,4 @@ dataset. AGPL obligations, noncommercial restrictions and model redistribution
permissions are not waived by separate worker processes or separate labeling.
Keep original notices and any required corresponding source/build materials when
distributing. The private development folder may contain registered models,
-derived caches and user projects; it is not a cleared public release package.
+derived caches and user projects; it is not a cleared public release package.
diff --git a/docs/AGENT_GUIDE.md b/docs/AGENT_GUIDE.md
index c72c636..cc5be98 100644
--- a/docs/AGENT_GUIDE.md
+++ b/docs/AGENT_GUIDE.md
@@ -5,11 +5,11 @@ This guide is for agents helping users operate or modify RGB MoCap. It describes
## Start and update
- Windows 64-bit, compatible NVIDIA GPU/driver and OpenGL 4.3 are required for the documented inference workflow. Other systems and GPUs were not comprehensively verified; see [validation](VALIDATION.md).
-- In a writable checkout, run `install.cmd` once. It sets up separate pinned Python/model profiles, Blender 4.5, FFmpeg and the prebuilt native motion-correction module. Downloading and disk space are required. Models are obtained separately.
+- In a writable checkout, run `install.cmd` once. It sets up separate pinned profiles for all three single-video models and their supported add-ons, Blender 4.5, FFmpeg and the prebuilt native motion-correction module. It does not install only the selected model's runtime or obtain AI weights/body data. Downloading and disk space are required. Models are obtained separately; optional MAMMA uses Setup_MAMMA.cmd.
- Run `RGBMoCap.cmd`. Keep its command window open; launch errors, processing messages and app Console output are also sent there, but long messages can be truncated and a saturated output queue can drop messages. Within the GUI, **Help > Check System** checks the system.
- 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.
-- Installation currently estimates at least 32.4 GiB free before models; all supported weights were previously measured around 29 GiB. Project data and download caches add space. Measurements are not guarantees. See [user guide](USER_GUIDE.md#install).
+- Base installation currently estimates at least 32.4 GiB free before models; the three single-video models and add-ons were previously measured around 29 GiB of weights. Optional MAMMA adds a separate runtime and model files; see [its setup guide](MAMMA.md). Project data and download caches add space. Measurements are not guarantees. See [user guide](USER_GUIDE.md#install).
## Models and model files
@@ -18,8 +18,9 @@ This guide is for agents helping users operate or modify RGB MoCap. It describes
| 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. |
-The [model guide](USER_GUIDE.md#choose-a-model) includes observed timings, conditions and VRAM; these are historical measurements, not minimum specifications. FlowHMR has a 5,000-frame per-take limit and available memory may require less. Do not change numerical precision, temporal context or model settings merely to improve a benchmark.
+Start with the [model guide index](models/README.md), then [ExMR](models/EXMR.md), [FlowHMR](models/FLOWHMR.md), [GVHMR](models/GVHMR.md) or [MAMMA](MAMMA.md) for exact setup and controls. The [user guide](USER_GUIDE.md#recorded-processing-time-and-vram) includes observed timings, conditions and VRAM; these are historical measurements, not minimum specifications. FlowHMR has a 5,000-frame per-take limit and available memory may require less. MAMMA retains its 4–1,800-frame common trim and eight-person limits; there is no fixed camera-count maximum. Four-column thumbnails are a layout, not admission control. Do not change numerical precision, temporal context or model settings merely to improve a benchmark.
Use **Model Manager** for the selected model and add-ons. Automatic download may fail, especially on Google Drive. Gated models require the user to register, accept upstream terms and obtain files; use **Manual Download...** and **Import...**. Do not handle provider passwords or redistribute licensed weights. Imports validate files; several model receipts tie validity to file size, timestamp and expected hash. If a copied file is not marked ready, import it again rather than assuming it is missing or editing receipts.
@@ -27,8 +28,29 @@ Model files are in `<installation>/models/` by default. To reuse a legitimate in
## Standard GUI workflow
+MAMMA runs an optional complete multi-view pipeline using a separate pinned
+Python 3.11 Windows runtime installed with Setup_MAMMA.cmd. The current app
+adapter accepts two or more synchronized fixed-camera views, with one common
+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
+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
+modules locally; Visual Studio 2022 C++ Build Tools and CUDA Toolkit 12.8 are
+prerequisites. Model Manager shows its runtime readiness and setup instructions.
+Do not claim clean-Windows or other-GPU validation or SAM 3.1 app support. Keep restricted upstream code, weights and derived bodies private.
+
+For prerequisite checks, automatic setup, independent SAM 2/SDF builds, kernel
+verification, registration and rollback, use the
+[MAMMA agent setup runbook](MAMMA_AGENT_SETUP.md). Registration alone does not
+validate actual native CUDA operations. Do not overwrite a working runtime to
+test a new native module, or use cached inference as evidence of a new build.
+
1. **File > Open Video**, optionally trim the Video track; select an AI Motion Model and prepare its models. New work defaults to ExMR.
-2. For multiple people, use **Find person** and check the desired rows; without it, automatic tracking selects one person and can switch identity on overlap. A checked row controls processing/visibility; the selected row controls the current timeline and contact edits.
+2. For single-video models with multiple people, use **Find person** and check the desired rows; without it, automatic tracking selects one person and can switch identity on overlap. MAMMA instead detects and matches people during reconstruction; Find person is hidden and its People setting controls the count. A checked row controls visibility and single-video processing targets; the selected row controls the current timeline and contact edits.
3. Choose camera and processing settings, then **Reconstruct 3D**. Processing runs on a 30 fps working clip, without changing the original video. Progress and cancellation are in the app. **Prepare Preview** rebuilds previews from existing motion without rerunning inference.
4. Review motion and contacts. **Enable Correction** selects corrected output; Foot defaults on and Hand off for new work. Flat Ground uses a common floor; Multi Level retains inferred contact heights and does not reconstruct terrain. Inspect automatic contacts; hand contacts represent support, not hanging/object tracking.
5. Edit L/R foot and hand intervals on the timeline, then **Apply Correction**. Pending changes are not applied until then; stale corrected export is blocked. Applying also refreshes linked retargeted characters. Correction and preview do not require fresh AI inference.
@@ -43,17 +65,18 @@ See [the full workflow and controls](USER_GUIDE.md#start-here). Do not confuse v
- The source's applied contact timings are used. **Apply Correction** refreshes linked characters; after other source changes retarget again. Targets that cannot be reached do not cause bone stretching. Different limb lengths can change travel distance, and editing may be required in a 3D tool.
- **Export Character...** offers FBX with or without character mesh, and VMD for PMX characters. VMD is sampled at 30 fps for the same PMX model; facial motion and hair/clothing physics are not generated. Character FBX preserves its imported rest hierarchy and keys body bones, not the armature object. The character viewport uses original-resolution base-color textures with simplified lighting. Texture caches are prepared off the GUI thread, independently of motion; existing characters prepare them on first display.
- A separate Blender runtime is used for character import, rig evaluation and baking/export; the user need not open Blender for the app workflow. Preserve upstream licenses and the bundled Blender environment. See [character retargeting](USER_GUIDE.md#character-retargeting) and [FBX/Blender](USER_GUIDE.md#fbx-and-blender).
+- MAMMA retargeting must use `mocap.mamma_body.body_path(project)`, including its actor-specific folded shape data. Never substitute the standard SMPL-X body used by ExMR/GVHMR, or require that extra model for a MAMMA-only workflow.
## Projects, state and protection
-- Default projects live under `<installation>/projects/`; **Save Project As** creates and switches to a copy at a user-selected location. Open the saved `project.json` using **File > Open Project**. A project contains model-specific `exmr`, `flowhmr`, `gvhmr` result folders; model switching loads existing results when available. People, takes, contact edits and imported characters are project data.
+- Default projects live under `<installation>/projects/`; **Save Project As** creates and switches to a copy at a user-selected location. Open the saved `project.json` using **File > Open Project**. A project contains model-specific `exmr`, `flowhmr`, `gvhmr` or `mamma` result folders; model switching loads existing results when available. MAMMA saves all input camera videos. People, takes, contact edits and imported characters are project data.
- `models/`, `projects/`, `cache/`, `character_scenes/`, `runtime*/` and `.setup/` are local data, not source artifacts. User project folders can also be outside the checkout. Never assume `.gitignore` protects a path that was already tracked or will be force-added. Check `git status` and tracked files before committing; do not upload model weights, video, personal data, credentials, generated motion or caches. Explicitly approved README sample assets are exceptions.
- Preserve source videos, registered weights and project data. Do not delete project subfolders, results or receipts to fix a problem: they can be referenced by saved metadata. Cache cleanup and setup-download cleanup are distinct from deleting saved work; see [storage and cleanup](USER_GUIDE.md#storage-and-cleanup). Obtain authorization for destructive cleanup.
- `mocap/paths.py` defines `ROOT`, `RGB_MOCAP_DATA`, models and projects; normal portable startup sets its own data location. When diagnosing an actual run inspect the effective environment rather than assuming a path.
## Resources and performance
-Use **Resource Mode > Automatic** by default. **Low Memory** uses smaller image batches; it is a separate choice, not a promise every clip will fit. GPU/CPU memory availability, resolution, clip duration and camera settings affect workloads. Model processing is not rejected using predicted RAM/VRAM requirements. The desktop checks actual available RAM and Windows allocation headroom every 0.5 seconds and stops the worker tree when these become low; actual allocation failures also produce an error. Close competing applications or shorten the clip after a memory-related stop. Keep genuine model frame limits, bounded buffers and adaptive batch/attention choices; do not silently change model quality or truncate motion. Avoid expensive AI reruns for operations that can use existing results.
+Use **Resource Mode > Automatic** by default. **Low Memory** uses smaller image batches in supported single-video stages; it is a separate choice, not a promise every clip will fit. MAMMA retains its pinned masks/landmark/fitting settings: Low Memory does not reduce its view count, fitting iterations or precision. GPU/CPU memory availability, resolution, clip duration and camera settings affect workloads. Model processing is not rejected using predicted RAM/VRAM requirements. The desktop checks actual available RAM and Windows allocation headroom every 0.5 seconds and stops the worker tree when these become low; actual allocation failures also produce an error. Close competing applications or shorten the clip after a memory-related stop. Keep genuine model frame limits, bounded buffers and adaptive batch/attention choices; do not silently change model quality or truncate motion. Avoid expensive AI reruns for operations that can use existing results.
GPU allocator limits share ComfyUI's external-use margin: 600 MiB on Windows, 700 MiB above 15 GiB GPU capacity (400 MiB on other systems). Subtract it from actual free VRAM without an additional percentage cap or fixed FlowHMR/ExMR 3/2 GiB reserve. This margin is separate from inference working space, which stays inside the allocator budget. Do not copy ComfyUI's model offload or quality-changing policies into these models.
@@ -63,6 +86,7 @@ The app uses separate runtime profiles to maintain compatibility, with bounded b
- GUI, people, controls and logging: `mocap/gui.py`, `workspace_ui.py`, `people_ui.py`, `character_ui.py`, `console_log.py`, `tooltips.py`.
- Model selection and loading: `mocap/motion_tools.py`, `models.py`, `model_guide.py`; worker routing and runtimes: `worker.py`, `worker_progress.py`, `runtime_registry.py`, `compute_policy.py`.
+- MAMMA inputs/UI: `mocap/mamma_inputs.py`, `mamma_ui.py`; processing: `mamma_pipeline.py`, `mamma_camera.py`, `mamma_publish.py`, `mamma_body.py`; runtime/assets: `mamma_runtime.py`, `mamma_manager.py`, `mamma_models.py`, `installer/mamma-runtime-lock.json`, `tools/setup_mamma.py`. Follow [the native-build runbook](MAMMA_AGENT_SETUP.md) instead of guessing module build commands.
- Project storage: `project_storage.py`, `project_workspace.py`, `project_save.py`; contact correction: `correction.py`, `contact_trajectory.py`, `contact_pose_plan.py`, `contact_arm_plan.py`.
- Source mesh / bone fit and preview: `source_animation.py`, `source_surface.py`, `surface_roll.py`, `preview_data.py`, `viewer.py`, `viewport.py`; source export: `fbx_export.py`, `fbx_writer.py`, `scene_export.py`.
- Character pipeline: `mocap/retarget/` plus `character_data.py` and `character_ui.py`; Blender backend and model-specific constraints must be considered separately from source-person export.
diff --git a/docs/BUILD.md b/docs/BUILD.md
index 495cbdd..3b04c06 100644
--- a/docs/BUILD.md
+++ b/docs/BUILD.md
@@ -1,7 +1,8 @@
# Windows development guide
The Git source distribution uses `install.cmd`, `RGBMoCap.cmd`, and `update.cmd`
-for installation, launch and updates. For the native motion-correction module see
+for installation, launch and updates. For current model files and supported
+controls, see [model-specific guides](models/README.md). For the native motion-correction module see
[developer build instructions](../developer-build/motion-correction/README.md).
## Prerequisites
@@ -16,8 +17,10 @@ for installation, launch and updates. For the native motion-correction module se
installed or extracted separately. Keep its Python, libraries and license files.
- Internet access for dependencies; enough disk space for downloads and builds.
-No Ubuntu, WSL, Docker or system CUDA Toolkit is required for the reviewed wheel
-stack. GPU compatibility still depends on the NVIDIA driver and installed wheels.
+No Ubuntu, WSL or Docker is required. The three single-video workflows use the
+reviewed wheel stack without a system CUDA Toolkit. Optional MAMMA native builds
+require CUDA Toolkit 12.8 and the C++ tools described below. GPU compatibility
+still depends on the NVIDIA driver and installed wheels.
## Environments
@@ -148,3 +151,30 @@ Git attributes preserve exact source bytes for the source manifest, hash-pinned
runtime registry and unpacked wheel contents. Avoid automatic line-ending rewrites
of those files. When intentionally changing the registry, review and refresh the
lock's registry hash; the development bootstrap rejects an unreviewed mismatch.
+
+## Optional MAMMA runtime
+
+Follow the [agent installation and native-build runbook](MAMMA_AGENT_SETUP.md)
+for prerequisite checks, staged/manual builds, CUDA tests and recovery. For
+ordinary use, prefer the automated setup over manually assembling packages.
+
+`Setup_MAMMA.cmd` calls `tools/setup_mamma.py` after license acceptance.
+`installer/mamma-runtime-lock.json` pins Python 3.11.17, PyTorch 2.7.1+cu128,
+all package artifacts and the official MAMMA/SAM 2/pytorch_sdf commits by SHA-256.
+The six core runtime profiles stay unchanged. The optional setup needs Visual
+Studio 2022 C++ Build Tools with the Windows SDK and CUDA Toolkit 12.8.
+
+`installer/mamma_adapters.py` applies Windows portability and the validated
+FP32 masked-landmark/quiet-fit adapters to directly downloaded upstream source.
+The original helper code is in `installer/mamma_helpers/`. Restricted upstream
+source and compiled SDF modules must not be added to this repository.
+Both native SAM 2 and SDF are built for the installed GPU architecture, then
+checked by `installer/verify_mamma.py` (real CUDA kernels, SDF gradients and
+installed package file hashes). A GPU architecture change requires setup again.
+
+Verified generations live in ignored `runtime_mamma/<generation>/`; the active
+pointer is `.setup/mamma-runtime.json`. Download/build/verification failure
+preserves the old pointer. Setup stages first and checks again after relocation.
+Changing the optional lock/adapters invalidates this runtime only: the UI requests
+`Setup_MAMMA.cmd`, while other models and saved results stay available. Keep
+private benchmark scripts, logs and derived models outside the source checkout.
diff --git a/docs/MAMMA.md b/docs/MAMMA.md
new file mode 100644
index 0000000..8724d28
--- /dev/null
+++ b/docs/MAMMA.md
@@ -0,0 +1,303 @@
+# MAMMA multi-view reconstruction
+
+MAMMA reconstructs SMPL-X human motion from multiple camera views, including
+multi-person interactions. The [official input guide](https://github.com/cuevhv/mamma/blob/main/docs/YOUR-DATA.md)
+organizes footage and calibration by camera; it does not define four cameras as
+the maximum. The [official dataset documentation](https://github.com/cuevhv/mamma/blob/main/docs/DATASETS.md)
+includes 16- and 32-camera captures as well as four-iPhone captures. The four-view
+example is not a general model limit.
+
+**RGB MoCap implementation:** reconstruction accepts two or more synchronized
+fixed-camera videos without a fixed camera-count maximum. Available RAM and
+VRAM determine practical capacity. Existing system-memory monitoring, CUDA
+allocator budgeting and OOM failure handling remain active; removing the input
+count limit does not guarantee that every camera/clip combination fits memory.
+Four columns in the thumbnail strip are only a layout choice; more views add
+rows. Input/preparation/save/restore was checked with up to 65 tiny synthetic
+camera files, not 65-view AI fitting. Full model inference has only the scope
+recorded in [validation](VALIDATION.md); official multi-camera datasets are not
+evidence that every such workload fits this adapter or a particular GPU.
+See [all model guides](models/README.md) for the other capture workflows.
+
+It has a separate optional runtime; ExMR, FlowHMR and GVHMR keep their existing
+environments. Run the normal `install.cmd` first.
+
+## Before installing
+
+Obtain the official [MAMMA code and registered assets](https://mamma.is.tue.mpg.de/)
+under its own license. The MAMMA software, weights, dataset and locked-head
+SMPL-X body data have separate restricted-use terms. They are not redistributed
+in this repository; the root MIT license covers the original connector only.
+This integration does not grant commercial-use or redistribution permission.
+
+Use 64-bit Windows and a compatible NVIDIA GPU/driver. This path builds native
+CUDA components locally. Install the following tools separately before running
+the MAMMA setup:
+
+- **Visual Studio 2022 Build Tools**, with **Desktop development with C++** and
+ a Windows SDK. Select the 2022 release.
+- **[NVIDIA CUDA Toolkit 12.8](https://developer.nvidia.com/cuda-12-8-0-download-archive)**.
+ The NVIDIA driver alone does not include the CUDA compiler.
+
+Compiler tools add disk usage beyond the runtime and may require administrator
+installation. The app and its runtime are installed in the existing RGB MoCap
+folder. Only one Windows/NVIDIA PC has been tested; a clean Windows installation
+and other GPUs have not been verified.
+
+| Item | Storage |
+| --- | ---: |
+| Installed MAMMA runtime on the test PC | 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 |
+| 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.
+
+## Install the runtime
+
+1. Complete the [base installation](USER_GUIDE.md#install) with `install.cmd`,
+ then install the compiler tools above.
+2. Save your project and close RGB MoCap. In its folder, run:
+
+ ```cmd
+ Setup_MAMMA.cmd
+ ```
+
+3. Read and accept the upstream license prompt if its terms permit your use.
+ Setup downloads hash-pinned packages and official source, compiles SAM 2/SDF
+ for this PC's GPU, tests actual CUDA kernels and checks installed package
+ hashes before enabling the runtime. Provider passwords are not requested.
+4. Run `RGBMoCap.cmd`, select **MAMMA** in **AI Motion Model**, and open
+ **Model Manager**. **Runtime Setup...**
+ shows readiness, prerequisites and a command you can copy. Prepare models
+ separately as described below.
+
+Keep the setup window open until it reports completion. **Runtime Setup...**
+shows instructions and can copy the command; it does not run installation inside
+the app. You do not need to install Python packages by hand. The installer uses
+its separate pinned Python 3.11/PyTorch CUDA environment without replacing the
+other model runtimes.
+
+MAMMA and pytorch_sdf prohibit ordinary redistribution under their provider
+terms. Consequently, their source/native modules are downloaded and built on
+the user's machine rather than shipped as prebuilt files by RGB MoCap.
+
+## Prepare model files
+
+Select **MAMMA** before opening **Model Manager**. Use automatic download for
+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
+`models/` folder; importing places the file in its expected location.
+
+| Asset | How to obtain it | Destination inside `models/` |
+| --- | --- | --- |
+| MAMMA checkpoint | [MAMMA website](https://mamma.is.tue.mpg.de/), manual download | `mamma/mamma_mask_full_cvpr.ckpt` |
+| Surface landmarks | MAMMA website, manual download | `mamma/verts_512.pkl` |
+| Locked-head SMPL-X Neutral, Male and Female (three files) | [SMPL-X website](https://smpl-x.is.tue.mpg.de/), manual download | `mamma/smplx/SMPLX_NEUTRAL.npz`, `SMPLX_MALE.npz`, `SMPLX_FEMALE.npz` |
+| SAM 2.1 Hiera Large | Automatic download | `mamma/sam2.1_hiera_large.pt` |
+| 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` |
+
+For the MAMMA checkpoint and surface landmarks, open the
+[official MAMMA website](https://mamma.is.tue.mpg.de/) and click **Data**.
+Register if needed, review and accept the provider terms, then sign in to access
+the download page. Download `mamma_mask_full_cvpr.ckpt` and `verts_512.pkl`.
+Return to Model Manager and use **Import** in each matching row, or directly
+from its **Manual Download** window. The app does not need your password or token.
+
+On the separate SMPL-X site, choose **"SMPL-X with removed head bun (NPZ, 392 MB)"**.
+Extract the archive and import each of its three NPZ files. The ordinary SMPL-X
+v1.1 files used by other models cannot replace these locked-head files.
+Supported files are checked against expected SHA-256 hashes. If an automatic
+download fails, use the row's manual download/import actions. With compatible
+**Manual Camera Data**, the VGGT weight is not required; the other eight assets
+are still needed.
+
+## Prepare your videos
+
+- Use two or more fixed-camera views of the **same performance**, with overlapping views
+ of the people. Unrelated videos are not multi-view input.
+- Synchronize their starting times before opening them. The app does not align
+ audio or provide separate camera start offsets.
+- Use distinct, short filenames such as `camera_01.mp4` and `camera_02.mp4`.
+ Filenames without extensions identify cameras, including in manual calibration.
+- Ensure the intended people are visible in the first camera, which initializes
+ their identities. A view in which a person is completely hidden supplies little
+ useful evidence for that person.
+
+The app uses a common 30 fps timeline, limited by the shortest input. The current
+adapter accepts 4–1,800 common frames (up to 60 seconds at 30 fps) and at most
+eight people. Start with a short trimmed section to check the cameras and masks
+before processing a long clip. These are adapter limits, not a guarantee that
+every clip fits memory; the full 60-second limit has not been validated.
+
+## Reconstruct and export
+
+1. Select **MAMMA** and use **File > Open Video** to select two or more
+ synchronized, fixed-camera videos of the same performance.
+2. Click camera thumbnails to change the main preview. Up to four thumbnails
+ 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**
+ 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.
+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.
+ Mask fragments below eight pixels are removed when a substantial component
+ exists; soft visibility weights reduce the influence of occluded views.
+5. Review the people together in one shared world. Check/uncheck **People** rows
+ to show or hide them; select a row to edit that person's contacts.
+ **Enable Correction** is on
+ by default; turning it off selects the preserved original motion. Edit contact
+ timing and use **Apply Correction** as for the other models. These operations
+ do not need new MAMMA inference. Foot correction is on and hand correction is
+ off by default; enable **Hand** when palm support is needed. The viewport
+ **Lock** checkbox only shows or hides contact markers.
+6. Use **File > Export FBX** for the displayed, applied motion. It uses the
+ existing 52-bone source-export convention. Use **File > Save Project As** to
+ keep a named copy; reopen its `project.json` with **File > Open Project**.
+
+Resource monitoring remains active. Fitting can take several minutes even for
+a short clip; an animated progress indicator is used when the stage cannot
+report a meaningful percentage. The app uses SAM 2.1 and FP32 fitting; SAM 3.1
+standalone tests remain separate. No quantization, TF32, iteration reduction or
+physics simulation is enabled in this path.
+
+Low Memory does not select smaller MAMMA camera sets, fewer fitting iterations
+or a lower-precision model. The shared allocator budget and system-memory guard
+still apply; shorten the common clip or reduce input views yourself if needed.
+
+## 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
+(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.
+
+### JSON example and required fields
+
+Open [mamma-camera-example.json](samples/mamma-camera-example.json) for a complete,
+importable two-camera example. It is an original RGB MoCap **synthetic format
+example**, covered by this repository's MIT license. Its numbers are not measured
+calibration for MAMMA's videos or your own footage. Changing camera names alone
+does not calibrate a video; use VGGT when you do not have matching calibration.
+
+| Field | Required structure and meaning |
+| --- | --- |
+| `units` | `"metres"`; translations use metres. |
+| `extrinsics_convention` | `"world_to_camera"`. |
+| `cameras` | Object containing one entry for every opened video. Each key must exactly match its filename without the extension: `A001.mp4` → `A001`. Remove unused camera entries when opening only a subset of views. |
+| `intrinsic_matrix` | 3×3 matrix `[[fx,0,cx],[0,fy,cy],[0,0,1]]`. Focal lengths `fx,fy` and optical center `cx,cy` are in pixels for the original input resolution. |
+| `extrinsics_matrix` | 3×4 matrix `[R | t]`, or 4×4 with last row `[0,0,0,1]`. `R` is a proper rotation; `t` is a translation in metres. Maps a world point to camera coordinates: `p_camera = R @ p_world + t`. |
+| `image_size` | `[width,height]` in pixels, matching the original opened video, not the app's resized working copy. |
+| `distortion_coeffs` | Optional `[k1,k2,p1,p2]` or `[k1,k2,p1,p2,k3]`. Omitted means zero. The current app adapter requires all zeros and undistorted pinhole footage. |
+
+The example has `A001` and `B001` entries at 1920×1080. It describes two hypothetical
+cameras at `[0,-4,1.6]` and `[4,0,1.6]` metres, looking toward the world origin.
+Camera position is **not** the last column of the extrinsic matrix:
+`camera_position_world = -R.T @ t`.
+
+Use a **Z-up world** (ground at world Z=0) and OpenCV-style camera axes: X right,
+Y down, Z forward. Zero intrinsic skew and zero lens distortion are required;
+unsupported calibration is rejected rather than silently discarded. Intrinsics
+are explicitly resized to the working input dimensions. Import is limited to
+1 MiB per calibration file.
+
+Open the matching videos, choose **Manual Camera Data**, click **Import Camera
+Data...**, select the JSON, then **Reconstruct 3D**. A camera-name or resolution
+mismatch is rejected. The app cannot confirm that supplied calibration measures
+the correct real camera arrangement. VGGT ignores supplied manual calibration.
+
+### Official MAMMA sample calibration
+
+The official four-camera `pushing_and_lifting_from_ground` demo pairs its
+`A001.mp4`, `B001.mp4`, `C001.mp4` and `D001.mp4` videos with
+[iphones_outdoors.yaml](https://github.com/cuevhv/mamma/blob/588492f18876e2ed6888b2d26929047cb6b575e7/configs/examples/calib/iphones_outdoors.yaml).
+This is **YAML**, not a camera JSON. Obtain it directly from MAMMA under its
+[upstream license](https://github.com/cuevhv/mamma/blob/588492f18876e2ed6888b2d26929047cb6b575e7/LICENSE);
+RGB MoCap does not redistribute the sample's original or converted calibration.
+Use the corresponding original-resolution videos; if you independently resize
+them, scale the calibration's focal lengths and optical center as well as its
+resolution. The official sample specifies 3840×2160.
+
+For MAMMA YAML, each entry under `cameras` has `intrinsics: [fx,fy,cx,cy]`,
+`resolution: [width,height]`, `translation` (camera position in the world), and
+`rotation_quaternion` (camera-to-world, Hamilton order `[w,x,y,z]`). The app
+converts this to world-to-camera matrices. JSON uses the matrix convention above.
+MAMMA's `configs/examples/captures/*.json` files describe input datasets and
+processing paths; they are **not camera calibration files** for this button.
+
+## Saved data and limitations
+
+**Save Project As** copies all camera videos and project-private body data.
+Keep the whole project folder together. MAMMA data lives under
+`<project>/mamma/inference/<generation>/` (working videos, masks, landmarks,
+cameras, raw fitted parameters) and `mamma/results/<generation>/` (native
+people/takes, contacts, previews and exports). Deleting these folders removes
+saved reconstruction work, not just disposable thumbnails.
+
+Prepared MAMMA people can also be used as character-retargeting sources. The
+retargeter reads the actor's project-private body, not the ordinary SMPL-X body
+used by ExMR/GVHMR. That extra standard body is not required for MAMMA-only
+retargeting. See [character import, retargeting and export](USER_GUIDE.md#character-retargeting).
+
+Each actor retains all sixteen shape coefficients exactly: the final six are
+folded into its private body template for the editor's ten-slot skin format.
+Animated poses, joint centers and hand means are preserved. Original raw motion
+is retained, while correction is saved separately. Body-derived files remain
+restricted registered data and must not be published with source code.
+
+Verified inference outputs are reused only with matching source, model, engine
+and connector identities plus output receipts. Interrupted attempts retain a
+pending generation; a retry cannot publish mixed outputs. Camera/person changes
+require reconstruction and leave the previous displayed motion in place.
+
+Occlusion, segmentation/identity mistakes, weak camera baselines and uncertain
+scale can still produce poor poses. Contact correction reduces sliding but does
+not repair lost identities, bad camera geometry or missing observations. This
+integration was tested on one Windows/NVIDIA PC. A three-view, two-person manual
+test processed 413 frames at 30 fps through correction/preview in **712.08 s**:
+masks 257.80 s, landmarks 89.72 s, cameras 14.42 s, fitting 294.42 s and final
+correction/preview 31.97 s; the remainder was video preparation/startup.
+No fatal traceback or OOM appeared in that log. This is one observation, not a
+speed guarantee. Clean Windows, other GPUs and the full 60-second limit have
+not been validated.
+
+## Updates and troubleshooting
+
+- **Runtime missing or out of date:** save your work, close the app and run
+ `Setup_MAMMA.cmd`. `update.cmd` maintains the base runtimes; it does not install
+ this optional runtime. Re-run the MAMMA setup when its dependency notice asks
+ you to, or after changing GPU architecture.
+- **Compilation or download failure:** check the setup message, free space,
+ compiler prerequisites and `.setup/logs/mamma-*.log`, then retry. Verified
+ downloads can be reused. A failed setup retains the previously enabled runtime,
+ models and projects. Do not delete active `runtime_mamma/` or `.setup/` state.
+- **Models not ready:** use the exact supported file and **Import...**. Recheck
+ that the SMPL-X archive is the locked-head version and that all three bodies
+ were imported. Manual camera mode can run without the VGGT weight.
+- **Poor poses or jitter:** inspect camera overlap, synchronization, identity
+ and masks first. Try a clearer first camera or an explicit **People** count.
+ Camera, people-count or reference-height changes require **Reconstruct 3D**;
+ **Apply Correction** only updates contact correction.
+
+The verified runtime is stored in an immutable generation under
+`runtime_mamma/`, referenced by `.setup/mamma-runtime.json`. It is configured for
+this installation's paths; copying that folder alone is not a supported setup
+method. For development environments and detailed checks, see
+[the agent installation/native-build runbook](MAMMA_AGENT_SETUP.md),
+[Build from source](BUILD.md) and [Validation](VALIDATION.md).
diff --git a/docs/MAMMA_AGENT_SETUP.md b/docs/MAMMA_AGENT_SETUP.md
new file mode 100644
index 0000000..731c319
--- /dev/null
+++ b/docs/MAMMA_AGENT_SETUP.md
@@ -0,0 +1,368 @@
+# MAMMA runtime and native build: agent guide
+
+Use this runbook when helping a Windows user install, repair or independently
+build the optional MAMMA environment. Read [AGENT_GUIDE.md](AGENT_GUIDE.md) first.
+For user-facing input/model instructions, see [MAMMA.md](MAMMA.md).
+
+The preferred route is **Setup_MAMMA.cmd**. It already downloads, builds, tests
+and registers the environment. Do not ask ordinary users to reproduce the manual
+build below when the supported installer can do the work.
+
+## 1. Scope and authoritative files
+
+| File | Responsibility |
+| --- | --- |
+| `Setup_MAMMA.cmd` | Human-readable prerequisite/license prompt, then optional setup |
+| `tools/setup_mamma.py` | Pinned downloads, compiler discovery, isolated staging, native build, verification and atomic activation |
+| `installer/mamma-runtime-lock.json` | Exact Python, package artifacts, source commits, sizes and SHA-256 values |
+| `installer/mamma_adapters.py` | Windows/validated engine changes and SDF MSVC fixes |
+| `installer/mamma_helpers/` | Original exact-ROI/FP32 landmark helpers copied into the engine |
+| `installer/verify_mamma.py` | Full locked-package check, actual CUDA kernel tests and installed-file verification |
+| `mocap/mamma_runtime.py` | Runtime registration, activation checks and engine fingerprint |
+| `tools/configure_mamma.py` | Registration of an independently prepared environment |
+| `mocap/mamma_models.py` | Supported model paths, hashes and provider instructions |
+
+Read the current files before using copied commands: the lock is authoritative,
+not the version examples in this document. This guide does not install packages
+into the GUI, shared, FlowHMR, HandFlow, HTD, ExMR or Blender runtimes.
+
+Current optional pins include Python **3.11.17**, PyTorch **2.7.1+cu128**,
+torchvision **0.22.1+cu128**, NumPy **1.26.4**, SciPy **1.17.1**, smplx
+**0.1.28** and timm **1.0.30**. All remaining dependencies are also locked.
+Do not substitute the latest pip versions or merge the model runtimes.
+
+## 2. Before changing anything
+
+1. Identify the actual app checkout containing `RGBMoCap.cmd`. Do not assume the
+ user's working directory, a historic test folder or a different installation
+ is the active app. Run commands from that checkout.
+2. Save work and close RGB MoCap and other installers/updaters for this checkout.
+ The installer uses an OS file lock in `.setup/app.lock`. A file remaining on
+ disk is normal; deleting it is not a way to release a live process's lock.
+3. Read `git status --short`. Preserve local source edits and user data. Do not
+ reset the repository, delete runtimes or copy another installation over it.
+4. If `.setup/mamma-runtime.json` exists, inspect its `version`, `python`,
+ `engine`, `managed_id` and `compute_capability` when present. These are local
+ absolute paths. Keep configuration/log copies private; redact usernames and
+ personal paths from public reports.
+5. Back up the existing configuration to a private diagnostics directory outside
+ the publishable source. Preserve its referenced environment in place. A
+ backup of the JSON alone cannot restore a deleted runtime.
+6. Check the available disk space and GPU/driver. Do not start competing model
+ inference while compiling or running GPU validation.
+
+Model files, registered body data, projects, contact edits, character data and
+source videos are not build inputs to delete. Never include them in a commit.
+
+## 3. Prerequisites and GPU target
+
+- Complete the ordinary `install.cmd` installation first. The optional setup
+ uses `runtime/python.exe` and the verified `.setup/bootstrap-git/uv.exe`.
+- Use native 64-bit Windows with an NVIDIA CUDA-capable GPU and a driver
+ compatible with the pinned CUDA 12.8 PyTorch stack. No CPU/AMD fallback is
+ implemented for this MAMMA pipeline.
+- Install **Visual Studio 2022 Build Tools**, **Desktop development with C++**,
+ the x64 compiler and a Windows SDK. The current discovery uses `vswhere` for
+ Visual Studio version 17.x; a different Visual Studio major version is not a
+ drop-in replacement.
+- Install **CUDA Toolkit 12.8**, including `nvcc.exe`. The CUDA version shown by
+ `nvidia-smi` describes driver capability; it does not prove the toolkit is
+ installed. Setup checks `CUDA_PATH_V12_8`, or the standard CUDA `v12.8` folder.
+- Review the provider licenses. The setup prompt requires acceptance; the
+ noninteractive `--accept-licenses` switch is an explicit acknowledgment, not a
+ switch to bypass those terms. Use it only when the user has already authorized
+ installation under the reviewed terms. Never handle provider passwords.
+
+Typical GeForce targets are RTX 30 = 8.6, RTX 40 = 8.9 and RTX 50 = 12.0.
+These examples are not a GPU support promise. Query the actual target interpreter:
+
+Before a MAMMA environment exists, use `nvidia-smi` for the initial GPU/driver
+inventory. Run the PyTorch probe below only after automatic setup or preparation
+of the complete private environment; do not switch another model's runtime to
+make the probe work.
+
+```powershell
+# PowerShell, from the app checkout. Replace the interpreter path below.
+$mammaPython = 'D:\MAMMA-build\runtime\python.exe'
+& $mammaPython -I -c "import torch; print(torch.__version__, torch.version.cuda); print(torch.cuda.is_available()); print(torch.cuda.get_device_name()); print(torch.cuda.get_device_capability())"
+if ($LASTEXITCODE -ne 0) { throw 'GPU probe failed; stop before building.' }
+```
+
+The installer sets `TORCH_CUDA_ARCH_LIST` to the installed GPU's capability.
+Different GPU models can share a target architecture, but that alone does not
+prove binary compatibility: the complete Python/PyTorch/OS/dependency stack must
+also match. Multi-architecture builds are not the current installer behavior.
+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.
+
+## 4. Supported automatic installation
+
+In PowerShell at the app root:
+
+```powershell
+.\Setup_MAMMA.cmd
+if ($LASTEXITCODE -ne 0) { throw 'MAMMA setup failed; inspect the setup logs.' }
+```
+
+The CMD presents the license prompt. In Command Prompt use `Setup_MAMMA.cmd`
+without the PowerShell `.\` prefix. Keep the terminal open until completion.
+No manual Python activation or package installation is needed for this route.
+
+Expected setup sequence:
+
+1. Acquire the app/installer lock; derive runtime identity from the optional
+ lock, adapter and two helper files.
+2. If the existing managed generation has the same identity, verify it again
+ and retain it when valid. Do not rebuild simply because setup emits no
+ download progress.
+3. Locate Visual Studio 2022 and CUDA 12.8; check free space.
+4. Stage a separate full Python installation under
+ `.setup/mamma-staging/<generation>/`.
+5. Download locked packages and upstream source archives into
+ `.setup/mamma-downloads/`, checking sizes and SHA-256. Install the exact
+ artifacts without resolving alternative dependencies. Build the few locked
+ source packages as specified by the installer.
+6. Extract the pinned MAMMA, SAM 2 and SDF sources. Apply the Windows adapters to
+ fresh source exactly once, copy the landmark helpers, and place MAMMA in
+ the staged `engine/` directory.
+7. Generate `build-native.cmd`, initialize `vcvars64.bat`, select the actual
+ GPU capability, and build SAM 2 and SDF against the staged Python/PyTorch.
+8. Prune the installer-defined unneeded build artifacts; run the full verifier.
+9. Move the verified generation to `runtime_mamma/<generation>/` and verify it
+ again from its final location before registering it.
+10. Write the readiness/installation reports and atomically replace
+ `.setup/mamma-runtime.json`. Other model runtimes and user data are retained.
+
+Opaque phases report periodic activity with elapsed time, not a fabricated
+percentage. Logs include `.setup/logs/mamma-python.log`,
+`mamma-packages.log`, `mamma-native.log` and `mamma-verify.log`.
+Source-package steps have their own `mamma-<package>.log` files.
+
+Reopen the app and select **MAMMA > Model Manager**. The managed runtime should
+show **Ready**. Model readiness is separate; follow [the model checklist](MAMMA.md#prepare-model-files).
+The runtime readiness label alone does not test the complete inference pipeline.
+
+## 5. Independently built environment: advanced route
+
+Use this route only to register an already prepared, independently verified
+environment or to develop native changes. There is no GUI `.pyd` import action.
+Build in a **new private directory**, never on top of the active generation.
+
+### Prepare the complete environment and source
+
+1. Prepare a separate Python environment with **all** packages and versions in
+ `installer/mamma-runtime-lock.json`. The supported automatic setup is the
+ reference for fetching/installing these artifacts. The native build commands
+ below do not create that full environment or install missing dependencies.
+ Do not use a bare Python environment with only torch installed.
+2. Acquire fresh source from the exact lock entries `sources.mamma`,
+ `sources.sam2` and `sources.sdf`. Check each archive's bytes/SHA-256 before
+ extraction; retain upstream licenses. Do not fetch a moving `main` branch.
+ If writing a preparation helper, use the installer's validated download and
+ `extract_source` functions rather than an unchecked ZIP extraction routine.
+3. Apply `adapt_engine(engine_path, helpers_path)` and `adapt_sdf(sdf_path)` from
+ `installer/mamma_adapters.py`. `helpers_path` is the current checkout's
+ `installer/mamma_helpers`. SAM 2 uses the pinned source without this SDF patch.
+ These adapters assume **fresh upstream source**; do not apply them twice.
+
+The SDF adapter addresses MSVC alignment, Windows integer width (`long` versus
+`int64_t`), the PyTorch scalar-type API and preprocessor/dispatch compatibility.
+The engine adapter handles Windows FFmpeg/EGL/multiprocessing behavior,
+CPU checkpoint loading, exact-ROI helpers and validated fitting diagnostics.
+Read the actual patch before changing it. Do not silently remove algorithms,
+switch precision or reduce fitting iterations to make a build pass.
+
+Example adapter invocation, after obtaining fresh pinned source and setting the
+real paths in PowerShell:
+
+```powershell
+$mammaApp = (Resolve-Path '.').Path
+$mammaEngine = 'D:\MAMMA-build\engine'
+$mammaSdfSource = 'D:\MAMMA-build\sources\sdf'
+& "$mammaApp\runtime\python.exe" -B -c "from installer.mamma_adapters import adapt_engine,adapt_sdf; import sys; adapt_engine(sys.argv[1],sys.argv[2]); adapt_sdf(sys.argv[3])" $mammaEngine "$mammaApp\installer\mamma_helpers" $mammaSdfSource
+if ($LASTEXITCODE -ne 0) { throw 'Adapter failed; do not continue with partially patched source.' }
+```
+
+### Compile the two native packages
+
+Use a **Visual Studio 2022 x64 Native Tools Command Prompt**, then start
+PowerShell inside it so the compiler environment is inherited. Alternatively,
+use a generated CMD that calls the discovered `vcvars64.bat`, as the installer
+does. `cl.exe` in an unrelated terminal is not enough evidence of a complete SDK.
+
+The following PowerShell example assumes the fully prepared private Python and
+fresh adapted sources above. Adjust the example paths. Fail after either build;
+do not proceed because only the second command succeeded.
+
+```powershell
+$mammaApp = (Resolve-Path '.').Path
+$mammaPython = 'D:\MAMMA-build\runtime\python.exe'
+$mammaSamSource = 'D:\MAMMA-build\sources\sam2'
+$mammaSdfSource = 'D:\MAMMA-build\sources\sdf'
+$mammaSite = (& $mammaPython -I -c "import sysconfig; print(sysconfig.get_path('purelib'))").Trim()
+if ($LASTEXITCODE -ne 0) { throw 'Cannot locate the target site-packages.' }
+$mammaArch = (& $mammaPython -I -c "import torch; assert torch.cuda.is_available(); print('.'.join(map(str,torch.cuda.get_device_capability())))").Trim()
+if ($LASTEXITCODE -ne 0 -or $mammaArch -notmatch '^\d+\.\d+$') { throw 'Cannot determine the GPU architecture.' }
+
+$env:CUDA_HOME = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8'
+$env:TORCH_CUDA_ARCH_LIST = $mammaArch
+$env:MAX_JOBS = '2'
+$env:DISTUTILS_USE_SDK = '1'
+$env:MSSdk = '1'
+$env:FORCE_CUDA = '1'
+$env:SAM2_BUILD_ALLOW_ERRORS = '0'
+$env:SAM2_BUILD_CUDA = '1'
+
+foreach ($mammaSource in @($mammaSamSource, $mammaSdfSource)) {
+ & "$mammaApp\.setup\bootstrap-git\uv.exe" pip install --python $mammaPython --target $mammaSite --no-deps --no-build-isolation --no-index --offline --no-cache --link-mode copy $mammaSource
+ if ($LASTEXITCODE -ne 0) { throw "Native build failed: $mammaSource" }
+}
+```
+
+All build dependencies must already exist for the offline commands. This limits
+compiler concurrency to two jobs, as in the installer, instead of using every
+CPU core and exhausting RAM. Capture the output in a private log. Never enable
+SAM 2's allow-errors fallback and report a successful CUDA build afterward.
+Do not force unsupported compilers or copy unrelated DLLs into Windows folders.
+
+If a candidate already contains older SAM/SDF packages, create a fresh candidate
+or reinstall those distributions cleanly within that disposable candidate first.
+Do not leave stale `.pyd` files beside a new build or overwrite an active runtime.
+
+### Verify before registration
+
+From the app root, with the private interpreter:
+
+```powershell
+& $mammaPython -I -X utf8 -B installer\verify_mamma.py --lock installer\mamma-runtime-lock.json --output 'D:\MAMMA-build\verification.json'
+if ($LASTEXITCODE -ne 0) { throw 'Verification failed; do not register this environment.' }
+```
+
+The output directory must exist. This command needs no model weights. It checks:
+
+- Exact Python and every locked distribution version.
+- Real SDF CUDA BVH distances, closest triangle indices and point gradients.
+- Inside/outside winding calculations on a known mesh.
+- SAM 2 CUDA connected-component areas on a known mask.
+- Distribution RECORD SHA-256 hashes, excluding the explicitly skipped
+ developer/debug artifacts in the verifier.
+
+Current numeric limits: squared-distance/gradient error no more than `2e-6`;
+winding error no more than `1e-4`; a known four-pixel component must have area
+four. Do not loosen limits to accept a bad build. Import success alone does not
+detect wrong index width, wrong kernels or unsupported GPU code.
+
+Save GPU capability, driver/toolkit/compiler versions, source commits, build
+arguments, native binary hashes and the verification JSON privately. If moving
+the candidate to a final location, repeat verification at that location.
+
+### Register and check the app
+
+Close the app first and preserve the previous configuration as described above.
+Only after the full verifier succeeds:
+
+```powershell
+& .\runtime\python.exe -B tools\configure_mamma.py --python $mammaPython --engine $mammaEngine --reviewed-mamma-license
+if ($LASTEXITCODE -ne 0) { throw 'Registration failed; preserve the previous runtime.' }
+```
+
+This writes a **version 2** external configuration. Model Manager says
+**Configured separately**, which is expected; the automatic installer writes a
+**version 3** managed configuration instead. The command requires the adapted
+engine and helper files, checks selected package versions/imports and CUDA
+availability, then records the engine source fingerprint. It **does not run the
+full native verifier** and does not replace that step.
+
+External configurations do not have all the managed runtime identity and GPU
+architecture checks. Their owner must revalidate after GPU, dependency or native
+module changes. Do not edit JSON to fake version 3, `managed_id`, verification
+results or package versions. Do not relocate the configured paths afterward.
+
+Native binaries are not fully represented in the engine-source fingerprint.
+An existing inference cache can therefore conceal a manual native change, even
+after registering a different interpreter path with identical package versions.
+For a changed-module inference test, use a **new separate test project** and
+confirm that stages actually run, rather than deleting the user's cached work.
+
+## 6. End-to-end acceptance and evidence
+
+Use legitimately obtained local videos/models, in a separate private project.
+Do not upload registered weights or copy them into the public test source.
+
+1. Reopen `RGBMoCap.cmd`; inspect runtime readiness and required model rows.
+2. Select MAMMA and two synchronized fixed-camera videos, initially trimming to
+ about one second (at least four frames), with clearly visible people.
+3. Use VGGT, or valid manual calibration when deliberately testing that path.
+ Run Reconstruct 3D and record the actual masks, landmarks, cameras, fitting
+ and final correction/preview stages. A cache hit is not a new inference test.
+4. Confirm the expected people, finite poses and camera/video alignment. Review
+ original and corrected motion; inspect a few contact boundaries.
+5. Verify save/reopen, shared trim and thumbnail switching. If claiming export
+ compatibility, export the selected result and actually import it in Blender.
+ Retargeting requires its own test; do not infer it from a successful body fit.
+6. Record per-stage wall time, peak allocated/reserved PyTorch VRAM and process
+ RAM when available. Distinguish these from whole-GPU/whole-system usage.
+ Keep diagnostic logs and generated artifacts outside publishable files.
+
+The app has no fixed camera-count maximum, but still requires at least two
+views, 4–1,800 common frames and no more than eight people. Start small for
+runtime acceptance, then measure the user's intended workload. Do not restore
+the old four-view/64-entry ceilings or replace them with an arbitrary GPU-based
+camera cap. Keep the existing RAM/Windows allocation-headroom guard, CUDA
+allocator budget and allocation-error reporting. The 65-input synthetic
+preparation/save/restore tests do not validate 65-view masks, VGGT or fitting.
+
+Only report checks actually performed. Current evidence is one Windows 11 /
+RTX 5090 PC; it is not a clean-Windows, other-GPU or full 60-second validation.
+See [VALIDATION.md](VALIDATION.md) for recorded measurements.
+
+## 7. Failure diagnosis, retry and rollback
+
+| Symptom | Check and action |
+| --- | --- |
+| App/installer lock error | Close the relevant app/setup process normally. Do not delete a live lock or terminate unrelated processes. |
+| `nvcc`/Visual Studio not found | Check the full CUDA 12.8 toolkit and VS 2022 x64 C++ workload/SDK; the driver and another VS major version are insufficient. |
+| Package/source hash mismatch | Stop. Inspect the URL, partial download and exact lock entry. Do not disable hash checks or accept a different checkpoint/source. |
+| Adapter cannot find expected text/API | Source is wrong, already patched or changed. Start from a fresh exact pinned source copy; do not partially improvise the patch. |
+| Compiler fails or runs out of RAM | Inspect `mamma-native.log`; keep the two-job bound and close competing work. Check the exact compiler/toolkit, not model files. |
+| DLL load failure / native import failure | Confirm target Python/torch/CUDA and x64 architecture, package metadata and dependent DLLs. Rebuild the candidate; do not copy a random `.pyd`. |
+| No kernel image / invalid device function | Verify actual GPU capability and build architecture; rebuild and run CUDA tests on the target GPU. |
+| SDF/component verification fails | Reject the candidate. Check MSVC index-width patches, source versions and actual native module loaded. Do not relax numeric limits. |
+| Engine fingerprint mismatch | Engine code changed since registration. Revalidate a new candidate, then register it; do not edit fingerprints manually. |
+| Model Manager Ready but missing model | Runtime and weights are separate. Follow the supported hash-checked model import instructions. |
+
+Automatic setup publishes its pointer only after final verification. On failure,
+the previous active configuration is retained and the owned failed staging area
+is cleaned. Verified downloads remain for retry. Save the log, fix the actual
+prerequisite and rerun `Setup_MAMMA.cmd`; do not remove all of `.setup`.
+
+For a failed **manual** replacement, close the app, verify that the previous
+environment still exists, and restore only its backed-up
+`.setup/mamma-runtime.json`. Do not restore a pointer to a removed folder.
+Keep failed candidates/logs privately until diagnosed; remove a candidate only
+after checking its resolved absolute path and confirming it is not active.
+
+Running `Setup_MAMMA.cmd` later may select/register a managed generation again;
+it is not a promise to maintain or preserve custom changes inside an external
+environment. Treat a custom build and the automatic environment as separate.
+
+## 8. Publication and maintenance rules
+
+- Commit original setup/adapters/docs only. Restricted MAMMA/SDF source, native
+ builds, private environments, weights, body data, logs and videos stay local.
+ Preserve all upstream license notices; do not assume a local build authorizes
+ redistribution of binaries or multi-architecture wheels.
+- Review `git status` and `git ls-files`; ignore rules cannot protect a file
+ already tracked or force-added. Keep private experiments outside the checkout.
+- A new source/dependency/native policy needs lock/adapters review and new kernel
+ plus inference evidence. Do not merge it into another model runtime to save space.
+- If setup, adapters or locks change, refresh the source manifest and relevant
+ installation/validation docs. A docs-only change does not require recompilation.
+- Give the user a short result: what was installed, actual validation performed,
+ runtime readiness, storage used, limitations and any remaining action. Never
+ publish provider credentials or claim untested GPU support.
diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md
index 383fa0a..15f51d4 100644
--- a/docs/USER_GUIDE.md
+++ b/docs/USER_GUIDE.md
@@ -1,431 +1,511 @@
-# RGB MoCap user guide
-
-[Overview](../README.md) · [Build from source](BUILD.md)
-
-A native Windows app for turning video into human motion, reviewing the body mesh
-and animation bones, correcting hand/foot contacts, retargeting motion to humanoid
-characters, and exporting animation for Blender or MMD. Processing runs locally.
-
-## Character retargeting
-
-Transfer a reconstructed person's motion to a character without running AI
-inference again. Supported targets are **Mixamo FBX**, **VRM** and **PMX** humanoids.
-
-1. Prepare the source person's motion and apply any contact edits.
-2. Choose **File > Import Character...** and select the character file. It appears
- at the origin in its rest pose, below the source people in the **People** list.
-3. Right-click the character and choose **Retarget > [source person]**. The status
- bar shows processing progress. Play or scrub the timeline to review the result.
-4. Right-click the retargeted character and choose **Export Character...**, or
- select its row and use that command in **File**.
-
-Up to **8 characters** can be imported per project. Each character can use a
-different source person. Check or uncheck its row to show or hide it; use
-**Remove Character** in its right-click menu to remove it from the project.
-Character data and assigned motion are saved inside the project.
-
-Characters are drawn in front of the SMPL source meshes, with **Bone Overlay**
-above both. **Name** shows the list name above each visible person or character,
-including characters still in their rest pose. Names stay upright and the same
-screen size; crowded labels are separated. These controls change the preview only.
-
-Retargeting uses the selected source motion and its applied contact timings.
-**Apply Correction** also refreshes characters linked to the corrected source,
-including hidden characters. After other source changes, run **Retarget** again.
-A character marked **Needs retarget** must be updated before export.
-Unreachable hand/foot targets
-are not solved by stretching bones. Large differences in body proportions may
-require further editing in animation software. Travel distance can differ from
-the source because motion is scaled to the target character's leg length;
-shorter-legged characters may cover less ground, and longer-legged characters
-may cover more. Source contact timings are retained.
-
-Only mapped body/finger bones and necessary body helpers receive animation;
-the armature object stays unkeyed.
-Hair, clothing and secondary physics are not simulated.
-
-| Export option | Result |
-| --- | --- |
-| **FBX + Include character mesh** | Character mesh, skeleton and animation. |
-| **FBX, mesh unchecked** | Skeleton and animation only. |
-| **VMD (PMX characters only)** | Body/finger motion sampled at 30 fps for the same PMX model in MMD. Facial animation and physics are not generated. |
-
-Separate takes produce separate files. Both FBX options preserve the imported
-character's original bone hierarchy and rest pose separately from its animation;
-the first animation frame does not replace the rest pose. Existing retargeted
-characters can be exported again to use the corrected FBX rest-pose handling.
-
-Known humanoid mappings are automatic; custom bone mapping is not yet available.
-Files missing required body bones are rejected with a message. The viewport shows
-base-color textures at their original resolution, with simplified lighting rather
-than a full material/physics renderer. Existing characters prepare a texture cache
-in the background on first display; reimporting or retargeting is not required.
-Textures are reused during playback. Oversized textures produce a clear error
-instead of being silently reduced in resolution.
-
-### Included Blender runtime
-
-`install.cmd` installs a separate **Blender 4.5 LTS** runtime in
-`runtime_character`. It runs in the background to import characters, evaluate rig
-constraints, bake bone animation and export character FBX/VMD files. You do not
-need to install or open Blender separately after running `install.cmd`. Keep this
-folder with the app.
-
-RGB MoCap performs the retargeting/contact calculations and viewport playback.
-The Blender backend also provides a foundation for future format support and
-animation-processing features; these are possibilities, not additional features
-currently provided by the app. Hair/clothing physics remains unsupported.
-
-The Git checkout does not include Blender binaries. `install.cmd` downloads the
-pinned Blender runtime automatically. Development runs may set
-`RGBMOCAP_BLENDER` to a compatible `blender.exe`; see [Build from source](BUILD.md).
-Blender retains its GPL license and bundled notices; see [Third-party notices](../THIRD_PARTY_NOTICES.md).
-
-## Install
-
-**Tested configuration:** NVIDIA GeForce RTX 5090 (32 GB VRAM), AMD Ryzen 9
-9950X, 96 GB RAM, Windows 11 Pro (64-bit). This is the tested configuration,
-not a minimum specification. Other GPUs, drivers and clean Windows installations
-have not yet been verified; compatibility reports are welcome.
-
-1. Install [Git for Windows](https://git-scm.com/download/win). Open **Command
- Prompt** in a writable folder, then run:
-
- ```cmd
- git clone https://github.com/toyxyz/toyxyz_RGBMocap.git
- cd toyxyz_RGBMocap
- ```
-
- Avoid protected folders such as Program Files. The commands below are for
- Command Prompt; in PowerShell, prefix each `.cmd` filename with `.\`.
-2. Run `install.cmd` with an internet connection. It downloads and verifies
- pinned Python environments, Blender 4.5.0, FFmpeg 7.1.1 and small upstream
- support files, and installs the included prebuilt motion-correction module.
- The AI runtimes remain separate. Downloads and free disk space are needed;
- the install can take time.
-3. Run `RGBMoCap.cmd`. Keep its console open while the GUI runs; launch errors
- and exit codes are displayed there. Processing messages and app **Console** output
- are also sent there, but very long or high-volume output can be truncated or
- dropped. Use **Help > Check System** if needed.
-4. In **Model Manager**, download or import the selected AI model files. Some
- models require registration and agreement to their provider's terms and must
- be downloaded manually.
-
-To update, close RGB MoCap and run `update.cmd` in the repository folder. It
-refuses to overwrite tracked local edits, requires the `main` branch, pulls only
-fast-forward changes and checks the runtimes. Back up or commit local changes
-before updating. A direct `git pull` updates source only; close the app first,
-and run `install.cmd` if dependencies change. The launcher will ask for setup if
-it detects an incomplete update or a dependency mismatch.
-
-If a download or installation fails, read the console message, check the internet
-connection and free disk space, and rerun `install.cmd`. A completed download may
-be reused. Do not delete `models`, `projects` or the remaining `.setup` state to
-retry. If Git reports a conflict or local changes, resolve or back them up before
-running `update.cmd` again.
-
-On the tested PC, a separate-folder first install took about 10 min 32 sec with
-previously verified package downloads reused; Blender and FFmpeg were downloaded.
-A subsequent code update and runtime verification took about 1 min 55 sec. These
-are single local tests, not estimates for a download with an empty cache or for
-other PCs; connection speed and storage performance affect the time.
-
-Allow at least **32.4 GiB free** for first-time runtime installation before
-models; this includes temporary installation space. The installed app, runtimes
-and all supported models total roughly **42 GiB (45 GB)**, including about
-29 GiB of model files. Download
-caches, videos, projects, characters and exports require additional space, and
-actual sizes can vary. No clean-Windows or other-GPU test is claimed.
-
-## Storage and cleanup
-
-In the installed app, `<install folder>` means the folder containing
-`RGBMoCap.cmd`. Close RGB MoCap and any installation or update before deleting files. Use **File →
-Open Project Folder** to locate the current project; a **Save Project As** copy
-may be outside the installation folder.
-
-| Location | What you can remove and what happens |
-| --- | --- |
-| `<install folder>\cache\` | Its contents can be deleted. This includes `huggingface`, `torch` and ExMR support caches. They are recreated or downloaded again when needed; the next run may take longer and require internet access. Saved projects and the separate `models` library remain. |
-| `<install folder>\projects\<project folder>\` | Delete an entire unwanted project folder. This removes its model results, prepared videos, previews, contact edits and imported/retargeted characters. Reprocessing requires the source video and AI inference; manual edits are lost. Keep projects you still need. |
-| Your **Save Project As** destination | The same rule applies to each saved project folder at your chosen location. It contains a copy of the video and project data. Deleting it removes that copy; cleaning the default `projects` folder does not clean external copies. |
-| `<install folder>\character_scenes\<session folder>\` | Contains characters imported before a project was opened. Old session folders can be deleted once those imports are no longer needed or have been copied into a saved project. Unsaved session imports are lost. |
-| `<install folder>\.setup\downloads\`, `.setup\uv-cache\` and `.setup\tmp\` | Downloaded wheels and temporary cache can be removed only after installation or update completes. They are reused for repair and updates; deleting them may require downloading files again. Keep the rest of `.setup`, including the private Python and installation state. |
-
-Repeated work mainly grows project data: each model has its own `exmr`, `flowhmr`
-or `gvhmr` folder, different processing ranges can add `clips` subfolders, and
-character imports/retargeting add character data. These are saved work, not just
-disposable caches. Do not delete individual model folders, `characters`, motion
-tensors, preview files or receipt files from a project you want to keep; its
-metadata can still reference them. Export or back up needed work, then remove an
-unwanted project as a whole. Exported FBX/VMD files in other folders must be
-managed separately.
-
-Keep `models`, `runtime*`, `mocap`, `third_party`, bundled assets and
-the remaining `.setup` repair files. Deleting these can remove required model
-files or break the app. Downloaded model archives stored elsewhere can be removed after a successful installation/import if you do not
-need an offline copy; keep a backup of manually acquired restricted models.
-
-## Start here
-
-1. **File → Open Video**, or drop a video into the workspace.
-2. Optionally trim the timeline's **Video** track by dragging its ends.
-3. Choose an **AI Motion Model**, then use **Model Manager** to prepare its files.
-4. For several people, use **Find person** and check who to reconstruct.
-5. Click **Reconstruct 3D**. Review the video, mesh and **Bone Overlay** together.
-6. Adjust correction settings or contact timings, then click **Apply Correction**.
-7. **File → Export FBX** saves the displayed, applied animation.
-
-To animate a character, follow [Character retargeting](#character-retargeting),
-then use **Export Character...** for FBX or, for PMX, VMD.
-
-**Open Project** restores saved results and settings. **Open Project Folder** opens
-their location. **Save Project As** (`Ctrl+Shift+S`) creates a new named project
-folder at your chosen location and switches to that copy. It includes the video,
-motion, people and contact edits for every model. Open its `project.json` to return
-to it. Each project manages `exmr`, `gvhmr` and `flowhmr` folders. Selecting a model
-loads its saved motion; if it has no result, **Reconstruct 3D** creates its data in
-that folder. Result selections, contact edits and settings stay separate by model.
-New processing ranges stay under that model's `clips` folder. The previous project
-folder format is not migrated; open the original video to create a new project.
-Model weights remain in the app's model
-library. Trimming does not modify the original video. Processing uses a
-30 fps working clip; camera sampling does not reduce its motion frame count.
-
-## Choose a model
-
-These quality comparisons are **subjective observations from our test videos**,
-not accuracy scores or a universal ranking. See the in-app **Model Guide** for
-recorded speed and memory measurements. New sessions start with **ExMR** selected;
-opening a project restores its saved model. **Prepare Preview**, below
-**Reconstruct 3D**, prepares existing motion without running inference again.
-
-| Model | Observed strengths | Finger animation |
-| --- | --- | --- |
-| **ExMR** | Generally fast, with good overall motion quality. | Included. |
-| **FlowHMR** | Slow, but the best overall motion quality in our tests. | Included. |
-| **GVHMR** | Lowest overall quality in our tests, but sometimes better for unusual poses such as backflips. | Optional **HandFlow**; not inferred by GVHMR itself. |
-
-All three support people selection, contact correction, a 52-bone overlay and
-FBX export. The viewport shows the selected source mesh: SMPL-X for ExMR/GVHMR,
-SMPL-H for FlowHMR. The export skeleton follows that motion; source estimation
-errors can remain.
-
-## Recorded processing time and VRAM
-
-Historical measurements on the tested PC above (30 fps inputs, October 2026),
-recorded before the current Git-based installation was tested.
-Each duration uses the same input across all three models.
-
-| Video length | Model | Processing time | Peak VRAM (GiB) |
-| --- | --- | ---: | ---: |
-| 7 seconds | ExMR | 1m 08s | 11.32 |
-| 7 seconds | FlowHMR | 2m 49s | 14.89 |
-| 7 seconds | GVHMR | 2m 01s | 5.08 |
-| 15 seconds | ExMR | 1m 47s | 11.32 |
-| 15 seconds | FlowHMR | 5m 16s | 10.79 |
-| 15 seconds | GVHMR | 2m 45s | 5.08 |
-| 25.7 seconds | ExMR | 1m 44s | 11.32 |
-| 25.7 seconds | FlowHMR | 7m 32s | 10.67 |
-| 25.7 seconds | GVHMR | 3m 00s | 5.08 |
-
-Times cover the recorded model-processing stages, excluding shared person
-tracking, app contact correction and preview/export. GVHMR includes HTD, FootMR
-and HandFlow. FlowHMR includes camera estimation and the original SAM path;
-these timings predate Fast SAM. VRAM is peak PyTorch **allocated** memory across
-workers, not total GPU usage or reserved memory. These are individual test runs,
-not minimum hardware requirements or predictions for every video. Resolution,
-camera motion, settings and available memory also affect results; a longer
-video does not always use more VRAM or take proportionally longer.
-
-## Prepare models
-
-**Model Manager** lists files for the selected tool and its add-ons.
-
-| Action | Meaning |
-| --- | --- |
-| **Auto Download / Download All** | Download supported missing public files; completed files are kept if you cancel or retry. |
-| **Manual Download...** | Show the exact file, provider link and download instructions. Use for files requiring registration or access approval. |
-| **Import...** | Validate and register a file you already downloaded. |
-
-Automatic downloads can fail, especially for files hosted on **Google Drive**.
-If a download fails, use **Manual Download...** on that model's row, open the
-provided link in your browser and download the exact file listed in the
-instructions. Use **Import...** directly in the manual download window, or on
-the same model row, to select the downloaded file. The instructions can stay
-open while you download and import. If it comes in an archive, extract the
-required file first. Import checks
-the file and places it in the correct model folder; check that the row is ready
-before reconstructing.
-
-Some models **do not support automatic download** because their providers
-require account registration, access approval and/or acceptance of license terms
-before downloading. This is separate from a temporary download failure. Use
-**Manual Download...** to visit the provider's site, complete its requirements
-in your browser, download the required file, then use **Import...** on the
-matching row. The app cannot complete these steps on your behalf.
-
-Registered body/hand models must be obtained under their provider's terms.
-Follow the manager's exact file instructions; model families are not interchangeable.
-The app does not need your provider password or access token.
-
-| Used by | Registered or access-controlled files |
-| --- | --- |
-| ExMR / GVHMR | [SMPL-X v1.1 neutral](https://smpl-x.is.tue.mpg.de/download.php): import `models/smplx/SMPLX_NEUTRAL.npz` from the downloaded archive. The app stores it under `models/body_models/smplx/`. |
-| FlowHMR | [AMASS SMPL-H neutral](https://mano.is.tue.mpg.de/download.php): Extended SMPL+H model, `smplh/neutral/model.npz` (16 shape components). |
-| 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 | [VGGT-Omega](https://huggingface.co/facebook/VGGT-Omega): supported `vggt_omega_1b_512.pt`. Not needed in Static Camera mode. |
-
-### Reuse models in a new installation
-
-After installing the app in a new location, close both copies of the app and
-copy the **entire `models` folder** from the old installation into the new
-installation folder, beside the new **RGBMoCap.cmd**:
-
-```text
-Old installation/models/ → New installation/models/
-```
-
-For example, copy `D:\RGBMoCap-Old\models` into `E:\RGBMoCap` so the result is
-`E:\RGBMoCap\models`, not `E:\RGBMoCap\models\models`. Keep all subfolders,
-configuration files, `.receipt.json` files and license files together. Copy
-first and keep the old files until the new installation works.
-
-Open the new app and check **Model Manager** for each model you use. If a copied
-file is not marked ready, use **Import...** on its row and select that file
-from the copied folder to validate it again. Copying can change file timestamps,
-and newer releases may require a different model version; follow the row's
-**Manual Download...** instructions if validation fails.
-
-Let `install.cmd` create the new runtime folders; do not copy the old `runtime*`
-folders over them. The `models` folder contains model files only. Saved work
-is in separate project folders, which can be copied separately and opened
-with **File → Open Project**.
-
-## Model and processing settings
-
-Changes to camera, smoothing or feature settings take effect on **Reconstruct 3D**.
-GVHMR refinement checkboxes also select saved preview/export results. If the
-selected result is missing, reconstruct it; the app reports it as unavailable.
-
-| Setting | Function and when to use it |
-| --- | --- |
-| **ExMR → Camera** | Static Camera for a camera that stays still without zooming; Moving Camera / SimpleVO when it moves. |
-| **ExMR → Smooth Motion** | Reduce small changes between frames. Off keeps the unsmoothed result. |
-| **FlowHMR → Fast SAM** | Speed up body/hand image processing with the same model files. Small numerical differences can affect motion and automatic contacts. |
-| **FlowHMR → Camera / Sampling** | Start with Moving / Unknown - Auto for moving or uncertain cameras. Static Camera skips camera estimation for locked footage. Explicit frame intervals control camera analysis only; denser sampling uses more memory. |
-| **GVHMR → HTD Refine** | Improve body-motion consistency over time. Runs before FootMR when both are enabled. |
-| **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. |
-| **Resource Mode** | Automatic balances speed and available memory. Low Memory uses smaller image batches while retaining inference quality. |
-| **Prepare Preview** | Rebuild mesh/skeleton previews from existing motion without running the AI model again. Useful for older projects. |
-| **Cancel Job** | Stop queued processing; completed results are kept. |
-
-Processing shows the current step, progress and elapsed time. **Step left** estimates
-the current step; **Total left** estimates the queue when timing data is available.
-Use **Console** for details and errors. Loading or unmeasured work shows activity
-instead of an invented percentage. FlowHMR is limited to 5,000 frames per take
-(about 166.7 seconds); available memory may require a shorter clip.
-
-Processing is allowed to start without a predicted RAM/VRAM minimum. While it
-runs, the app monitors actual available RAM and Windows allocation headroom.
-If either becomes low, it stops the processing job and shows the available memory
-in the error message. The app also reports actual CPU/GPU allocation failures.
-Completed stages are retained for retry. Low Memory can reduce supported batch
-sizes, but cannot guarantee that every model or video fits. A sudden large
-allocation can still fail before the next monitor check.
-
-GPU allocator budgets use ComfyUI's external-use margin: 600 MiB on Windows,
-or 700 MiB on GPUs larger than 15 GiB, subtracted from currently free VRAM.
-All three model paths use this rule; FlowHMR/ExMR no longer subtract fixed
-3/2 GiB or impose an additional 95/90% ceiling. Inference working memory is
-part of the allowed budget. This is not a guarantee of free VRAM: other apps
-and allocations outside PyTorch can still consume it.
-
-## Motion Correction
-
-Contact correction reduces sliding when feet or palms rest on a support. It uses
-existing motion without rerunning AI inference. Original and corrected results
-are kept separately. Enable Correction and Foot default on for new work; Hand
-defaults off. Existing projects retain saved selections.
-
-| Setting | Function and meaning |
-| --- | --- |
-| **Enable Correction** | Show the corrected result; off shows the uncorrected result. |
-| **Correction Mode → Flat Ground** | Use one correction floor for level ground. |
-| **Correction Mode → Multi Level** | Keep contacts at their inferred heights for stairs, slopes and changing levels. The single floor controls are inactive. Terrain geometry is not reconstructed. |
-| **Foot / Hand** | Correct only checked contact types. Disabling one retains its saved timing edits. Hand correction adjusts the arm for support contacts while retaining hand orientation. |
-| **Lock Preset** | Weak allows more original movement; Normal balances holding and smooth transitions; Strong holds more uncertain contacts and may resist intentional sliding. |
-| **Auto Floor Height** | Estimate the contact floor. Turn off to enter a manual height. |
-| **Floor Height (World Y)** | Floor height in metres along the vertical axis. Higher values raise the correction floor; the gray reference grid stays at zero. |
-| **Pelvis Height Offset (from Auto)** | Zero keeps automatic hip adjustment. Positive values undo some automatic lowering; negative values lower the hips further during contact. Raising can weaken foot locks. |
-| **Apply Correction** | Commit current settings and timeline timings, update the source preview/export, and recalculate linked characters. |
-
-Edit **L foot / R foot / L hand / R hand** tracks below the video track. Drag empty
-space to add an interval, drag it to move, or drag its edges to resize. Delete
-removes a selected interval; Ctrl+Z / Ctrl+Y undo/redo. **Reset Locks** restores
-automatic timings. The timeline's **?** has full editing instructions.
-
-Apply pending changes before export; stale corrected export is blocked. Automatic
-hand detection is intended for stable support such as a floor, or raised supports
-in Multi Level. Inspect its timing. Hanging poses, object interaction and larger
-animation edits are best handled in a 3D animation editor. Contact detection is
-an estimate and can leave residual sliding or penetration.
-
-## People, preview and navigation
-
-| Control | Function |
-| --- | --- |
-| **Find person** | Discover people for explicit selection. Without it, reconstruction tracks one person automatically and may switch identity when people overlap. |
-| **People checkboxes / selected row** | Checked people are processing/display targets. The selected row controls timeline and contact editing. |
-| **Character checkboxes / selected row** | Show or hide imported characters independently of source people. Select a character to export it; right-click it for Retarget, Export Character or Remove Character. |
-| **People → ?** | Open instructions for people selection, names, colors and takes. The list footer shows only current status or warnings. |
-| **Rename... / color square** | Right-click a row to rename it; click its square to change display color. The name is also used for FBX filenames and rig names. |
-| **Take selector** | Choose a visible section when a person leaves and reappears. Long unseen gaps are separate takes. |
-| **Overlays / Bone Overlay** | Show video observations / source export bones. Bone Overlay is drawn above source meshes and imported characters. Display only. |
-| **View direction / Frame All** | Choose a camera direction / fit visible people in the 3D view. Left drag orbits, middle/right drag pans, wheel zooms. |
-| **Floor Grid / Correction Floor** | Show the gray zero-height reference grid / orange correction floor preview. Neither applies correction. |
-| **Motion Path / Follow Actor** | Show the person's path / move the viewing camera with the person. |
-| **Lock** | Show active hand/foot contacts as translucent horizontal discs in timeline colors. Hand discs are at palm height, including raised supports. Display only. |
-| **Name** | Show list names above visible people and imported characters. Text stays upright and the same screen size as you move the camera. Rename a person from the list's right-click menu. |
-| **Timeline ruler / blue frame box** | Click or drag to seek. Track editing does not seek. Wheel zooms; middle drag or Shift+wheel pans. |
-| **Playback / frame number / speed** | Space plays/pauses; arrows step one frame, Shift+arrows one second. Enter a frame number to jump. Playback speed affects preview only. |
-| **Timeline Frame All / Reset Trim** | Fit the full timeline / restore the full clip range. |
-
-Checked people are processed independently and shown in a shared scene. They
-share correction mode/floor; timings and pelvis offsets remain per person/take.
-Apply Correction updates all available takes, including hidden ones. Relative
-depth and contacts between people are estimates; collision avoidance is not provided.
-
-## FBX and Blender
-
-**File → Export FBX** follows the displayed, applied result. Each checked
-person/take gets a separate named file and rig; duplicate filenames get suffixes.
-People exports use the viewport's shared placement. Takes retain their own frame
-counts; align their start times when combining different source intervals.
-
-Source-person exports use a 52-bone hierarchy with **Hips** as root and plain
-anatomical names. It retains
-actor lengths, SMPL-neutral curved limbs/feet, calibrated rest axes and straight
-open fingers. FBX stores rest transforms separately; no T-pose frame is inserted.
-BVH is internal compatibility data only.
-
-**Export Character...** preserves the imported target character's own hierarchy
-and original rest pose; it does not replace them with the 52-bone source rig.
-Character FBX animation is stored on bones, with no armature-object keyframes.
-
-In Blender use **Scale 1**, **Automatic Bone Orientation off**, **Use Pre/Post
-Rotation on**, **Ignore Leaf Bones on** and **Animation Offset 1**. The file supplies
-frame rate and axes. **Armature Data → Rest Position** shows the rest pose.
-The first frame in **Pose Position** shows animation, which can differ from rest.
-Use the character workflow above for supported humanoids, or retarget the source
-FBX in your animation software.
-
-## Development and license
-
-See [Build from source](BUILD.md) for environment setup, editing and release builds.
-Original RGB MoCap code/documentation uses the [MIT License](../LICENSE).
-Third-party code, derived modifications, weights and body data keep their own
-terms; see [Third-party notices](../THIRD_PARTY_NOTICES.md).
+# RGB MoCap user guide
+
+[Overview](../README.md) · [Build from source](BUILD.md)
+
+A native Windows app for turning video into human motion, reviewing the body mesh
+and animation bones, correcting hand/foot contacts, retargeting motion to humanoid
+characters, and exporting animation for Blender or MMD. Processing runs locally.
+
+## Character retargeting
+
+Transfer a reconstructed person's motion to a character without running AI
+inference again. Supported targets are **Mixamo FBX**, **VRM** and **PMX** humanoids.
+
+1. Prepare the source person's motion and apply any contact edits.
+2. Choose **File > Import Character...** and select the character file. It appears
+ at the origin in its rest pose, below the source people in the **People** list.
+3. Right-click the character and choose **Retarget > [source person]**. The status
+ bar shows processing progress. Play or scrub the timeline to review the result.
+4. Right-click the retargeted character and choose **Export Character...**, or
+ select its row and use that command in **File**.
+
+Up to **8 characters** can be imported per project. Each character can use a
+different source person. Check or uncheck its row to show or hide it; use
+**Remove Character** in its right-click menu to remove it from the project.
+Character data and assigned motion are saved inside the project.
+
+Characters are drawn in front of the SMPL source meshes, with **Bone Overlay**
+above both. **Name** shows the list name above each visible person or character,
+including characters still in their rest pose. Names stay upright and the same
+screen size; crowded labels are separated. These controls change the preview only.
+
+Retargeting uses the selected source motion and its applied contact timings.
+**Apply Correction** also refreshes characters linked to the corrected source,
+including hidden characters. After other source changes, run **Retarget** again.
+A character marked **Needs retarget** must be updated before export.
+Unreachable hand/foot targets
+are not solved by stretching bones. Large differences in body proportions may
+require further editing in animation software. Travel distance can differ from
+the source because motion is scaled to the target character's leg length;
+shorter-legged characters may cover less ground, and longer-legged characters
+may cover more. Source contact timings are retained.
+
+Only mapped body/finger bones and necessary body helpers receive animation;
+the armature object stays unkeyed.
+Hair, clothing and secondary physics are not simulated.
+
+| Export option | Result |
+| --- | --- |
+| **FBX + Include character mesh** | Character mesh, skeleton and animation. |
+| **FBX, mesh unchecked** | Skeleton and animation only. |
+| **VMD (PMX characters only)** | Body/finger motion sampled at 30 fps for the same PMX model in MMD. Facial animation and physics are not generated. |
+
+Separate takes produce separate files. Both FBX options preserve the imported
+character's original bone hierarchy and rest pose separately from its animation;
+the first animation frame does not replace the rest pose. Existing retargeted
+characters can be exported again to use the corrected FBX rest-pose handling.
+
+Known humanoid mappings are automatic; custom bone mapping is not yet available.
+Files missing required body bones are rejected with a message. The viewport shows
+base-color textures at their original resolution, with simplified lighting rather
+than a full material/physics renderer. Existing characters prepare a texture cache
+in the background on first display; reimporting or retargeting is not required.
+Textures are reused during playback. Oversized textures produce a clear error
+instead of being silently reduced in resolution.
+
+### Included Blender runtime
+
+`install.cmd` installs a separate **Blender 4.5 LTS** runtime in
+`runtime_character`. It runs in the background to import characters, evaluate rig
+constraints, bake bone animation and export character FBX/VMD files. You do not
+need to install or open Blender separately after running `install.cmd`. Keep this
+folder with the app.
+
+RGB MoCap performs the retargeting/contact calculations and viewport playback.
+The Blender backend also provides a foundation for future format support and
+animation-processing features; these are possibilities, not additional features
+currently provided by the app. Hair/clothing physics remains unsupported.
+
+The Git checkout does not include Blender binaries. `install.cmd` downloads the
+pinned Blender runtime automatically. Development runs may set
+`RGBMOCAP_BLENDER` to a compatible `blender.exe`; see [Build from source](BUILD.md).
+Blender retains its GPL license and bundled notices; see [Third-party notices](../THIRD_PARTY_NOTICES.md).
+
+## Install
+
+**Tested configuration:** NVIDIA GeForce RTX 5090 (32 GB VRAM), AMD Ryzen 9
+9950X, 96 GB RAM, Windows 11 Pro (64-bit). This is the tested configuration,
+not a minimum specification. Other GPUs, drivers and clean Windows installations
+have not yet been verified; compatibility reports are welcome.
+
+1. Install [Git for Windows](https://git-scm.com/download/win). Open **Command
+ Prompt** in a writable folder, then run:
+
+ ```cmd
+ git clone https://github.com/toyxyz/toyxyz_RGBMocap.git
+ cd toyxyz_RGBMocap
+ ```
+
+ Avoid protected folders such as Program Files. The commands below are for
+ Command Prompt; in PowerShell, prefix each `.cmd` filename with `.\`.
+2. Run `install.cmd` with an internet connection. It downloads and verifies
+ pinned Python environments, Blender 4.5.0, FFmpeg 7.1.1 and small upstream
+ support files, and installs the included prebuilt motion-correction module.
+ It prepares all three single-video model runtimes and their supported add-ons
+ together, not only the currently selected model. The AI runtimes remain
+ separate; model weights/body data are not included. Downloads and free disk
+ space are needed, and the install can take time.
+3. Run `RGBMoCap.cmd`. Keep its console open while the GUI runs; launch errors
+ and exit codes are displayed there. Processing messages and app **Console** output
+ are also sent there, but very long or high-volume output can be truncated or
+ dropped. Use **Help > Check System** if needed.
+4. In **Model Manager**, download or import the selected AI model files. Some
+ models require registration and agreement to their provider's terms and must
+ be downloaded manually.
+
+**For MAMMA multi-video capture**, complete those steps, install Visual Studio
+2022 C++ Build Tools with a Windows SDK and NVIDIA CUDA Toolkit 12.8, then close
+the app and run:
+
+```cmd
+Setup_MAMMA.cmd
+```
+
+Review the restricted-use license prompt before accepting. Reopen the app,
+select **MAMMA**, and prepare its files in **Model Manager**. Its **Runtime
+Setup...** button shows readiness and setup instructions. The optional runtime
+is not installed by `install.cmd` or `update.cmd`; the other three models do not
+need it. Follow the [MAMMA installation and model checklist](MAMMA.md) for exact
+prerequisites, the locked-head body models and multi-video requirements.
+
+To update, close RGB MoCap and run `update.cmd` in the repository folder. It
+refuses to overwrite tracked local edits, requires the `main` branch, pulls only
+fast-forward changes and checks the runtimes. Back up or commit local changes
+before updating. A direct `git pull` updates source only; close the app first,
+and run `install.cmd` if dependencies change. The launcher will ask for setup if
+it detects an incomplete update or a dependency mismatch.
+
+If a download or installation fails, read the console message, check the internet
+connection and free disk space, and rerun `install.cmd`. A completed download may
+be reused. Do not delete `models`, `projects` or the remaining `.setup` state to
+retry. If Git reports a conflict or local changes, resolve or back them up before
+running `update.cmd` again.
+
+On the tested PC, a separate-folder first install took about 10 min 32 sec with
+previously verified package downloads reused; Blender and FFmpeg were downloaded.
+A subsequent code update and runtime verification took about 1 min 55 sec. These
+are single local tests, not estimates for a download with an empty cache or for
+other PCs; connection speed and storage performance affect the time.
+
+Allow at least **32.4 GiB free** for first-time runtime installation before
+models; this includes temporary installation space. The installed app, runtimes
+and the three single-video models with their add-ons total roughly
+**42 GiB (45 GB)**, including about
+29 GiB of model files. Download
+caches, videos, projects, characters and exports require additional space, and
+actual sizes can vary. These totals cover the three single-video models.
+MAMMA adds 6.19 GiB of runtime on the test PC and 3.42 GiB of model assets if
+VGGT-Omega is already installed, or 7.69 GiB of model assets including VGGT.
+Its setup needs about 18 GiB free before models, plus separately installed
+C++/CUDA compiler tools. See [MAMMA](MAMMA.md) for measured installation details.
+No clean-Windows or other-GPU test is claimed.
+
+## Storage and cleanup
+
+In the installed app, `<install folder>` means the folder containing
+`RGBMoCap.cmd`. Close RGB MoCap and any installation or update before deleting files. Use **File →
+Open Project Folder** to locate the current project; a **Save Project As** copy
+may be outside the installation folder.
+
+| Location | What you can remove and what happens |
+| --- | --- |
+| `<install folder>\cache\` | Its contents can be deleted. This includes `huggingface`, `torch` and ExMR support caches. They are recreated or downloaded again when needed; the next run may take longer and require internet access. Saved projects and the separate `models` library remain. |
+| `<install folder>\projects\<project folder>\` | Delete an entire unwanted project folder. This removes its model results, prepared videos, previews, contact edits and imported/retargeted characters. Reprocessing requires the source video and AI inference; manual edits are lost. Keep projects you still need. |
+| Your **Save Project As** destination | The same rule applies to each saved project folder at your chosen location. It contains a copy of the video and project data. Deleting it removes that copy; cleaning the default `projects` folder does not clean external copies. |
+| `<install folder>\character_scenes\<session folder>\` | Contains characters imported before a project was opened. Old session folders can be deleted once those imports are no longer needed or have been copied into a saved project. Unsaved session imports are lost. |
+| `<install folder>\.setup\downloads\`, `.setup\uv-cache\` and `.setup\tmp\` | Downloaded wheels and temporary cache can be removed only after installation or update completes. They are reused for repair and updates; deleting them may require downloading files again. Keep the rest of `.setup`, including the private Python and installation state. |
+| `<install folder>\.setup\mamma-downloads\` | Optional MAMMA package/source download cache. Its contents can be removed after MAMMA setup finishes; repair may need to download them again. Keep `runtime_mamma` and `.setup/mamma-runtime.json`. |
+
+Repeated work mainly grows project data: each model has its own result folder.
+Inside `exmr`, `flowhmr` or `gvhmr`, different processing ranges can add `clips`
+subfolders. MAMMA keeps immutable `inference/<generation>` and
+`results/<generation>` folders instead. Character imports/retargeting add
+character data. These are saved work, not just
+disposable caches. Do not delete individual model folders, `characters`, motion
+tensors, preview files or receipt files from a project you want to keep; its
+metadata can still reference them. Export or back up needed work, then remove an
+unwanted project as a whole. Exported FBX/VMD files in other folders must be
+managed separately.
+
+Keep `models`, `runtime*`, `mocap`, `third_party`, bundled assets and
+the remaining `.setup` repair files. Deleting these can remove required model
+files or break the app. Downloaded model archives stored elsewhere can be removed after a successful installation/import if you do not
+need an offline copy; keep a backup of manually acquired restricted models.
+
+## Start here
+
+For ExMR, FlowHMR and GVHMR:
+
+1. Choose an **AI Motion Model**, then **File → Open Video**, or drop a video
+ into the workspace.
+2. Optionally trim the timeline's **Video** track by dragging its ends.
+3. Use **Model Manager** to prepare the selected model's files.
+4. For several people, use **Find person** and check who to reconstruct.
+5. Click **Reconstruct 3D**. Review the video, mesh and **Bone Overlay** together.
+6. Adjust correction settings or contact timings, then click **Apply Correction**.
+7. **File → Export FBX** saves the displayed, applied animation.
+
+For synchronized multi-camera capture, select MAMMA before opening videos and
+follow the [MAMMA workflow](MAMMA.md#reconstruct-and-export). It detects people
+during reconstruction, so the **Find person** step is not used.
+
+To animate a character, follow [Character retargeting](#character-retargeting),
+then use **Export Character...** for FBX or, for PMX, VMD.
+
+**Open Project** restores saved results and settings. **Open Project Folder** opens
+their location. **Save Project As** (`Ctrl+Shift+S`) creates a new named project
+folder at your chosen location and switches to that copy. It includes the video,
+motion, people and contact edits for every model, including all MAMMA input videos
+when present. Open its `project.json` to return to it. Each project manages
+`exmr`, `gvhmr`, `flowhmr` and `mamma` result folders as needed. Selecting a model
+loads its saved motion; if it has no result, **Reconstruct 3D** creates its data in
+that folder. Result selections, contact edits and settings stay separate by model.
+New single-video processing ranges stay under that model's `clips` folder;
+MAMMA uses its own inference/result generation folders. The previous project
+folder format is not migrated; open the original video to create a new project.
+Model weights remain in the app's model
+library. Trimming does not modify the original video. Processing uses a
+30 fps working clip; camera sampling does not reduce its motion frame count.
+
+## Choose a model
+
+Each model has a [detailed guide](models/README.md): [ExMR](models/EXMR.md),
+[FlowHMR](models/FLOWHMR.md), [GVHMR](models/GVHMR.md) and [MAMMA](MAMMA.md).
+These cover required files, settings, defaults and workflow limitations.
+
+These quality comparisons are **subjective observations from our test videos**,
+not accuracy scores or a universal ranking. See the in-app **Model Guide** for
+recorded speed and memory measurements. New sessions start with **ExMR** selected;
+opening a project restores its saved model. **Prepare Preview**, below
+**Reconstruct 3D**, prepares existing motion without running inference again.
+
+| Model | Observed strengths | Finger animation |
+| --- | --- | --- |
+| **ExMR** | Generally fast, with good overall motion quality. | Included. |
+| **FlowHMR** | Slow, but the best overall motion quality in our tests. | Included. |
+| **GVHMR** | Lowest overall quality in our tests, but sometimes better for unusual poses such as backflips. | Optional **HandFlow**; not inferred by GVHMR itself. |
+| **MAMMA** | Multi-view capture of human motion and interactions. Needs separate setup and overlapping synchronized views; outside the single-video quality ranking above. | Included. |
+
+All four support contact correction, a 52-bone overlay and FBX export. The three
+single-video models use **Find person** for explicit people selection; MAMMA
+detects and matches people during reconstruction. The viewport shows the selected
+source mesh: SMPL-X for ExMR/GVHMR/MAMMA,
+SMPL-H for FlowHMR. The export skeleton follows that motion; source estimation
+errors can remain.
+
+### MAMMA multi-view reconstruction
+
+Select **MAMMA** before opening two or more synchronized fixed-camera videos.
+There is no fixed camera-count maximum; available RAM and VRAM determine
+practical capacity. Existing memory monitoring and OOM handling stay active.
+See [input requirements and remaining app limits](MAMMA.md).
+Camera thumbnails show four per row and switch the main preview without changing
+the common 30 fps timeline or trim. VGGT estimates cameras by default;
+**Import Camera Data...** accepts compatible JSON/MAMMA YAML calibration.
+Motion Correction defaults on, preserves original motion and supports the same
+contact editing and FBX workflow. **Save Project As** includes all camera videos.
+
+Run **Setup_MAMMA.cmd** separately after the base installation; Model Manager >
+**Runtime Setup...** explains its compiler prerequisites, disk use and restricted
+licenses. Prepare the nine model assets through Model Manager. MAMMA detects and
+matches people during reconstruction, so **Find person** is hidden. **People** can
+be Auto or a fixed count. Enter only the number in **Reference Height (m)**; this
+sets approximate VGGT scale and is unused with metric camera calibration.
+For example, enter `1.70` for 170 cm; it does not force all actors to the same
+height. Input videos must already start in sync and show the same performance.
+Read [MAMMA setup, input assumptions and limits](MAMMA.md) before reconstruction.
+The app uses SAM 2.1 and FP32 fitting; SAM 3.1 research tests remain separate.
+
+## Recorded processing time and VRAM
+
+Historical measurements on the tested PC above (30 fps inputs, October 2026),
+recorded before the current Git-based installation was tested.
+Each duration uses the same input across all three models.
+
+| Video length | Model | Processing time | Peak VRAM (GiB) |
+| --- | --- | ---: | ---: |
+| 7 seconds | ExMR | 1m 08s | 11.32 |
+| 7 seconds | FlowHMR | 2m 49s | 14.89 |
+| 7 seconds | GVHMR | 2m 01s | 5.08 |
+| 15 seconds | ExMR | 1m 47s | 11.32 |
+| 15 seconds | FlowHMR | 5m 16s | 10.79 |
+| 15 seconds | GVHMR | 2m 45s | 5.08 |
+| 25.7 seconds | ExMR | 1m 44s | 11.32 |
+| 25.7 seconds | FlowHMR | 7m 32s | 10.67 |
+| 25.7 seconds | GVHMR | 3m 00s | 5.08 |
+
+Times cover the recorded model-processing stages, excluding shared person
+tracking, app contact correction and preview/export. GVHMR includes HTD, FootMR
+and HandFlow. FlowHMR includes camera estimation and the original SAM path;
+these timings predate Fast SAM. VRAM is peak PyTorch **allocated** memory across
+workers, not total GPU usage or reserved memory. These are individual test runs,
+not minimum hardware requirements or predictions for every video. Resolution,
+camera motion, settings and available memory also affect results; a longer
+video does not always use more VRAM or take proportionally longer.
+
+## Prepare models
+
+**Model Manager** lists files for the selected tool and its add-ons.
+
+| Action | Meaning |
+| --- | --- |
+| **Auto Download / Download All** | Download supported missing public files; completed files are kept if you cancel or retry. |
+| **Manual Download...** | Show the exact file, provider link and download instructions. Use for files requiring registration or access approval. |
+| **Import...** | Validate and register a file you already downloaded. |
+
+Automatic downloads can fail, especially for files hosted on **Google Drive**.
+If a download fails, use **Manual Download...** on that model's row, open the
+provided link in your browser and download the exact file listed in the
+instructions. Use **Import...** directly in the manual download window, or on
+the same model row, to select the downloaded file. The instructions can stay
+open while you download and import. If it comes in an archive, extract the
+required file first. Import checks
+the file and places it in the correct model folder; check that the row is ready
+before reconstructing.
+
+Some models **do not support automatic download** because their providers
+require account registration, access approval and/or acceptance of license terms
+before downloading. This is separate from a temporary download failure. Use
+**Manual Download...** to visit the provider's site, complete its requirements
+in your browser, download the required file, then use **Import...** on the
+matching row. The app cannot complete these steps on your behalf.
+
+Registered body/hand models must be obtained under their provider's terms.
+Follow the manager's exact file instructions; model families are not interchangeable.
+The app does not need your provider password or access token.
+
+| Used by | Registered or access-controlled files |
+| --- | --- |
+| ExMR / GVHMR | [SMPL-X v1.1 neutral](https://smpl-x.is.tue.mpg.de/download.php): import `models/smplx/SMPLX_NEUTRAL.npz` from the downloaded archive. The app stores it under `models/body_models/smplx/`. |
+| FlowHMR | [AMASS SMPL-H neutral](https://mano.is.tue.mpg.de/download.php): Extended SMPL+H model, `smplh/neutral/model.npz` (16 shape components). |
+| 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 | [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
+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.
+
+### Reuse models in a new installation
+
+After installing the app in a new location, close both copies of the app and
+copy the **entire `models` folder** from the old installation into the new
+installation folder, beside the new **RGBMoCap.cmd**:
+
+```text
+Old installation/models/ → New installation/models/
+```
+
+For example, copy `D:\RGBMoCap-Old\models` into `E:\RGBMoCap` so the result is
+`E:\RGBMoCap\models`, not `E:\RGBMoCap\models\models`. Keep all subfolders,
+configuration files, `.receipt.json` files and license files together. Copy
+first and keep the old files until the new installation works.
+
+Open the new app and check **Model Manager** for each model you use. If a copied
+file is not marked ready, use **Import...** on its row and select that file
+from the copied folder to validate it again. Copying can change file timestamps,
+and newer releases may require a different model version; follow the row's
+**Manual Download...** instructions if validation fails.
+
+Let `install.cmd` create the new runtime folders; do not copy the old `runtime*`
+folders over them. The `models` folder contains model files only. Saved work
+is in separate project folders, which can be copied separately and opened
+with **File → Open Project**.
+
+## Model and processing settings
+
+Changes to camera, smoothing or feature settings take effect on **Reconstruct 3D**.
+GVHMR refinement checkboxes also select saved preview/export results. If the
+selected result is missing, reconstruct it; the app reports it as unavailable.
+
+| Setting | Function and when to use it |
+| --- | --- |
+| **ExMR → Camera** | Static Camera for a camera that stays still without zooming; Moving Camera / SimpleVO when it moves. |
+| **ExMR → Smooth Motion** | Reduce small changes between frames. Off keeps the unsmoothed result. |
+| **FlowHMR → Fast SAM** | Speed up body/hand image processing with the same model files. Small numerical differences can affect motion and automatic contacts. |
+| **FlowHMR → Camera / Sampling** | Start with Moving / Unknown - Auto for moving or uncertain cameras. Static Camera skips camera estimation for locked footage. Explicit frame intervals control camera analysis only; denser sampling uses more memory. |
+| **GVHMR → HTD Refine** | Improve body-motion consistency over time. Runs before FootMR when both are enabled. |
+| **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 → 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. |
+| **Resource Mode** | For supported single-video stages, Automatic balances throughput and memory; Low Memory uses smaller image batches. MAMMA keeps its pinned processing settings and shared memory protections. |
+| **Prepare Preview** | Rebuild mesh/skeleton previews from existing motion without running the AI model again. Useful for older projects. |
+| **Cancel Job** | Stop queued processing; completed results are kept. |
+
+Processing shows the current step, progress and elapsed time. **Step left** estimates
+the current step; **Total left** estimates the queue when timing data is available.
+Use **Console** for details and errors. Loading or unmeasured work shows activity
+instead of an invented percentage. FlowHMR is limited to 5,000 frames per take
+(about 166.7 seconds); available memory may require a shorter clip. MAMMA's
+adapter accepts 4–1,800 common frames and at most eight people. It requires
+two or more synchronized fixed-camera videos, with no fixed camera-count
+maximum. Four thumbnails per row is only a layout choice. These limits do not
+guarantee that a workload fits RAM or VRAM.
+
+Processing is allowed to start without a predicted RAM/VRAM minimum. While it
+runs, the app monitors actual available RAM and Windows allocation headroom.
+If either becomes low, it stops the processing job and shows the available memory
+in the error message. The app also reports actual CPU/GPU allocation failures.
+Completed stages are retained for retry. Low Memory can reduce supported batch
+sizes, but cannot guarantee that every model or video fits. A sudden large
+allocation can still fail before the next monitor check.
+
+GPU allocator budgets use ComfyUI's external-use margin: 600 MiB on Windows,
+or 700 MiB on GPUs larger than 15 GiB, subtracted from currently free VRAM.
+All four model paths use this rule; FlowHMR/ExMR no longer subtract fixed
+3/2 GiB or impose an additional 95/90% ceiling. Inference working memory is
+part of the allowed budget. This is not a guarantee of free VRAM: other apps
+and allocations outside PyTorch can still consume it.
+
+## Motion Correction
+
+Contact correction reduces sliding when feet or palms rest on a support. It uses
+existing motion without rerunning AI inference. Original and corrected results
+are kept separately. Enable Correction and Foot default on for new work; Hand
+defaults off. Existing projects retain saved selections.
+
+| Setting | Function and meaning |
+| --- | --- |
+| **Enable Correction** | Show the corrected result; off shows the uncorrected result. |
+| **Correction Mode → Flat Ground** | Use one correction floor for level ground. |
+| **Correction Mode → Multi Level** | Keep contacts at their inferred heights for stairs, slopes and changing levels. The single floor controls are inactive. Terrain geometry is not reconstructed. |
+| **Foot / Hand** | Correct only checked contact types. Disabling one retains its saved timing edits. Hand correction adjusts the arm for support contacts while retaining hand orientation. |
+| **Lock Preset** | Weak allows more original movement; Normal balances holding and smooth transitions; Strong holds more uncertain contacts and may resist intentional sliding. |
+| **Auto Floor Height** | Estimate the contact floor. Turn off to enter a manual height. |
+| **Floor Height (World Y)** | Floor height in metres along the vertical axis. Higher values raise the correction floor; the gray reference grid stays at zero. |
+| **Pelvis Height Offset (from Auto)** | Zero keeps automatic hip adjustment. Positive values undo some automatic lowering; negative values lower the hips further during contact. Raising can weaken foot locks. |
+| **Apply Correction** | Commit current settings and timeline timings, update the source preview/export, and recalculate linked characters. |
+
+Edit **L foot / R foot / L hand / R hand** tracks below the video track. Drag empty
+space to add an interval, drag it to move, or drag its edges to resize. Delete
+removes a selected interval; Ctrl+Z / Ctrl+Y undo/redo. **Reset Locks** restores
+automatic timings. The timeline's **?** has full editing instructions.
+
+Apply pending changes before export; stale corrected export is blocked. Automatic
+hand detection is intended for stable support such as a floor, or raised supports
+in Multi Level. Inspect its timing. Hanging poses, object interaction and larger
+animation edits are best handled in a 3D animation editor. Contact detection is
+an estimate and can leave residual sliding or penetration.
+
+## People, preview and navigation
+
+| Control | Function |
+| --- | --- |
+| **Find person** | For single-video models, discover people for explicit selection. Without it, tracking selects one person and may switch identity during overlap. MAMMA instead detects and matches people during reconstruction; this button is hidden. |
+| **People checkboxes / selected row** | Checked rows control visibility and single-video reconstruction targets. MAMMA reconstructs its detected/requested people together. The selected row controls timeline and contact editing. |
+| **Character checkboxes / selected row** | Show or hide imported characters independently of source people. Select a character to export it; right-click it for Retarget, Export Character or Remove Character. |
+| **People → ?** | Open instructions for people selection, names, colors and takes. The list footer shows only current status or warnings. |
+| **Rename... / color square** | Right-click a row to rename it; click its square to change display color. The name is also used for FBX filenames and rig names. |
+| **Take selector** | Choose a visible section when a person leaves and reappears. Long unseen gaps are separate takes. |
+| **Overlays / Bone Overlay** | Show video observations / source export bones. Bone Overlay is drawn above source meshes and imported characters. Display only. |
+| **View direction / Frame All** | Choose a camera direction / fit visible people in the 3D view. Left drag orbits, middle/right drag pans, wheel zooms. |
+| **Floor Grid / Correction Floor** | Show the gray zero-height reference grid / orange correction floor preview. Neither applies correction. |
+| **Motion Path / Follow Actor** | Show the person's path / move the viewing camera with the person. |
+| **Lock** | Show active hand/foot contacts as translucent horizontal discs in timeline colors. Hand discs are at palm height, including raised supports. Display only. |
+| **Name** | Show list names above visible people and imported characters. Text stays upright and the same screen size as you move the camera. Rename a person from the list's right-click menu. |
+| **Timeline ruler / blue frame box** | Click or drag to seek. Track editing does not seek. Wheel zooms; middle drag or Shift+wheel pans. |
+| **Playback / frame number / speed** | Space plays/pauses; arrows step one frame, Shift+arrows one second. Enter a frame number to jump. Playback speed affects preview only. |
+| **Timeline Frame All / Reset Trim** | Fit the full timeline / restore the full clip range. |
+
+The single-video models process checked people independently; MAMMA fits its
+people together from the camera inputs. Results are shown in a shared scene.
+People share correction mode/floor; timings and pelvis offsets remain per person/take.
+Apply Correction updates all available takes, including hidden ones. Relative
+depth and contacts between people are estimates; collision avoidance is not provided.
+
+## FBX and Blender
+
+**File → Export FBX** follows the displayed, applied result. Each checked
+person/take gets a separate named file and rig; duplicate filenames get suffixes.
+People exports use the viewport's shared placement. Takes retain their own frame
+counts; align their start times when combining different source intervals.
+
+Source-person exports use a 52-bone hierarchy with **Hips** as root and plain
+anatomical names. It retains
+actor lengths, SMPL-neutral curved limbs/feet, calibrated rest axes and straight
+open fingers. FBX stores rest transforms separately; no T-pose frame is inserted.
+BVH is internal compatibility data only.
+
+**Export Character...** preserves the imported target character's own hierarchy
+and original rest pose; it does not replace them with the 52-bone source rig.
+Character FBX animation is stored on bones, with no armature-object keyframes.
+
+In Blender use **Scale 1**, **Automatic Bone Orientation off**, **Use Pre/Post
+Rotation on**, **Ignore Leaf Bones on** and **Animation Offset 1**. The file supplies
+frame rate and axes. **Armature Data → Rest Position** shows the rest pose.
+The first frame in **Pose Position** shows animation, which can differ from rest.
+Use the character workflow above for supported humanoids, or retarget the source
+FBX in your animation software.
+
+## Development and license
+
+See [Build from source](BUILD.md) for environment setup, editing and release builds.
+Original RGB MoCap code/documentation uses the [MIT License](../LICENSE).
+Third-party code, derived modifications, weights and body data keep their own
+terms; see [Third-party notices](../THIRD_PARTY_NOTICES.md).
diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md
index bcb02a9..e29c498 100644
--- a/docs/VALIDATION.md
+++ b/docs/VALIDATION.md
@@ -171,7 +171,229 @@ interactive playback, standalone MMD playback or testing on other GPUs.
passed. This is a single-PC regression check, not a low-memory hardware test or
a guarantee against sudden allocations or competing GPU applications.
+MAMMA multi-view input setup (2026-10-29):
+
+- Five real camera videos opened through the multi-select picker and produced a
+ four-column thumbnail grid with a second row. Ten preview-camera switches kept
+ the frame, trim, 3D camera and one persistent decoder; sampled switch latency
+ was approximately 0.03–0.21 seconds on cached local files. The short sequence
+ showed no net thread/handle increase; this is not a long-run leak guarantee.
+- Real 25 fps / 60 fps videos shared a 30 fps timeline limited by the shorter
+ input. At timeline frame 45 (zero-based, 1.5 seconds), native requests were 38
+ and 90. Playback and resume after switching were exercised in the Qt event
+ loop; this was not a visible full-app GPU FPS measurement or a VFR test.
+- The actual Save Project As worker copied every input, restored common trim,
+ active camera, manual calibration and correction selection, and saved a second
+ portable project copy. Reopening in another tool and returning to MAMMA also
+ recovered the saved inputs. Eight rapid replacement requests coalesced to the
+ latest set, and saving was blocked during input preparation.
+- JSON and MAMMA YAML camera imports were checked, including camera-to-world
+ quaternion conversion against matching world-to-camera matrices. Invalid
+ rotations/intrinsics and missing files retained previous valid inputs/settings.
+ Existing three-model controls and single-video decoding were checked.
+- These initial checks covered input setup only. Later native-pipeline checks
+ below extend their scope; they do not validate fresh-user installation.
+ Original videos and motion data were not modified. Private test files remain
+ outside the public checkout.
+
+MAMMA native app pipeline (2026-10-29, same tested PC):
+
+- The GUI Reconstruct 3D queue completed SAM 2.1 segmentation, exact-ROI FP32
+ landmarks, VGGT cameras, full FP32 MAMMA fitting, native actor conversion,
+ shared-floor correction and source export preparation. Two synchronized views,
+ two people and 30 frames (one second) took 299.50 seconds including worker
+ startup and native preparation. A verified repeat reused inference in 14.48
+ seconds and retained the raw fitted file's timestamp and size.
+- Recorded PyTorch peak allocated/reserved VRAM (GiB) was 2.532/2.846 for masks,
+ 0.585/0.645 for landmarks, 6.097/6.121 for cameras and 0.315/0.352 for fitting.
+ The largest process peak working set was 8.928 GiB in camera estimation.
+ These are process/allocator observations, not whole-PC or driver VRAM totals,
+ minimum requirements, or measurements for a long clip.
+- Exact sixteen-beta conversion matched original fitted meshes within 0.001 mm.
+ Original and corrected previews for two different body templates rendered
+ together on the real GPU. Readback against the CPU skin reference at three
+ frames differed by at most 0.002 mm. Twenty-four visibility changes retained
+ constant sampled handle/thread/GPU-buffer counts; sampled RSS changed about
+ 0.04 MiB after warm-up. This is not a long-run leak guarantee.
+- Camera switching and six original/corrected transitions preserved the selected
+ frame and 3D camera. In a three-second playback check, the GUI event-loop gap
+ p95 was 9.57 ms and maximum 15.64 ms. These are event-loop gaps, not rendered
+ frame times or a universal FPS claim. Original GPU images were inspected.
+- Save Project As/reopen retained both actors and both working camera previews
+ with the original project temporarily offline. Manual lock edits blocked stale
+ export; Apply Correction refreshed both actors in 15.85 seconds without
+ changing either original source tensor. Incomplete publication, changed input
+ receipts and invalid saved settings were rejected. Removing a required cached
+ landmark rejected the cache and allocated a separate attempt. Missing
+ project-private body data was regenerated from the unchanged raw fit in
+ 16.31 seconds without rerunning inference.
+- Four real source FBX exports (two people, original/corrected) imported through
+ ordinary Blender 4.5 settings with 52 Hips-root bones and no armature-object
+ keys. Maximum imported bone-head difference was 0.0034 mm. Retargeted-character
+ output and manual-camera end-to-end inference were not tested in this pass.
+- Model Manager imports were registered locally with expected SHA-256 receipts.
+ No registered weights, external MAMMA engine, body-derived assets, videos or
+ private tests were added to the publishable checkout. See [MAMMA](MAMMA.md)
+ for its separate-environment limitation; this is not a clean-install or
+ other-GPU validation, nor a validation of the 60-second adapter limit.
+
+Managed CMD startup after MAMMA routing changes (2026-10-29):
+
+- Reviewed unchanged dependency pins and refreshed the installer lock's registry
+ hash. The standard managed installation worker verified and reused all six
+ installed profiles without runtime downloads or replacement. It refreshed the
+ installed verification state; startup checks were not bypassed.
+- Actual RGBMoCap.cmd startup and its child-worker environment check passed.
+ A MAMMA project then opened through that same launcher and played two people
+ for three seconds without render errors or observed video/mesh frame mismatch.
+- Source composition validation now rejects a runtime registry hash that differs
+ from the installer lock. A private fixture confirmed both valid acceptance and
+ mismatched-lock rejection; private files remain outside the checkout.
+
These checks describe the recorded examples, not a guarantee for every video,
character or computer. Model weights and registered body data remain separate and
subject to their providers' terms. Review the applicable third-party notices and
corresponding source/build requirements before redistributing binaries.
+
+MAMMA supported optional runtime and UI (2026-10-29, same Windows/RTX 5090 PC):
+
+- A new isolated Python 3.11.17 / torch 2.7.1+cu128 runtime was installed from
+ SHA-256 pinned package/source archives, without copying the research venv.
+ SAM 2 and SDF were compiled locally. 176 package versions and 41,138 runtime
+ files were checked; deliberately pruned debug/developer files were excluded.
+ Actual runtime size: 6.19 GiB, excluding model weights and compiler tools.
+ Re-running setup reused the verified runtime without downloading/rebuilding.
+- CUDA SAM connected components and SDF distance, index width, winding and point
+ gradients passed. SDF squared-distance max error: 1.21e-8; gradient error: 0.
+ Restricted upstream code/native binaries remain outside this repository.
+- Fresh two-view, two-person, 30-frame processing completed in 297.55 s through
+ correction/preview. Peak PyTorch allocated/reserved memory was 6.10/6.12 GiB;
+ Windows process peak working set was 8.93 GiB. These are different measures
+ from whole-board VRAM or total system use. On the same working inputs, all
+ compared landmarks, visibility/contact predictions, fitted poses, betas and
+ translations matched the previous research engine exactly (maximum 0).
+- Original native vertices matched fitted MAMMA vertices within 0.001 mm.
+ Four source FBX files imported in Blender 4.5 with 52 Hips-root bones and no
+ armature-object animation; max sampled bone-head error was 0.0034 mm.
+- Height is numeric-only with a separate metre label; People has a separate
+ label, and MAMMA hides Find person. Nine model assets, runtime readiness/setup
+ instructions, other models' button restoration and the model guide were checked.
+- Fixed asynchronous thumbnail restoration capturing a temporary default 3D
+ camera. Fresh projects without a saved view framed both actors; saved camera
+ target/distance were preserved on reopen. One earlier direct-GUI reopen timed
+ out; subsequent fresh/saved-camera checks and CMD playback passed. This does
+ not establish long-duration reliability or performance on every project.
+- Actual RGBMoCap.cmd playback (4 s): 29.74 fps, frame interval p95 34.78 ms,
+ max 35.65 ms, video/3D and mesh/video frame differences 0; two actors and name
+ labels were visibly present, render errors absent, paused skin dispatches 0.
+- Setup failure injection retained the old pointer and model/project sentinels
+ and removed its failed staging directory. Unsafe archive aliases were rejected;
+ generated batch paths with Korean text, percent signs and shell punctuation
+ were checked. This is not a full non-ASCII compiler-install test.
+- User's separate manual three-view/413-frame log completed in 712.08 s without
+ fatal traceback or OOM. No clean-Windows, other-GPU, 60-second/eight-person
+ capacity, or newly retargeted-character test is claimed in this pass.
+
+MAMMA camera-count restriction removal (2026-10-30, same Windows PC):
+
+- Removed the GUI/worker four-view maximum and the input/calibration parser's
+ separate 64-camera ceiling. Reconstruction still requires at least two views;
+ duplicate names, calibration/size checks and bounded metadata files remain.
+ Existing clip/person limits were not changed.
+- Input, calibration, request and saved-media validation accepted 2, 4, 5, 8, 16,
+ 32 and 65 camera entries. Empty/duplicate inputs, a single-view reconstruction
+ and mismatched camera calibration were rejected.
+- The actual preparation worker decoded/resampled all 5, 16 and 65 test videos,
+ retaining 12 frames per view. Latest observed preparation times were 1.35,
+ 2.93 and 9.88 seconds. These were tiny synthetic 320x180 clips with repeated
+ content for input-count regression, not multi-camera reconstruction benchmarks.
+- Actual GUI widgets loaded 5, 16 and 65 thumbnails, selected the final camera
+ and retained the shared trim and timeline frame. The 65-view GUI request queued
+ all six reconstruction stages. Save Project As and actual GUI reopening
+ retained all 65 media references, calibration and the selected last camera.
+ No 3D render/playback performance claim is made from this hidden-window test.
+- Shared system-RAM/Windows allocation-headroom checks and CUDA allocator budgets
+ were unchanged. Low-memory observations triggered the existing guard. Injected
+ CUDA OutOfMemoryError and CPU MemoryError produced failed events and nonzero
+ worker results while preserving the existing project manifest. This was fault
+ injection, not deliberate exhaustion of system/GPU memory.
+- No new 5/16/32/65-view SAM, VGGT or complete MAMMA fitting run was performed.
+ Removing a fixed input-count ceiling is not a measured memory-capacity guarantee.
+ Private test scripts, synthetic media and logs remain outside the source checkout.
+
+Pre-publication regression audit (2026-10-30, same Windows 11 / RTX 5090 PC):
+
+- A separate source/runtime copy and local-only Git remote exercised the
+ pre-MAMMA-to-current update, `install.cmd` verification/reuse and actual
+ `RGBMoCap.cmd` startup before the optional MAMMA runtime was registered.
+ Model/project/cache sentinels survived. Tracked local edits blocked updating;
+ the application lock blocked a second launch. This reused installed pinned
+ runtime files; it was not a clean-Windows or fresh-download installation.
+- `Setup_MAMMA.cmd` accepted the license response, performed full package/native
+ CUDA verification and retained the verified runtime. Declining left it intact.
+ Injected setup failure retained the old pointer and user-data sentinels;
+ archive escapes were rejected. Fresh native compilation was not repeated in
+ this audit; its earlier build evidence remains recorded above.
+- Fresh ExMR, FlowHMR and GVHMR processing each used the same 60-frame real-video
+ segment. FlowHMR included VGGT and Fast SAM; GVHMR included HTD, FootMR and
+ HandFlow. Reconstruction, correction, preview preparation and source FBX
+ saves completed. MAMMA separately processed two synchronized views, 30 frames
+ and two people through new SAM 2.1 masks, landmarks, VGGT, fitting and publication.
+- Seven source FBX files were actually imported in Blender 4.5. All retained
+ 52 Hips-root bones and bone-only animation. Maximum sampled bone-head error
+ was below 0.008 mm. Character imports covered Mixamo FBX, VRM and a 797-bone
+ PMX; all four source models retargeted successfully. Eight character FBX
+ reimports covered mesh/motion-only options, original rest transforms and
+ sampled poses, with no armature-object or hair/clothing animation channels.
+ PMX VMD exports passed finite-channel/frame/structure checks; native MMD
+ playback was not repeated in this audit.
+- Fixed MAMMA preparation/publication failures incorrectly returning process
+ exit code zero. Both now emit failure and exit nonzero. Fixed retargeting's
+ MAMMA body selection; a real PMX retarget also passed while the separate
+ standard SMPL-X file was unavailable in the private test copy.
+- Real GUI checks covered all four scoped model managers, original/corrected
+ switching without frame/camera changes, manual contact editing, stale export
+ blocking, Apply Correction without inference, Save Project As/reopen and
+ MAMMA camera switching/private-body relocation. Eight project replacements
+ were sampled; this short test does not prove leak freedom. Cached switching
+ among three models in one project, GVHMR result variants, GUI character
+ import/retarget, linked-character refresh after correction and selected-row
+ character removal also completed.
+- Four-second actual CMD playback samples for each model measured 29.74 fps,
+ frame-interval p95 34.64–35.21 ms and maximum 35.28–36.74 ms. Video/3D and
+ mesh/video frame differences were zero; paused skin dispatches were zero.
+ These short clips on one PC are not long-video or cross-GPU guarantees.
+- A separate 797-bone PMX viewport check with two MAMMA source actors measured
+ 29.73 fps over four seconds (p95 36.44 ms, maximum 37.87 ms), with no character
+ renderer error. Two-second rest-pose and paused-animation observations each
+ recorded zero loader-change events and zero frame swaps. This specifically
+ checks the short/final-window repaint regression, not long-duration stability.
+- Test scripts, licensed inputs, runtime copies, logs and generated motion were
+ kept outside the publishable checkout. Main, user, per-model, build and agent
+ guides were checked against current controls, file requirements and limits.
+
+### Person-selection responsiveness (2026-10-30)
+
+A two-person MAMMA project's independent copy was switched six times before
+and after the GUI change. With profiling disabled, median synchronous selection
+time fell from 803 ms to 173 ms; selected-preview/video readiness fell from
+1,117 ms to 534 ms. The common scene, source frame and world camera were retained.
+An unchanged active camera was reopened zero times instead of twice per switch.
+The remaining selected-person preview loading still runs in the background.
+
+Nested control updates now validate readiness once at their synchronous outer
+boundary. Shared-floor checks reuse one read-only snapshot inside an individual
+GUI validation call, never across calls or threads. Export and later callbacks
+still check disk afresh. Tests confirmed that pending publication, changed floor
+receipts and unapplied manual contact edits block export after a preceding valid
+check. Manual contact editing, actor switching and Apply Correction completed
+without replacing inference. The live non-default camera choice was retained.
+Existing ExMR, FlowHMR and GVHMR cached original/corrected views also rendered.
+Video reuse checks file identity, FPS and timeline offset; changed inputs and
+decode failures reopen normally. These are short same-PC measurements, not
+long-recording or other-hardware guarantees. Test data remains outside source.
+
+Four-second CMD playback samples across the four models measured 29.74–29.82 fps,
+with frame-interval p95 34.71–35.04 ms and maxima 35.86–36.73 ms. Video/3D and
+mesh/video frame differences were zero. GVHMR finished one queued frame just
+after Stop; a separate settled two-second pause recorded zero skin dispatches.
diff --git a/docs/models/EXMR.md b/docs/models/EXMR.md
new file mode 100644
index 0000000..8db7faf
--- /dev/null
+++ b/docs/models/EXMR.md
@@ -0,0 +1,70 @@
+# ExMR
+
+[Original project](https://github.com/twehrbein/ExMR) · [All model guides](README.md)
+
+ExMR reconstructs SMPL-X body and finger motion from one video. It is the default
+model for new work. In this project's subjective tests it was generally fast
+with good motion quality; results depend on the footage and settings.
+
+## Prepare files
+
+Run the normal `install.cmd`; no separate ExMR setup command is needed.
+Select **ExMR > Model Manager** and prepare the listed files. Key assets are:
+
+| Asset | Location under the app's `models/` folder |
+| --- | --- |
+| ExMR weights | `exmr/exmr.safetensors` |
+| Sapiens2 pose weights | `exmr/sapiens2_1b_pose.safetensors` |
+| SMPL-X v1.1 neutral body | `body_models/smplx/SMPLX_NEUTRAL.npz` |
+| MANO right hand | `body_models/mano/MANO_RIGHT.pkl` |
+| Shared SAM 3D Body model, config and MHR | `flowhmr/sam/model.ckpt`, `flowhmr/sam/model_config.yaml`, `flowhmr/sam/assets/mhr_model.pt` |
+| HaMeR and hand mean | `handflow/hamer.ckpt`, `handflow/mano_mean_params.npz` |
+
+Model Manager also lists shared tracking dependencies. Use its exact supported
+files and import checks; do not substitute arbitrary checkpoint versions.
+Registered SMPL-X/MANO and gated SAM 3D Body files may require manual download.
+The shared `flowhmr` and `handflow` folder names do not mean you must run those
+models or enable GVHMR's HandFlow add-on. ExMR uses these assets directly.
+MAMMA's locked-head SMPL-X bodies are different files and cannot replace ExMR's
+standard body. See [model download and reuse](../USER_GUIDE.md#prepare-models).
+
+## Controls
+
+| Control | Default for new work | Meaning |
+| --- | --- | --- |
+| **Camera** | Static Camera | Use for a camera that stays still without zooming. Choose Moving Camera / SimpleVO when it moves. ExMR does not use FlowHMR's VGGT camera stage. |
+| **Smooth Motion** | On | Reduce small frame-to-frame changes; off preserves the unsmoothed result. |
+| **Resource Mode** | Automatic | Adapt supported work batches to available memory. Low Memory is a separate option. |
+
+Camera and smoothing changes take effect on **Reconstruct 3D**, not on
+**Apply Correction**. Existing projects retain saved settings.
+
+## Capture and export
+
+1. Select ExMR and use **File > Open Video**. Trim the **Video** track as needed.
+2. For explicit identity selection or several people, run **Find person** and
+ check who to process. The selected row controls preview and contact editing.
+3. Prepare models, choose camera settings and run **Reconstruct 3D**.
+4. Review the original and corrected motion. Edit foot/palm support intervals
+ and **Apply Correction** when needed. This reuses inference results.
+5. Use **File > Export FBX** for the displayed applied source motion, or
+ [import and retarget a character](../USER_GUIDE.md#character-retargeting).
+
+Processing uses a 30 fps working clip and preserves the source video. Saved
+results are under the project's `exmr/` folder. Switching models loads that
+model's own available results; it does not convert one model's inference into
+another's. **Save Project As** copies saved work to the selected location.
+
+## Limitations and resources
+
+Occlusion, motion blur, poor visibility and identity changes can produce wrong
+poses or fingers. Automatic contact detection can also miss intentional support;
+edit its timings rather than expecting correction to recover missing evidence.
+Contact correction is distinct from Smooth Motion and preserves original results.
+
+RAM/Windows allocation-headroom monitoring and the shared CUDA allocator budget
+remain active. Allocation failure stops the job with an error; shorten footage
+or free resources if necessary. Historical [processing/VRAM measurements](../USER_GUIDE.md#recorded-processing-time-and-vram)
+are individual runs, not minimum specifications. See [validation](../VALIDATION.md)
+for the tested PC and scope, and [licenses](../../THIRD_PARTY_NOTICES.md) for
+upstream restrictions.
diff --git a/docs/models/FLOWHMR.md b/docs/models/FLOWHMR.md
new file mode 100644
index 0000000..cecbef8
--- /dev/null
+++ b/docs/models/FLOWHMR.md
@@ -0,0 +1,70 @@
+# FlowHMR
+
+[Original project](https://github.com/flowhmr/flowhmr) · [All model guides](README.md)
+
+FlowHMR reconstructs SMPL-H body and finger motion from one video. In this
+project's subjective tests it was slower than ExMR but gave the best overall
+motion quality. This is not a universal accuracy ranking.
+
+## Prepare files
+
+Run the normal `install.cmd`, then select **FlowHMR > Model Manager**.
+Key assets are:
+
+| Asset | Location under the app's `models/` folder |
+| --- | --- |
+| Supported FlowHMR latest checkpoint and configuration | `flowhmr/flowhmr_latest.ckpt`, `flowhmr/config.yml` |
+| SAM 3D Body model, configuration and MHR | `flowhmr/sam/model.ckpt`, `flowhmr/sam/model_config.yaml`, `flowhmr/sam/assets/mhr_model.pt` |
+| AMASS SMPL-H neutral body, 16 shape components | `body_models/smplh/neutral/model.npz` |
+| VGGT-Omega 512, for camera estimation | `flowhmr/vggt_omega_1b_512.pt` |
+
+Model Manager also lists shared tracking dependencies. On the MANO/SMPL-H
+provider's site, follow the manager's instructions for the **Extended SMPL+H**
+model. A SMPL-X file cannot replace it. Gated models require the provider's
+registration/access steps; use **Manual Download... > Import...** for the exact
+file. The current checkpoint is `flowhmr_latest`, not an arbitrary base model.
+See [model preparation](../USER_GUIDE.md#prepare-models).
+
+## Controls
+
+| Control | Default for new work | Meaning |
+| --- | --- | --- |
+| **Fast SAM** | On | Speed up feature extraction using the same supported weights. Small numerical differences can affect motion or automatic contact timings. |
+| **Camera / Sampling** | Moving / Unknown - Auto | Automatically choose camera-estimation sampling when the camera moves or its behavior is uncertain. |
+| **Camera / Sampling > Static Camera** | Optional | Skip camera estimation for a fixed camera without zooming. This path does not require the VGGT weight. |
+| **Camera / Sampling > Every ... Frames** | Optional | Analyze the camera every 1, 2, 5, 10 or 30 frames. Denser camera sampling uses more memory. It does not reduce motion frame count. |
+| **Resource Mode** | Automatic | Adapt supported image batches to current memory; Low Memory is separately selectable. |
+
+These options apply on **Reconstruct 3D**. Fast SAM is an extraction option,
+not MAMMA's SAM 2.1 mask stage or the standalone SAM 3.1 experiments.
+
+## Capture and export
+
+1. Select FlowHMR and **File > Open Video**, then trim the **Video** track.
+2. Use **Find person** if you need explicit selection or several people. Check
+ processing targets; select a row to inspect its timeline and contacts.
+3. Prepare the required files and choose the camera option, then **Reconstruct 3D**.
+4. Review contact correction, edit timings and **Apply Correction** if needed.
+ Original motion is retained; applying contact changes does not rerun FlowHMR.
+5. Use **File > Export FBX** for the displayed applied motion, or
+ [retarget an imported character](../USER_GUIDE.md#character-retargeting).
+
+The working clip is 30 fps; the source video is preserved. The app supports up
+to **5,000 frames per take** (about 166.7 seconds at 30 fps), but available memory
+may require a shorter take. Results are kept under the project's `flowhmr/`
+folder. **Save Project As** copies saved work; switching models keeps their
+results separate.
+
+## Limitations and resources
+
+Camera estimation, occlusion and image features can introduce pose, trajectory
+or finger errors. A fixed-camera option cannot compensate for a camera that
+actually moves. Contact correction reduces supported-foot/palm sliding but does
+not repair bad camera geometry or identity swaps.
+
+The app retains RAM/Windows allocation-headroom monitoring, CUDA allocator
+budgets and allocation-error reporting. Camera analysis and long motion context
+can still exceed available memory. Historical [time/VRAM records](../USER_GUIDE.md#recorded-processing-time-and-vram)
+include camera estimation and predate Fast SAM; they are not predictions or
+minimum specifications. See [validation](../VALIDATION.md) and
+[upstream licenses](../../THIRD_PARTY_NOTICES.md).
diff --git a/docs/models/GVHMR.md b/docs/models/GVHMR.md
new file mode 100644
index 0000000..4eebab0
--- /dev/null
+++ b/docs/models/GVHMR.md
@@ -0,0 +1,75 @@
+# GVHMR
+
+[Original project](https://github.com/zju3dv/GVHMR) · [All model guides](README.md)
+
+GVHMR reconstructs SMPL-X body motion from one video. It does not infer fingers
+on its own; the app's optional HandFlow stage adds them. In this project's
+subjective tests overall quality was lower than ExMR/FlowHMR, but some unusual
+poses, including backflips, were better. Test your footage rather than treating
+that observation as a universal ranking.
+
+## Prepare files
+
+Run the normal `install.cmd`, then select **GVHMR > Model Manager**. Required
+rows depend on enabled add-ons; disabling an add-on skips its processing.
+
+| Stage | Key files under the app's `models/` folder |
+| --- | --- |
+| GVHMR body reconstruction | `gvhmr/gvhmr_siga24_release.ckpt`, `hmr2/epoch=10-step=25000.ckpt`, `vitpose/vitpose-h-multi-coco.pth` |
+| Registered body | `body_models/smplx/SMPLX_NEUTRAL.npz` (SMPL-X v1.1 neutral) |
+| HTD observations | `pvanet.pt` |
+| FootMR | `footmr/footmr_checkpoint.ckpt`, `vitpose/vitpose-h-wholebody.pth` |
+| HandFlow | HandFlow/HaMeR weights and configuration in `handflow/`, plus `body_models/mano/MANO_RIGHT.pkl` |
+
+Model Manager lists the exact shared tracking and add-on requirements. Use the
+supported versions and import checks. Standard SMPL-X v1.1 and MANO may require
+provider registration; MAMMA's locked-head bodies cannot replace this body.
+Automatic downloads, particularly Google Drive files, can fail; use the row's
+**Manual Download...** and **Import...** actions. See [model preparation](../USER_GUIDE.md#prepare-models).
+
+## Controls and result selection
+
+| Control | Default for new work | Meaning |
+| --- | --- | --- |
+| **HTD Refine** | On | Refine body motion using additional 2D observations. Runs before FootMR when both are enabled. |
+| **FootMR** | On | Refine ankle/foot orientation. This is not contact locking. |
+| **HandFlow** | On | Add finger motion while retaining the selected body and wrist motion. Requires its extra models. |
+| **Analyze 2D** | Separate action | Prepare refinement observations. Reconstruct 3D includes this work when needed. |
+| **Resource Mode** | Automatic | Select supported batch/attention behavior from available memory. Low Memory is separately selectable. |
+
+Saved original, HTD, FootMR and HTD+FootMR results remain distinct. The checkboxes
+also select the corresponding cached preview/export; they do not trigger fresh
+inference by themselves. HandFlow and contact correction remain associated with
+the selected base result. If a requested variant is missing or stale, reconstruct
+it; the app reports it as unavailable rather than substituting another variant.
+Existing projects retain their saved selections.
+
+## Capture and export
+
+1. Select GVHMR, open one video and trim its **Video** track.
+2. Optionally run **Find person** and check the people to process. The selected
+ row is the timeline/contact-edit target, independent of other visible people.
+3. Prepare models for enabled add-ons and run **Reconstruct 3D**.
+4. Review the selected result and correction. Foot contacts and palm support
+ are edited on the timeline; **Apply Correction** reuses inferred motion.
+5. **File > Export FBX** follows the displayed applied result, including its
+ enabled add-ons. [Character retargeting](../USER_GUIDE.md#character-retargeting)
+ uses that source motion and applied contact timings.
+
+Processing uses a 30 fps working clip without modifying the source video.
+Results are saved under the project's `gvhmr/` folder. Other models keep their
+own results; **Save Project As** copies saved work to the chosen location.
+
+## Limitations and resources
+
+FootMR does not guarantee ground contact; use Motion Correction for that.
+HandFlow can still make finger mistakes, and neither add-on fixes a wrong person
+or an unobserved pose. Correction retains original motion for comparison.
+
+RAM/Windows allocation-headroom monitoring, adaptive supported GPU work and
+allocation-error reporting stay active. Long-sequence context can still fail
+to fit; no option guarantees a particular duration on every PC. Historical
+[time/VRAM measurements](../USER_GUIDE.md#recorded-processing-time-and-vram)
+include HTD, FootMR and HandFlow and are individual observations, not minimum
+specifications. See [validation](../VALIDATION.md) and
+[licenses](../../THIRD_PARTY_NOTICES.md).
diff --git a/docs/models/README.md b/docs/models/README.md
new file mode 100644
index 0000000..6347851
--- /dev/null
+++ b/docs/models/README.md
@@ -0,0 +1,57 @@
+# AI model guides
+
+Choose a model in **AI Motion Model** before preparing its files or opening
+videos. ExMR is the default for new work; reopening a project restores its
+saved selection. Only implemented tools appear in the list.
+
+| Model | Input and body | Fingers | Detailed guide |
+| --- | --- | --- | --- |
+| ExMR | One video; SMPL-X | Included | [ExMR](EXMR.md) |
+| FlowHMR | One video; SMPL-H | Included | [FlowHMR](FLOWHMR.md) |
+| GVHMR | One video; SMPL-X | Optional HandFlow | [GVHMR](GVHMR.md) |
+| MAMMA | Two or more synchronized fixed-camera videos; SMPL-X | Included | [MAMMA](../MAMMA.md) |
+
+One-video input does not mean one-person output. ExMR, FlowHMR and GVHMR can
+process checked people independently after **Find person**. Without discovery,
+automatic tracking selects one person and may switch identity during overlap.
+MAMMA detects and matches people across views during reconstruction; its
+**Find person** button is hidden.
+For manual MAMMA cameras, see the [calibration format and JSON example](../MAMMA.md#manual-cameras).
+
+In this project's subjective tests, ExMR was generally fast with good quality;
+FlowHMR was slower with the best overall quality; GVHMR was less consistent
+overall but sometimes better for unusual poses such as backflips. These are
+not benchmark rankings. MAMMA is a separate multi-view workflow, not another
+entry in that single-video ranking.
+
+## Installation and shared workflow
+
+1. Run `install.cmd` in the app folder. It prepares the runtimes for all three
+ single-video models and their supported add-ons, Blender, FFmpeg and native
+ motion correction. It does **not** download AI weights or registered body data.
+2. For MAMMA, additionally follow [its runtime setup](../MAMMA.md#install-the-runtime).
+ `Setup_MAMMA.cmd` is separate from the base installation and update commands.
+3. Run `RGBMoCap.cmd`, select the model and use **Model Manager**. Follow each
+ row's exact download/import instructions. Some files require registration
+ and license acceptance; Google Drive downloads may need manual import.
+4. Open footage, trim, reconstruct and review. Contact correction defaults on;
+ Foot defaults on and Hand off. Edit contact timings and **Apply Correction**
+ without rerunning AI inference. Export the displayed applied motion as FBX.
+
+Model-specific settings affect reconstruction; they are separate from contact
+correction and display-only viewport controls. Original and corrected results
+are preserved. One project can hold separate results for each model. MAMMA saves
+all of its camera videos with **Save Project As**.
+
+Use **Resource Mode > Automatic** initially. Actual RAM/Windows allocation
+headroom monitoring, CUDA allocator budgets and allocation-error reporting remain
+active. More frames, pixels, people or views can increase work; no setting
+guarantees that every clip fits. Low Memory adjusts supported single-video
+batches; it does not select a reduced-view or lower-quality MAMMA preset.
+See [resources](../USER_GUIDE.md#model-and-processing-settings)
+and [measured validation scope](../VALIDATION.md).
+
+See the [user guide](../USER_GUIDE.md) for shared controls, contacts, retargeting,
+FBX/VMD export, storage and cleanup. For agent-assisted setup and diagnostics,
+use [the agent guide](../AGENT_GUIDE.md). Model code, weights and body data retain
+their own [licenses](../../THIRD_PARTY_NOTICES.md).
diff --git a/docs/samples/mamma-camera-example.json b/docs/samples/mamma-camera-example.json
new file mode 100644
index 0000000..f5263aa
--- /dev/null
+++ b/docs/samples/mamma-camera-example.json
@@ -0,0 +1,34 @@
+{
+ "units": "metres",
+ "extrinsics_convention": "world_to_camera",
+ "cameras": {
+ "A001": {
+ "intrinsic_matrix": [
+ [1000.0, 0.0, 960.0],
+ [0.0, 1000.0, 540.0],
+ [0.0, 0.0, 1.0]
+ ],
+ "extrinsics_matrix": [
+ [1.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, -1.0, 1.6],
+ [0.0, 1.0, 0.0, 4.0]
+ ],
+ "image_size": [1920, 1080],
+ "distortion_coeffs": [0.0, 0.0, 0.0, 0.0, 0.0]
+ },
+ "B001": {
+ "intrinsic_matrix": [
+ [1000.0, 0.0, 960.0],
+ [0.0, 1000.0, 540.0],
+ [0.0, 0.0, 1.0]
+ ],
+ "extrinsics_matrix": [
+ [0.0, 1.0, 0.0, 0.0],
+ [0.0, 0.0, -1.0, 1.6],
+ [-1.0, 0.0, 0.0, 4.0]
+ ],
+ "image_size": [1920, 1080],
+ "distortion_coeffs": [0.0, 0.0, 0.0, 0.0, 0.0]
+ }
+ }
+}
diff --git a/installer/mamma-runtime-lock.json b/installer/mamma-runtime-lock.json
new file mode 100644
index 0000000..80a21f2
--- /dev/null
+++ b/installer/mamma-runtime-lock.json
@@ -0,0 +1,1596 @@
+{
+ "version": 1,
+ "python": "3.11.17",
+ "sources": {
+ "mamma": {
+ "url": "https://codeload.github.com/cuevhv/mamma/zip/588492f18876e2ed6888b2d26929047cb6b575e7",
+ "sha256": "e3433deda3e0a9f552c9821f0a12ed924978ad03a05f6ea09c2730afbee3dd19",
+ "bytes": 5112319,
+ "commit": "588492f18876e2ed6888b2d26929047cb6b575e7",
+ "archive_root": "mamma-588492f18876e2ed6888b2d26929047cb6b575e7"
+ },
+ "sam2": {
+ "url": "https://codeload.github.com/facebookresearch/sam2/zip/2b90b9f5ceec907a1c18123530e92e794ad901a4",
+ "sha256": "fe93082a71a885a427894b1eab76341768781b6b58a298a0717e03862097d137",
+ "bytes": 55952852,
+ "commit": "2b90b9f5ceec907a1c18123530e92e794ad901a4",
+ "archive_root": "sam2-2b90b9f5ceec907a1c18123530e92e794ad901a4"
+ },
+ "sdf": {
+ "url": "https://codeload.github.com/cuevhv/pytorch_sdf/zip/58ff57b542a998e406327b94881bf6f7ce13a390",
+ "sha256": "04777500ae4db9139faf56dc4fe697292f720b028c95679d8f21409790410c5b",
+ "bytes": 1938543,
+ "commit": "58ff57b542a998e406327b94881bf6f7ce13a390",
+ "archive_root": "pytorch_sdf-58ff57b542a998e406327b94881bf6f7ce13a390"
+ }
+ },
+ "packages": [
+ {
+ "name": "aiohappyeyeballs",
+ "version": "2.7.1",
+ "url": "https://files.pythonhosted.org/packages/71/43/1947f06babed6b3f1d7f38b0c767f52df66bfb2bc10b468c4a7de9eceff2/aiohappyeyeballs-2.7.1-py3-none-any.whl",
+ "sha256": "9243213661e29250eb41368e5daa826fc017156c3b8a11440826b2e3ed376472",
+ "bytes": 15038,
+ "filename": "aiohappyeyeballs-2.7.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "aiohttp",
+ "version": "3.14.5",
+ "url": "https://files.pythonhosted.org/packages/0f/15/52b5e65f02b33686ae49f1518548ae4f5a7adaf31d9d3c54fa12a143137b/aiohttp-3.14.5-cp311-cp311-win_amd64.whl",
+ "sha256": "6f275c11d1aa6d4c458e05a68be084efe3c55a113d99e3f46a318098e52948fc",
+ "bytes": 512575,
+ "filename": "aiohttp-3.14.5-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "aiosignal",
+ "version": "1.4.0",
+ "url": "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl",
+ "sha256": "053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e",
+ "bytes": 7490,
+ "filename": "aiosignal-1.4.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "albucore",
+ "version": "0.0.23",
+ "url": "https://files.pythonhosted.org/packages/3d/de/4d9298befa6ae0f21230378f55100dca364816e3734028ca2766f2eca263/albucore-0.0.23-py3-none-any.whl",
+ "sha256": "99274ac0c15a1a7d9a726df9d54d5ab70d9d0c189e2a935399dba3d4bafad415",
+ "bytes": 14717,
+ "filename": "albucore-0.0.23-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "albumentations",
+ "version": "1.4.24",
+ "url": "https://files.pythonhosted.org/packages/af/ae/904b7bf58281d2bc1f3d6d48813bbcee742d1f8e3f9c0e1c451b0f67eb5a/albumentations-1.4.24-py3-none-any.whl",
+ "sha256": "2f639257a11e681071f4f7d10f6a6d874ae705bcce52746874cd8d7e317a16d7",
+ "bytes": 274921,
+ "filename": "albumentations-1.4.24-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "annotated-types",
+ "version": "0.8.0",
+ "url": "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl",
+ "sha256": "f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0",
+ "bytes": 13427,
+ "filename": "annotated_types-0.8.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "antlr4-python3-runtime",
+ "version": "4.9.3",
+ "url": "https://files.pythonhosted.org/packages/3e/38/7859ff46355f76f8d19459005ca000b6e7012f2f1ca597746cbcd1fbfe5e/antlr4-python3-runtime-4.9.3.tar.gz",
+ "sha256": "f224469b4168294902bb1efa80a8bf7855f24c99aef99cbefc1bcd3cce77881b",
+ "bytes": 117034,
+ "filename": "antlr4-python3-runtime-4.9.3.tar.gz",
+ "kind": "source"
+ },
+ {
+ "name": "anyio",
+ "version": "4.15.1",
+ "url": "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl",
+ "sha256": "6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101",
+ "bytes": 132079,
+ "filename": "anyio-4.15.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "asttokens",
+ "version": "3.0.2",
+ "url": "https://files.pythonhosted.org/packages/d4/2b/04b8a15f3a1c77bc79ddf5c73875327f34b4fa75982df2b76e45e402d364/asttokens-3.0.2-py3-none-any.whl",
+ "sha256": "9da13157f5b28becde0bd374fc677dcd3c290614264eff096f167c469cd9f933",
+ "bytes": 28702,
+ "filename": "asttokens-3.0.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "attrs",
+ "version": "26.1.0",
+ "url": "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl",
+ "sha256": "c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309",
+ "bytes": 67548,
+ "filename": "attrs-26.1.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "blinker",
+ "version": "1.9.0",
+ "url": "https://files.pythonhosted.org/packages/10/cb/f2ad4230dc2eb1a74edf38f1a38b9b52277f75bef262d8908e60d957e13c/blinker-1.9.0-py3-none-any.whl",
+ "sha256": "ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc",
+ "bytes": 8458,
+ "filename": "blinker-1.9.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "braceexpand",
+ "version": "0.1.7",
+ "url": "https://files.pythonhosted.org/packages/fa/93/e8c04e80e82391a6e51f218ca49720f64236bc824e92152a2633b74cf7ab/braceexpand-0.1.7-py2.py3-none-any.whl",
+ "sha256": "91332d53de7828103dcae5773fb43bc34950b0c8160e35e0f44c4427a3b85014",
+ "bytes": 5923,
+ "filename": "braceexpand-0.1.7-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "certifi",
+ "version": "2026.10.23",
+ "url": "https://files.pythonhosted.org/packages/32/d1/a3652fe2c19134d0d15922177821d863cbd7e842d53a21bbe7e8e3a1b5ac/certifi-2026.10.23-py3-none-any.whl",
+ "sha256": "e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1",
+ "bytes": 135082,
+ "filename": "certifi-2026.10.23-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "charset-normalizer",
+ "version": "3.5.2",
+ "url": "https://files.pythonhosted.org/packages/e8/fc/fdf8cf52ff21cd5bf158f20978991cf985325842f74283eb6df26c8a39d8/charset_normalizer-3.5.2-cp311-cp311-win_amd64.whl",
+ "sha256": "87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96",
+ "bytes": 214932,
+ "filename": "charset_normalizer-3.5.2-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "click",
+ "version": "8.5.0",
+ "url": "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl",
+ "sha256": "255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360",
+ "bytes": 125251,
+ "filename": "click-8.5.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "cloudpickle",
+ "version": "3.1.2",
+ "url": "https://files.pythonhosted.org/packages/88/39/799be3f2f0f38cc727ee3b4f1445fe6d5e4133064ec2e4115069418a5bb6/cloudpickle-3.1.2-py3-none-any.whl",
+ "sha256": "9acb47f6afd73f60dc1df93bb801b472f05ff42fa6c84167d25cb206be1fbf4a",
+ "bytes": 22228,
+ "filename": "cloudpickle-3.1.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "colorama",
+ "version": "0.4.6",
+ "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl",
+ "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6",
+ "bytes": 25335,
+ "filename": "colorama-0.4.6-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "comm",
+ "version": "0.2.3",
+ "url": "https://files.pythonhosted.org/packages/60/97/891a0971e1e4a8c5d2b20bbe0e524dc04548d2307fee33cdeba148fd4fc7/comm-0.2.3-py3-none-any.whl",
+ "sha256": "c615d91d75f7f04f095b30d1c1711babd43bdc6419c1be9886a85f2f4e489417",
+ "bytes": 7294,
+ "filename": "comm-0.2.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ConfigArgParse",
+ "version": "1.9.0",
+ "url": "https://files.pythonhosted.org/packages/bd/de/f7fe2171f2b650ef7dd455c4c7f6dbaf53cc942430a2e0ff6b2450e728b5/configargparse-1.9.0-py3-none-any.whl",
+ "sha256": "e4ecc54d821ca97c43e6152403f40e158aff79d809c3447746fa92b136dc1e31",
+ "bytes": 37381,
+ "filename": "configargparse-1.9.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "contourpy",
+ "version": "1.3.3",
+ "url": "https://files.pythonhosted.org/packages/98/4b/9bd370b004b5c9d8045c6c33cf65bae018b27aca550a3f657cdc99acdbd8/contourpy-1.3.3-cp311-cp311-win_amd64.whl",
+ "sha256": "3519428f6be58431c56581f1694ba8e50626f2dd550af225f82fb5f5814d2a42",
+ "bytes": 225234,
+ "filename": "contourpy-1.3.3-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "cwevals",
+ "version": "0.0.1b1",
+ "url": "https://files.pythonhosted.org/packages/b5/96/b3b348954f88915e60e2f1fbe6d09250584e53a20d949e55786f31dbaeb0/cwevals-0.0.1b1-py3-none-any.whl",
+ "sha256": "6936baf0ccdc5d9092abd5c2ab628cedcdae9bb72edfdf730f7aaac19118855a",
+ "bytes": 176544,
+ "filename": "cwevals-0.0.1b1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "cycler",
+ "version": "0.12.1",
+ "url": "https://files.pythonhosted.org/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl",
+ "sha256": "85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30",
+ "bytes": 8321,
+ "filename": "cycler-0.12.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "dash",
+ "version": "4.4.1",
+ "url": "https://files.pythonhosted.org/packages/9a/29/498125538103a11eab9cfbbde41bacf93e14ab3ac92ae9fb4ac0ac4dd61b/dash-4.4.1-py3-none-any.whl",
+ "sha256": "72120a91b10ee4d73f9446efd5d6a4ec218086feed7b1b479d2259844d1f658f",
+ "bytes": 8945027,
+ "filename": "dash-4.4.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "distro",
+ "version": "1.9.0",
+ "url": "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl",
+ "sha256": "7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2",
+ "bytes": 20277,
+ "filename": "distro-1.9.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "einops",
+ "version": "0.8.2",
+ "url": "https://files.pythonhosted.org/packages/2a/09/f8d8f8f31e4483c10a906437b4ce31bdf3d6d417b73fe33f1a8b59e34228/einops-0.8.2-py3-none-any.whl",
+ "sha256": "54058201ac7087911181bfec4af6091bb59380360f069276601256a76af08193",
+ "bytes": 65638,
+ "filename": "einops-0.8.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "executing",
+ "version": "2.3.0",
+ "url": "https://files.pythonhosted.org/packages/4d/dd/8bc67e7d5ffc1d88aa5af511189dfb76dc4e1e5b808fab186146ef2663e5/executing-2.3.0-py3-none-any.whl",
+ "sha256": "736e859c9f8701f11fcf516856f26f562e04776387824b43a35a1dfe21c84122",
+ "bytes": 29393,
+ "filename": "executing-2.3.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "fastjsonschema",
+ "version": "2.22.2",
+ "url": "https://files.pythonhosted.org/packages/49/82/2755c7c982086f00d4dab85bc120ec35045a9fc2191893a6ce79afe94443/fastjsonschema-2.22.2-py3-none-any.whl",
+ "sha256": "0fb3915616adac85ccfdd737d26be1089845d2019819505b42d39888458f74d4",
+ "bytes": 27413,
+ "filename": "fastjsonschema-2.22.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "filelock",
+ "version": "4.2.4",
+ "url": "https://files.pythonhosted.org/packages/e0/1b/5e74289a1878e666bb4b65fe5805a04cafcac2aa5f519ef1ead67ef91c56/filelock-4.2.4-py3-none-any.whl",
+ "sha256": "301241438c57936ef93f4243a94f2559022268bfcf9b375a9a72eb0f8db8358e",
+ "bytes": 162475,
+ "filename": "filelock-4.2.4-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "Flask",
+ "version": "3.1.3",
+ "url": "https://files.pythonhosted.org/packages/7f/9c/34f6962f9b9e9c71f6e5ed806e0d0ff03c9d1b0b2340088a0cf4bce09b18/flask-3.1.3-py3-none-any.whl",
+ "sha256": "f4bcbefc124291925f1a26446da31a5178f9483862233b23c0c96a20701f670c",
+ "bytes": 103424,
+ "filename": "flask-3.1.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "flask-cors",
+ "version": "6.0.5",
+ "url": "https://files.pythonhosted.org/packages/49/55/5bb1a2d918e9f02f131e47a59032bae70e48050e986e941511fd737a935c/flask_cors-6.0.5-py3-none-any.whl",
+ "sha256": "68fcf75693e961f3af26683b23c4b9a8fb6b64de17d20d0c37b95e8de7ab2ed8",
+ "bytes": 16692,
+ "filename": "flask_cors-6.0.5-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "fonttools",
+ "version": "4.68.0",
+ "url": "https://files.pythonhosted.org/packages/46/87/4ba592099172764aa56e66919b0c3ddaf944c775433e806e36e165062095/fonttools-4.68.0-cp311-cp311-win_amd64.whl",
+ "sha256": "35425bba603cf9d72c9f3c173ea6c98632164f3bdfb1ce1a3dcc928979c6ec6d",
+ "bytes": 1681821,
+ "filename": "fonttools-4.68.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "freetype-py",
+ "version": "2.5.1",
+ "url": "https://files.pythonhosted.org/packages/93/6e/bd7fbfacca077bc6f34f1a1109800a2c41ab50f4704d3a0507ba41009915/freetype_py-2.5.1-py3-none-win_amd64.whl",
+ "sha256": "0b7f8e0342779f65ca13ef8bc103938366fecade23e6bb37cb671c2b8ad7f124",
+ "bytes": 814608,
+ "filename": "freetype_py-2.5.1-py3-none-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "frozenlist",
+ "version": "1.8.0",
+ "url": "https://files.pythonhosted.org/packages/0a/f5/603d0d6a02cfd4c8f2a095a54672b3cf967ad688a60fb9faf04fc4887f65/frozenlist-1.8.0-cp311-cp311-win_amd64.whl",
+ "sha256": "ac913f8403b36a2c8610bbfd25b8013488533e71e62b4b4adce9c86c8cea905b",
+ "bytes": 44064,
+ "filename": "frozenlist-1.8.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "fsspec",
+ "version": "2026.9.0",
+ "url": "https://files.pythonhosted.org/packages/6c/c0/a98505f18594f1bce828bb159cec0fcf9860562f1a2c85913409fc8f3d9e/fsspec-2026.9.0-py3-none-any.whl",
+ "sha256": "8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f",
+ "bytes": 221738,
+ "filename": "fsspec-2026.9.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ftfy",
+ "version": "6.3.1",
+ "url": "https://files.pythonhosted.org/packages/ab/6e/81d47999aebc1b155f81eca4477a616a70f238a2549848c38983f3c22a82/ftfy-6.3.1-py3-none-any.whl",
+ "sha256": "7c70eb532015cd2f9adb53f101fb6c7945988d023a085d127d1573dc49dd0083",
+ "bytes": 44821,
+ "filename": "ftfy-6.3.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "fvcore",
+ "version": "0.1.5.post20221221",
+ "url": "https://files.pythonhosted.org/packages/a5/93/d056a9c4efc6c79ba7b5159cc66bb436db93d2cc46dca18ed65c59cc8e4e/fvcore-0.1.5.post20221221.tar.gz",
+ "sha256": "f2fb0bb90572ae651c11c78e20493ed19b2240550a7e4bbb2d6de87bdd037860",
+ "bytes": 50217,
+ "filename": "fvcore-0.1.5.post20221221.tar.gz",
+ "kind": "source"
+ },
+ {
+ "name": "googleapis-common-protos",
+ "version": "1.76.0",
+ "url": "https://files.pythonhosted.org/packages/05/6d/78dc67a9e779e594b49bf62604034d3a6aa428a55afc729cafda4b7333e1/googleapis_common_protos-1.76.0-py3-none-any.whl",
+ "sha256": "59e13344a9f3651aa201a03e2bee815a3bf43a4baf1f9ff8a9b62a840ce25fac",
+ "bytes": 307707,
+ "filename": "googleapis_common_protos-1.76.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "h11",
+ "version": "0.16.0",
+ "url": "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl",
+ "sha256": "63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86",
+ "bytes": 37515,
+ "filename": "h11-0.16.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "hf-xet",
+ "version": "1.7.1",
+ "url": "https://files.pythonhosted.org/packages/d4/56/e0f82a9f31772c2db59ca95e85beeb99e6da1a55f47d3fedac1b23ea1bc9/hf_xet-1.7.1-cp38-abi3-win_amd64.whl",
+ "sha256": "d6e2c99e5dc7d6fa301e92e79a4f02cf962620dfc9fef84b687df597845cd72a",
+ "bytes": 3833194,
+ "filename": "hf_xet-1.7.1-cp38-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "httpcore",
+ "version": "1.0.9",
+ "url": "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl",
+ "sha256": "2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55",
+ "bytes": 78784,
+ "filename": "httpcore-1.0.9-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "httpcore2",
+ "version": "2.16.0",
+ "url": "https://files.pythonhosted.org/packages/af/c2/ce417c397afa5181f0e3c6ff01a4d01639414e1adef08730d97571297151/httpcore2-2.16.0-py3-none-any.whl",
+ "sha256": "5c4358319f2602d984ad93182c9fee5160f22e9da7babdda870a5e7c4e2dc34f",
+ "bytes": 85070,
+ "filename": "httpcore2-2.16.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "httpx",
+ "version": "0.28.1",
+ "url": "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl",
+ "sha256": "d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad",
+ "bytes": 73517,
+ "filename": "httpx-0.28.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "httpx2",
+ "version": "2.16.0",
+ "url": "https://files.pythonhosted.org/packages/7b/3d/2e4bc4fd1ef9770871669adb348d612a6e4786b303a23f9935b81c48dd60/httpx2-2.16.0-py3-none-any.whl",
+ "sha256": "fd2c5d7909e8d86fe92d53020c310ca0e4e431b838c207c5754b9bbf0308d49a",
+ "bytes": 97880,
+ "filename": "httpx2-2.16.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "huggingface_hub",
+ "version": "2.3.0",
+ "url": "https://files.pythonhosted.org/packages/c7/89/5f6ef1162d0323f167b6baab04d1b4bd6a946161a8af6d86f622d9d79aa1/huggingface_hub-2.3.0-py3-none-any.whl",
+ "sha256": "5da369600233568a126eb5578754935b2add9446b42d9e2fc0927d56840ac1a5",
+ "bytes": 855161,
+ "filename": "huggingface_hub-2.3.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "hydra-core",
+ "version": "1.3.8",
+ "url": "https://files.pythonhosted.org/packages/13/69/8e5cf7ad847538fc180fbd06e8442b8bede53ee4852458a16e24231395e9/hydra_core-1.3.8-py3-none-any.whl",
+ "sha256": "d5f184c291691cba835c7f04bc4e36270ad88b1d7e394a3712f5af084c30b394",
+ "bytes": 168949,
+ "filename": "hydra_core-1.3.8-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "idna",
+ "version": "3.20",
+ "url": "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl",
+ "sha256": "ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c",
+ "bytes": 69583,
+ "filename": "idna-3.20-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ImageIO",
+ "version": "2.38.1",
+ "url": "https://files.pythonhosted.org/packages/7d/8a/3b7f62b9df56460959f1b9bef094248d2a4d7f393c5b0d2da8efcdf0e40e/imageio-2.38.1-py3-none-any.whl",
+ "sha256": "36d23eb7423d2fb63f637098758edb3d2df3687f7125e0a5ce8596572022dcf9",
+ "bytes": 328389,
+ "filename": "imageio-2.38.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "imageio-ffmpeg",
+ "version": "0.7.0",
+ "url": "https://files.pythonhosted.org/packages/e5/55/1d50cdd78d862a30c2ce44f01cea387f77b364b21fa2fecf1590258b215b/imageio_ffmpeg-0.7.0-py3-none-win_amd64.whl",
+ "sha256": "7a22b45f60321d4172bdf2bc61f716bce4c81b85727bd59c7c7e371055a6a440",
+ "bytes": 31247004,
+ "filename": "imageio_ffmpeg-0.7.0-py3-none-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "importlib_metadata",
+ "version": "10.1.0",
+ "url": "https://files.pythonhosted.org/packages/65/b6/495438ad95e0102aff8f6786b5474202f38cd5d4700d03a72b77977dec10/importlib_metadata-10.1.0-py3-none-any.whl",
+ "sha256": "cf45ce66a929c64e994185a809c04840d0501db17e663810d993d0f4829265c7",
+ "bytes": 32221,
+ "filename": "importlib_metadata-10.1.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "iopath",
+ "version": "0.1.10",
+ "url": "https://files.pythonhosted.org/packages/72/73/b3d451dfc523756cf177d3ebb0af76dc7751b341c60e2a21871be400ae29/iopath-0.1.10.tar.gz",
+ "sha256": "3311c16a4d9137223e20f141655759933e1eda24f8bff166af834af3c645ef01",
+ "bytes": 42226,
+ "filename": "iopath-0.1.10.tar.gz",
+ "kind": "source"
+ },
+ {
+ "name": "ipython",
+ "version": "9.17.1",
+ "url": "https://files.pythonhosted.org/packages/2d/1e/65b59cf518c106aa755e7f7da3099027738687a862ec785060702a481320/ipython-9.17.1-py3-none-any.whl",
+ "sha256": "6d1645743cfd1a07eb695d85aa2b5fa66721f8cbae9431d4049f7084bbf06509",
+ "bytes": 639038,
+ "filename": "ipython-9.17.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ipython_pygments_lexers",
+ "version": "1.1.1",
+ "url": "https://files.pythonhosted.org/packages/d9/33/1f075bf72b0b747cb3288d011319aaf64083cf2efef8354174e3ed4540e2/ipython_pygments_lexers-1.1.1-py3-none-any.whl",
+ "sha256": "a9462224a505ade19a605f71f8fa63c2048833ce50abc86768a0d81d876dc81c",
+ "bytes": 8074,
+ "filename": "ipython_pygments_lexers-1.1.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ipywidgets",
+ "version": "8.1.9",
+ "url": "https://files.pythonhosted.org/packages/c3/55/298e9b3b864a198234997e87a1471c1b17d7f3546ace6d18fb5cf1ce24b2/ipywidgets-8.1.9-py3-none-any.whl",
+ "sha256": "f2b8cbcaae10252b809fbe4d7470db75c09b769a32cbf816d20e5ca6d3c5a79d",
+ "bytes": 140101,
+ "filename": "ipywidgets-8.1.9-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "itsdangerous",
+ "version": "2.2.0",
+ "url": "https://files.pythonhosted.org/packages/04/96/92447566d16df59b2a776c0fb82dbc4d9e07cd95062562af01e408583fc4/itsdangerous-2.2.0-py3-none-any.whl",
+ "sha256": "c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef",
+ "bytes": 16234,
+ "filename": "itsdangerous-2.2.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "janus",
+ "version": "2.0.0",
+ "url": "https://files.pythonhosted.org/packages/68/34/65604740edcb20e1bda6a890348ed7d282e7dd23aa00401cbe36fd0edbd9/janus-2.0.0-py3-none-any.whl",
+ "sha256": "7e6449d34eab04cd016befbd7d8c0d8acaaaab67cb59e076a69149f9031745f9",
+ "bytes": 12161,
+ "filename": "janus-2.0.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "jedi",
+ "version": "0.20.1",
+ "url": "https://files.pythonhosted.org/packages/be/c7/71eb0d51cdcbb63b857c931aa4e9218b078b5d9f8ecd383b234f28fe7b0f/jedi-0.20.1-py2.py3-none-any.whl",
+ "sha256": "0fb16d86c4a4c73c37ba518c77419975e30fcc620658a8d14fbb5720cdd34142",
+ "bytes": 4885980,
+ "filename": "jedi-0.20.1-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "Jinja2",
+ "version": "3.1.6",
+ "url": "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl",
+ "sha256": "85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67",
+ "bytes": 134899,
+ "filename": "jinja2-3.1.6-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "joblib",
+ "version": "1.6.0",
+ "url": "https://files.pythonhosted.org/packages/18/53/84099323c2ec4be98d935f63c033ac4151ee83836ca1050ede3b3aadf155/joblib-1.6.0-py3-none-any.whl",
+ "sha256": "3dbbf9f6e4b592a2357b854608e980fe6390d131d7a82f011a377ef2ebef7aba",
+ "bytes": 306115,
+ "filename": "joblib-1.6.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "jsonschema",
+ "version": "4.26.0",
+ "url": "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl",
+ "sha256": "d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce",
+ "bytes": 90630,
+ "filename": "jsonschema-4.26.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "jsonschema-specifications",
+ "version": "2025.9.1",
+ "url": "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl",
+ "sha256": "98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe",
+ "bytes": 18437,
+ "filename": "jsonschema_specifications-2025.9.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "jupyter_core",
+ "version": "5.9.1",
+ "url": "https://files.pythonhosted.org/packages/e7/e7/80988e32bf6f73919a113473a604f5a8f09094de312b9d52b79c2df7612b/jupyter_core-5.9.1-py3-none-any.whl",
+ "sha256": "ebf87fdc6073d142e114c72c9e29a9d7ca03fad818c5d300ce2adc1fb0743407",
+ "bytes": 29032,
+ "filename": "jupyter_core-5.9.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "jupyterlab_widgets",
+ "version": "3.0.17",
+ "url": "https://files.pythonhosted.org/packages/33/ef/6d27fc118f58cb24886da413545a7efb0853d405fddbfd8b2d9ac09fbed4/jupyterlab_widgets-3.0.17-py3-none-any.whl",
+ "sha256": "40ac1e9955acf116c4d995d9bfa082d86ad9ec6d91c4f134827cf5e0a5eb75e0",
+ "bytes": 217292,
+ "filename": "jupyterlab_widgets-3.0.17-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "kiwisolver",
+ "version": "1.5.1",
+ "url": "https://files.pythonhosted.org/packages/bf/9f/6f9e489c188200e6fb3193935501894811e8c97577c8ffe9033589bf3521/kiwisolver-1.5.1-cp311-cp311-win_amd64.whl",
+ "sha256": "1a7587dc335f2c0f5bd577fd0540bd16c66006bdb60f759a1059f025e6c4f071",
+ "bytes": 70744,
+ "filename": "kiwisolver-1.5.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "kornia",
+ "version": "0.9.0",
+ "url": "https://files.pythonhosted.org/packages/c5/ee/6bffb3fc85446de03fa7e397954ba4dd1bc5edab92b4b8be3ce09c9ccd1b/kornia-0.9.0-py3-none-any.whl",
+ "sha256": "7a1632fe004a305c94f2b979fc6ab4df26e01f925e74bdb9f8b8a03a1229caaf",
+ "bytes": 1940302,
+ "filename": "kornia-0.9.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "kornia_rs",
+ "version": "0.2.0",
+ "url": "https://files.pythonhosted.org/packages/81/a4/98232e22fc27360bd98aef6a56bc8ad7073734170ff564d3cef6f314e94d/kornia_rs-0.2.0-cp311-cp311-win_amd64.whl",
+ "sha256": "f85141d602f4e27cb07e2adaa03827a6533a45ea70956e6688073544018887bb",
+ "bytes": 4345346,
+ "filename": "kornia_rs-0.2.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "lazy-loader",
+ "version": "0.6",
+ "url": "https://files.pythonhosted.org/packages/23/93/4e45e37f26c820216704b36b8e67cc55c490a7abd287a78a26a2c0e21386/lazy_loader-0.6-py3-none-any.whl",
+ "sha256": "77253be3391b06124a0e16105bd663b6c54470af1a9ca8e1cf026f38d58ed056",
+ "bytes": 8791,
+ "filename": "lazy_loader-0.6-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "lightning-utilities",
+ "version": "0.15.3",
+ "url": "https://files.pythonhosted.org/packages/25/f4/ead6e0e37209b07c9baa3e984ccdb0348ca370b77cea3aaea8ddbb097e00/lightning_utilities-0.15.3-py3-none-any.whl",
+ "sha256": "6c55f1bee70084a1cbeaa41ada96e4b3a0fea5909e844dd335bd80f5a73c5f91",
+ "bytes": 31906,
+ "filename": "lightning_utilities-0.15.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "line_profiler",
+ "version": "5.1.0",
+ "url": "https://files.pythonhosted.org/packages/8e/14/e7508b418ccad03987ff6fb16660b8f3d3754a9a27ab53352a3c833b328e/line_profiler-5.1.0-cp311-cp311-win_amd64.whl",
+ "sha256": "140ec9a78aeef00cee33b68dc6fa6140faeec48e57095b232808dd398570e0f8",
+ "bytes": 475487,
+ "filename": "line_profiler-5.1.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "loguru",
+ "version": "0.7.3",
+ "url": "https://files.pythonhosted.org/packages/0c/29/0348de65b8cc732daa3e33e67806420b2ae89bdce2b04af740289c5c6c8c/loguru-0.7.3-py3-none-any.whl",
+ "sha256": "31a33c10c8e1e10422bfd431aeb5d351c7cf7fa671e3c4df004162264b28220c",
+ "bytes": 61595,
+ "filename": "loguru-0.7.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "MarkupSafe",
+ "version": "3.0.3",
+ "url": "https://files.pythonhosted.org/packages/83/8a/4414c03d3f891739326e1783338e48fb49781cc915b2e0ee052aa490d586/markupsafe-3.0.3-cp311-cp311-win_amd64.whl",
+ "sha256": "de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01",
+ "bytes": 15077,
+ "filename": "markupsafe-3.0.3-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "matplotlib",
+ "version": "3.11.2",
+ "url": "https://files.pythonhosted.org/packages/66/54/91fe3fdfa29100b4668cbf9721577a10acde6e009694618230e4e7a97527/matplotlib-3.11.2-cp311-cp311-win_amd64.whl",
+ "sha256": "a24d5fd36e4f0e742c3851dcd20810e56a95633a342e4bf6cb591c678e8fe61f",
+ "bytes": 9329982,
+ "filename": "matplotlib-3.11.2-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "matplotlib-inline",
+ "version": "0.2.2",
+ "url": "https://files.pythonhosted.org/packages/41/09/5b161152e2d90f7b87f781c2e1267494aef9c32498df793f73ad0a0a494a/matplotlib_inline-0.2.2-py3-none-any.whl",
+ "sha256": "3c821cf1c209f59fb2d2d64abbf5b23b67bcb2210d663f9918dd851c6da1fcf6",
+ "bytes": 9534,
+ "filename": "matplotlib_inline-0.2.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "mpmath",
+ "version": "1.3.0",
+ "url": "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl",
+ "sha256": "a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c",
+ "bytes": 536198,
+ "filename": "mpmath-1.3.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "multidict",
+ "version": "7.2.1",
+ "url": "https://files.pythonhosted.org/packages/1f/02/41d769148f32c9bd535fd0ddd946c4e42f38acaddf7899f3bf49d9e67703/multidict-7.2.1-cp311-cp311-win_amd64.whl",
+ "sha256": "a789e3d27fc5665cc0477f10a35a89383313e4c9cf8b5e6af7ea71f039cdcc0e",
+ "bytes": 94895,
+ "filename": "multidict-7.2.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "munkres",
+ "version": "3.0.0",
+ "url": "https://files.pythonhosted.org/packages/bb/e5/2a3a68d08099d2bb804ebbc24cd0f513241b39e489882d009e5b91fc52f9/munkres-3.0.0-cp311-cp311-win_amd64.whl",
+ "sha256": "1d62ba1a2deb3682aca87343bb7ef96344d78d572dab75c989bc3b19507774a3",
+ "bytes": 136384,
+ "filename": "munkres-3.0.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "narwhals",
+ "version": "2.28.0",
+ "url": "https://files.pythonhosted.org/packages/cf/82/8ef9c7e0f50493307a49c09cfa7f00c5a778b6d1921f7b2dabe1d3a5809e/narwhals-2.28.0-py3-none-any.whl",
+ "sha256": "1f69d6385ec30e2fa6e1fdeb37c562ecabd0f713f6f3e3b58a668c5c9df9567f",
+ "bytes": 490591,
+ "filename": "narwhals-2.28.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "nbformat",
+ "version": "5.11.1",
+ "url": "https://files.pythonhosted.org/packages/1a/69/ee613f74085ca7103f79cd08d579c4f3177d1d26e5d3d9528d2d6536a707/nbformat-5.11.1-py3-none-any.whl",
+ "sha256": "cc6698fa75f4fab8755ead786317815f13a6fee3b53311c0abb1a8b51d52f7ec",
+ "bytes": 79849,
+ "filename": "nbformat-5.11.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "nest-asyncio",
+ "version": "1.6.0",
+ "url": "https://files.pythonhosted.org/packages/a0/c4/c2971a3ba4c6103a3d10c4b0f24f461ddc027f0f09763220cf35ca1401b3/nest_asyncio-1.6.0-py3-none-any.whl",
+ "sha256": "87af6efd6b5e897c81050477ef65c62e2b2f35d51703cae01aff2905b1852e1c",
+ "bytes": 5195,
+ "filename": "nest_asyncio-1.6.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "networkx",
+ "version": "3.6.1",
+ "url": "https://files.pythonhosted.org/packages/9e/c9/b2622292ea83fbb4ec318f5b9ab867d0a28ab43c5717bb85b0a5f6b3b0a4/networkx-3.6.1-py3-none-any.whl",
+ "sha256": "d47fbf302e7d9cbbb9e2555a0d267983d2aa476bac30e90dfbe5669bd57f3762",
+ "bytes": 2068504,
+ "filename": "networkx-3.6.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ninja",
+ "version": "1.13.2",
+ "url": "https://files.pythonhosted.org/packages/3f/dd/3766b5f4d32e8a9b97d195496b0b01fbbe2e1a41669dab0cd6492a6ce199/ninja-1.13.2-py3-none-win_amd64.whl",
+ "sha256": "1293f4078278b70d0ee4b6cc8f3a9e030656c9b2f59909970343c4fe76070118",
+ "bytes": 311798,
+ "filename": "ninja-1.13.2-py3-none-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "numpy",
+ "version": "1.26.4",
+ "url": "https://files.pythonhosted.org/packages/3f/6b/5610004206cf7f8e7ad91c5a85a8c71b2f2f8051a0c0c4d5916b76d6cbb2/numpy-1.26.4-cp311-cp311-win_amd64.whl",
+ "sha256": "cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2",
+ "bytes": 15811913,
+ "filename": "numpy-1.26.4-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "nvidia-ml-py",
+ "version": "13.615.71",
+ "url": "https://files.pythonhosted.org/packages/53/a1/1681dfa1c904d4e3e72e51b55a0ff012d50b766843ef832d584abe2113c6/nvidia_ml_py-13.615.71-py3-none-any.whl",
+ "sha256": "959bf4adf6fe1308e4bd739e722236b0d1ec8392e2cefad33ff70c311380b9b6",
+ "bytes": 58132,
+ "filename": "nvidia_ml_py-13.615.71-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "omegaconf",
+ "version": "2.3.1",
+ "url": "https://files.pythonhosted.org/packages/a4/0e/152509871bf30df6fc38569f52a2db9b55dd41aae957adae50a053ac7778/omegaconf-2.3.1-py3-none-any.whl",
+ "sha256": "3d701d14e9a8828f1edd28bb70b725908b34277cdd72cf7d6a83f94dadc6b6a0",
+ "bytes": 79502,
+ "filename": "omegaconf-2.3.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "open3d",
+ "version": "0.20.0",
+ "url": "https://files.pythonhosted.org/packages/9d/9b/d4138598ab720b1594f9ab6371d52ee0cb413e6b4406d7cb0a7c4994a9b9/open3d-0.20.0-cp311-cp311-win_amd64.whl",
+ "sha256": "bb3633fef10b1024cbf10a98f0457de26498b40f93c91b7029865d53e3e7a114",
+ "bytes": 77478508,
+ "filename": "open3d-0.20.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "open_clip_torch",
+ "version": "3.3.0",
+ "url": "https://files.pythonhosted.org/packages/37/b5/41c315ccd94ca332ead3e832e83eee343ab245005c3e43d9d3e75eae34eb/open_clip_torch-3.3.0-py3-none-any.whl",
+ "sha256": "c549ad5ed6bfc119cc11105033c0a2b9d7a2a4afeb40a58a09aab3da1a0043ce",
+ "bytes": 1547268,
+ "filename": "open_clip_torch-3.3.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opencv-python",
+ "version": "4.11.0.86",
+ "url": "https://files.pythonhosted.org/packages/a4/7d/f1c30a92854540bf789e9cd5dde7ef49bbe63f855b85a2e6b3db8135c591/opencv_python-4.11.0.86-cp37-abi3-win_amd64.whl",
+ "sha256": "085ad9b77c18853ea66283e98affefe2de8cc4c1f43eda4c100cf9b2721142ec",
+ "bytes": 39488044,
+ "filename": "opencv_python-4.11.0.86-cp37-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-api",
+ "version": "1.45.1",
+ "url": "https://files.pythonhosted.org/packages/1e/41/f7dcf80b81ee8e71c1a2b59f14208bc723edbd89ed027a73b175abf6348e/opentelemetry_api-1.45.1-py3-none-any.whl",
+ "sha256": "b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb",
+ "bytes": 60256,
+ "filename": "opentelemetry_api-1.45.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-exporter-http-transport",
+ "version": "0.66b1",
+ "url": "https://files.pythonhosted.org/packages/04/69/6af86ff66492b481c6a4c05dcfd68beb47ed8ba046440a26a2aac76b95c7/opentelemetry_exporter_http_transport-0.66b1-py3-none-any.whl",
+ "sha256": "2f95404bdee7f9d2d529c7de56c7bd86d014d774d8fbf137810e0167f8a492bf",
+ "bytes": 12155,
+ "filename": "opentelemetry_exporter_http_transport-0.66b1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-exporter-otlp-common",
+ "version": "0.66b1",
+ "url": "https://files.pythonhosted.org/packages/fc/39/8c23d67665c762aa51840fa06f86e902e8f6f1693bc8d7e3d98cd6e2f753/opentelemetry_exporter_otlp_common-0.66b1-py3-none-any.whl",
+ "sha256": "00ff8592c3a7cb729ff3fdc7ffa12372c243bdf2163e80c180994d0c7bd83ee9",
+ "bytes": 12385,
+ "filename": "opentelemetry_exporter_otlp_common-0.66b1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-exporter-otlp-proto-common",
+ "version": "1.45.1",
+ "url": "https://files.pythonhosted.org/packages/84/aa/92f225d353904e7f70b8b3e3c1b02db0cf56f744c2e83c581dc372e78873/opentelemetry_exporter_otlp_proto_common-1.45.1-py3-none-any.whl",
+ "sha256": "2f446183ae7047b036226f1d846c41a834b0e8755ad13b51a51dd38952eb466c",
+ "bytes": 15393,
+ "filename": "opentelemetry_exporter_otlp_proto_common-1.45.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-exporter-otlp-proto-http",
+ "version": "1.45.1",
+ "url": "https://files.pythonhosted.org/packages/aa/1f/517eaa0187ba106a9da97160ce2add3a371812681dc440930b267f714e42/opentelemetry_exporter_otlp_proto_http-1.45.1-py3-none-any.whl",
+ "sha256": "24a97cf3753c7fb52fad44a696e452ff371686339e2acf3309e2eda3d0230700",
+ "bytes": 22180,
+ "filename": "opentelemetry_exporter_otlp_proto_http-1.45.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-proto",
+ "version": "1.45.1",
+ "url": "https://files.pythonhosted.org/packages/ab/9a/42ec8180a769516ae757e893b69736826efceac7332553915b4528a91c6d/opentelemetry_proto-1.45.1-py3-none-any.whl",
+ "sha256": "f38e2a8413053c180cd3d2637fbb279673ec2f6a6e09c995aafa2f452c52b46e",
+ "bytes": 72488,
+ "filename": "opentelemetry_proto-1.45.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-sdk",
+ "version": "1.45.1",
+ "url": "https://files.pythonhosted.org/packages/95/3c/87c42b4bd6dd297536f04cd9383d212ac557ecd49f2cbdcd46da1c9ef5c8/opentelemetry_sdk-1.45.1-py3-none-any.whl",
+ "sha256": "c604c11dc429810812348989115fa44bd558772a3d7442afc43d024f2c250ca4",
+ "bytes": 140063,
+ "filename": "opentelemetry_sdk-1.45.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "opentelemetry-semantic-conventions",
+ "version": "0.66b1",
+ "url": "https://files.pythonhosted.org/packages/bc/14/67f8aa798857f8cf686f515bf93d9bb877ce952ddc8efae0fa25b45ce0d6/opentelemetry_semantic_conventions-0.66b1-py3-none-any.whl",
+ "sha256": "d4cddeb4315490b35213f55e2bdc9ac54bb1e4d318927475bed62b35545e581b",
+ "bytes": 206279,
+ "filename": "opentelemetry_semantic_conventions-0.66b1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "packaging",
+ "version": "26.3",
+ "url": "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl",
+ "sha256": "d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c",
+ "bytes": 129956,
+ "filename": "packaging-26.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pandas",
+ "version": "3.0.6",
+ "url": "https://files.pythonhosted.org/packages/d3/dc/d2df02854aec5d47659acfb2be352eecc691845b2f86e99c84f1010a8671/pandas-3.0.6-cp311-cp311-win_amd64.whl",
+ "sha256": "2e5fa32ff162dfdbc280157d664f44d23049ae414725af9676df339c501d82cd",
+ "bytes": 9859246,
+ "filename": "pandas-3.0.6-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "parso",
+ "version": "0.8.7",
+ "url": "https://files.pythonhosted.org/packages/99/5d/8268b644392ee874ee82a635cd0df1773de230bde356c38de28e298392cc/parso-0.8.7-py2.py3-none-any.whl",
+ "sha256": "a8926eb2a1b915486941fdbd31e86a4baf88fe8c210f25f2f35ecec5b574ca1c",
+ "bytes": 107025,
+ "filename": "parso-0.8.7-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pillow",
+ "version": "13.0.0",
+ "url": "https://files.pythonhosted.org/packages/7d/f6/6e2d96413e4c9dbec12ea584d9e646d602877d4cce3ea669099f959deac6/pillow-13.0.0-cp311-cp311-win_amd64.whl",
+ "sha256": "d7710eb676e9bb68965cb045be0d333b4c0d7f9dfbaa7fbf121385b1588683d3",
+ "bytes": 7278471,
+ "filename": "pillow-13.0.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "platformdirs",
+ "version": "4.13.7",
+ "url": "https://files.pythonhosted.org/packages/46/ff/8ed4a836cbf7de39708a2d305d6b67575990908d072bc3565dd8ad71748e/platformdirs-4.13.7-py3-none-any.whl",
+ "sha256": "47664602fbecad0a6efa561fb690d20dbc26875fe8aedf65ba362935df619bbb",
+ "bytes": 33111,
+ "filename": "platformdirs-4.13.7-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "plotly",
+ "version": "7.1.0",
+ "url": "https://files.pythonhosted.org/packages/e5/7d/905a3a3d51087515719058c94cfbda2ff0fc14417c20d557ae3e82d8b250/plotly-7.1.0-py3-none-any.whl",
+ "sha256": "dbb7fa18afce40d0a8e80d1bf162eceb3faa0ce5a77fe741ad09a74cf78f53f3",
+ "bytes": 9692368,
+ "filename": "plotly-7.1.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "point-cloud-utils",
+ "version": "0.34.0",
+ "url": "https://files.pythonhosted.org/packages/17/da/b12b2c7b9d6b9611b33c6c9c2f93d74d1b225bcc88c55a7b8494a8162c69/point_cloud_utils-0.34.0-cp311-cp311-win_amd64.whl",
+ "sha256": "40469bc373765586e4f18940ccff17f9f90db53e9f5c4d238f2c6932d3ff2544",
+ "bytes": 5424127,
+ "filename": "point_cloud_utils-0.34.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "polars",
+ "version": "2.1.0",
+ "url": "https://files.pythonhosted.org/packages/d5/d4/e696a46c74ec8cac6434764deaf72f7edcc2e91c2145a9b3f61900a7aa7a/polars-2.1.0-py3-none-any.whl",
+ "sha256": "63c50ce3533f5a03d17c3a2a24f1d0e0c7eda98fbde4268a3cba900d34060e67",
+ "bytes": 911474,
+ "filename": "polars-2.1.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "polars-runtime-32",
+ "version": "2.1.0",
+ "url": "https://files.pythonhosted.org/packages/4d/4e/2a419d0def2908255dd1b7318c48430319859dc92ca156e2f81ff7bcd78b/polars_runtime_32-2.1.0-cp311-abi3-win_amd64.whl",
+ "sha256": "f2fe32f48af2395cd6ec52a433a03970a69aab1dbb66a613729fd549ce92c904",
+ "bytes": 53926265,
+ "filename": "polars_runtime_32-2.1.0-cp311-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "portalocker",
+ "version": "4.4.2",
+ "url": "https://files.pythonhosted.org/packages/e8/43/bca094221a0f9f592fe1e982d090a92075aa302ecaa92c94cc6268a39b2c/portalocker-4.4.2-py3-none-any.whl",
+ "sha256": "e661b91af34fc1806740f8e0e42990fe55cd85cbae55675ac48a400a9656a51b",
+ "bytes": 129702,
+ "filename": "portalocker-4.4.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "prompt_toolkit",
+ "version": "3.0.53",
+ "url": "https://files.pythonhosted.org/packages/54/6f/84908cad2d6aa5144abcf7b42709fe4fdb459bc640ec7ac5786e7693dabc/prompt_toolkit-3.0.53-py3-none-any.whl",
+ "sha256": "01c0891d7f9237d5e339f7d3e42cdae80b7534abb1c7c0e3352efba6231492f2",
+ "bytes": 392288,
+ "filename": "prompt_toolkit-3.0.53-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "propcache",
+ "version": "0.5.4",
+ "url": "https://files.pythonhosted.org/packages/0a/8a/3db6a3543d8101263b4c52978b6276a04ead2caff2c5ab880d934f47bd89/propcache-0.5.4-cp311-cp311-win_amd64.whl",
+ "sha256": "e904d4d01f36bd6e197590be1533c44e06058771e0746dd073a8ebb3ef880858",
+ "bytes": 46268,
+ "filename": "propcache-0.5.4-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "protobuf",
+ "version": "7.36.2",
+ "url": "https://files.pythonhosted.org/packages/8a/55/b77bda4e5e5f5971fb51b07663694690e9afdb9402136c16a522bd621cad/protobuf-7.36.2-cp310-abi3-win_amd64.whl",
+ "sha256": "a300819d441e078a5608c0d3c709796bb548136058fda017ae51d425b44fd353",
+ "bytes": 456514,
+ "filename": "protobuf-7.36.2-cp310-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "psutil",
+ "version": "7.2.2",
+ "url": "https://files.pythonhosted.org/packages/b4/90/e2159492b5426be0c1fef7acba807a03511f97c5f86b3caeda6ad92351a7/psutil-7.2.2-cp37-abi3-win_amd64.whl",
+ "sha256": "eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988",
+ "bytes": 137737,
+ "filename": "psutil-7.2.2-cp37-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pure_eval",
+ "version": "0.2.4",
+ "url": "https://files.pythonhosted.org/packages/6d/18/83376915176eb058cb86470eb7396388a13350b09a8f233a79303bbcbc5b/pure_eval-0.2.4-py3-none-any.whl",
+ "sha256": "96cae060a313cfaad51bb761278bfb0e62dc0248d9315a81173752dc546cd37a",
+ "bytes": 11893,
+ "filename": "pure_eval-0.2.4-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pyarrow",
+ "version": "19.0.1",
+ "url": "https://files.pythonhosted.org/packages/ff/77/e62aebd343238863f2c9f080ad2ef6ace25c919c6ab383436b5b81cbeef7/pyarrow-19.0.1-cp311-cp311-win_amd64.whl",
+ "sha256": "008a4009efdb4ea3d2e18f05cd31f9d43c388aad29c636112c2966605ba33466",
+ "bytes": 25283133,
+ "filename": "pyarrow-19.0.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pycocotools",
+ "version": "2.0.11",
+ "url": "https://files.pythonhosted.org/packages/a2/23/d17f6111c2a6ae8631d4fa90202bea05844da715d61431fbc34d276462d5/pycocotools-2.0.11-cp311-cp311-win_amd64.whl",
+ "sha256": "8e159232adae3aef6b4e2d37b008bff107b26e9ed3b48e70ea6482302834bd34",
+ "bytes": 80519,
+ "filename": "pycocotools-2.0.11-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pydantic",
+ "version": "2.14.1",
+ "url": "https://files.pythonhosted.org/packages/35/ea/a56b9fe5066f3537b7882f77e9c5dfb26d8c2eefdaed9b5fc73d57b4dc22/pydantic-2.14.1-py3-none-any.whl",
+ "sha256": "9195d967ec791692a04438115466764fb8b9a27b31f14a760437694f40d6b454",
+ "bytes": 488106,
+ "filename": "pydantic-2.14.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pydantic_core",
+ "version": "2.50.1",
+ "url": "https://files.pythonhosted.org/packages/24/65/3e875e7991eaecd4d70686293ff0d8a99aa8f93dc295e6a21c3d702912fb/pydantic_core-2.50.1-cp311-cp311-win_amd64.whl",
+ "sha256": "0048b6dddc8ef4b64fccaad878bd143b0c3882ea9936279dc11d613f6b7dd1bc",
+ "bytes": 2176332,
+ "filename": "pydantic_core-2.50.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pyglet",
+ "version": "2.1.19",
+ "url": "https://files.pythonhosted.org/packages/75/f7/e5c199eb9c5cb3aae817f9102ba6c64f0c82fd4eb69a5d13dc0b1bc98ec0/pyglet-2.1.19-py3-none-any.whl",
+ "sha256": "5ba6e8cb0b5ac56a284e43ab411e2bbd504191c32a765abdbd6a6c4b7f1ca317",
+ "bytes": 1039437,
+ "filename": "pyglet-2.1.19-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "Pygments",
+ "version": "2.21.0",
+ "url": "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl",
+ "sha256": "2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9",
+ "bytes": 1250147,
+ "filename": "pygments-2.21.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "PyOpenGL",
+ "version": "3.1.0",
+ "url": "https://files.pythonhosted.org/packages/9c/1d/4544708aaa89f26c97cc09450bb333a23724a320923e74d73e028b3560f9/PyOpenGL-3.1.0.tar.gz",
+ "sha256": "9b47c5c3a094fa518ca88aeed35ae75834d53e4285512c61879f67a48c94ddaf",
+ "bytes": 1172688,
+ "filename": "PyOpenGL-3.1.0.tar.gz",
+ "kind": "source"
+ },
+ {
+ "name": "pyparsing",
+ "version": "3.3.3",
+ "url": "https://files.pythonhosted.org/packages/38/bb/d215ee7c73b61497b28a5503f9f53523f294fcc936762b7caf90e0c1c2b5/pyparsing-3.3.3-py3-none-any.whl",
+ "sha256": "ece8c00a69cf01b45d0b1dedabb469c90d8caf996d4fda40f147627a122849a4",
+ "bytes": 126420,
+ "filename": "pyparsing-3.3.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pyrender",
+ "version": "0.1.45",
+ "url": "https://files.pythonhosted.org/packages/28/88/174c28b9d3d03cf6d8edb6f637458f30f1cf1a2bd7a617cbd9dadb1740f6/pyrender-0.1.45-py3-none-any.whl",
+ "sha256": "5cf751d1f21fba4640e830cef3a0b5a95ed0f05677bf92c6b8330056b4023aeb",
+ "bytes": 1214061,
+ "filename": "pyrender-0.1.45-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "python-dateutil",
+ "version": "3.0.0",
+ "url": "https://files.pythonhosted.org/packages/5a/17/cebee01d1c0c1441174cf0456ddc91b280d79acb65340c05e41d77866ee8/python_dateutil-3.0.0-py2.py3-none-any.whl",
+ "sha256": "3c79630202e4152c6add678446984236efe4f57e84d8e892aab0637bab82e9fd",
+ "bytes": 94659,
+ "filename": "python_dateutil-3.0.0-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "python-dotenv",
+ "version": "1.2.4",
+ "url": "https://files.pythonhosted.org/packages/60/d1/38f3a3405989a89ac18390803e70c6ad7c7760da4f9b83cbeca0c44a0c72/python_dotenv-1.2.4-py3-none-any.whl",
+ "sha256": "42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc",
+ "bytes": 23266,
+ "filename": "python_dotenv-1.2.4-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "pytorch-lightning",
+ "version": "2.0.0",
+ "url": "https://files.pythonhosted.org/packages/4c/6e/8a0b395b4058bd7e24a8f6a572255b815723d67ed65a121da25346f3148d/pytorch_lightning-2.0.0-py3-none-any.whl",
+ "sha256": "eda04e51c3ca030f92f9eb30cbb10583575b4144a155cfd6b7d17e1bb9a08ffe",
+ "bytes": 715626,
+ "filename": "pytorch_lightning-2.0.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "PyYAML",
+ "version": "6.0.3",
+ "url": "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl",
+ "sha256": "9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf",
+ "bytes": 158763,
+ "filename": "pyyaml-6.0.3-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "referencing",
+ "version": "0.37.0",
+ "url": "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl",
+ "sha256": "381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231",
+ "bytes": 26766,
+ "filename": "referencing-0.37.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "regex",
+ "version": "2026.9.29",
+ "url": "https://files.pythonhosted.org/packages/4d/4a/aab232183c70fdcf77bcf0c51819da02ec522e393e6a0bf00bcf2142e21f/regex-2026.9.29-cp311-cp311-win_amd64.whl",
+ "sha256": "1043aedf5917caa861bcb25a9c11460049656bdf0017a90a309fa8f255467725",
+ "bytes": 280641,
+ "filename": "regex-2026.9.29-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "requests",
+ "version": "2.34.2",
+ "url": "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl",
+ "sha256": "2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0",
+ "bytes": 73075,
+ "filename": "requests-2.34.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "rerun-sdk",
+ "version": "0.23.1",
+ "url": "https://files.pythonhosted.org/packages/a7/ba/028bd382e2ae21e6643cec25f423285dbc6b328ce56d55727b4101ef9443/rerun_sdk-0.23.1-cp39-abi3-win_amd64.whl",
+ "sha256": "d4273db55b56310b053a2de6bf5927a8692cf65f4d234c6e6928fb24ed8a960d",
+ "bytes": 57583198,
+ "filename": "rerun_sdk-0.23.1-cp39-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "retrying",
+ "version": "1.4.2",
+ "url": "https://files.pythonhosted.org/packages/67/f3/6cd296376653270ac1b423bb30bd70942d9916b6978c6f40472d6ac038e7/retrying-1.4.2-py3-none-any.whl",
+ "sha256": "bbc004aeb542a74f3569aeddf42a2516efefcdaff90df0eb38fbfbf19f179f59",
+ "bytes": 10859,
+ "filename": "retrying-1.4.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "rpds-py",
+ "version": "2026.9.1",
+ "url": "https://files.pythonhosted.org/packages/df/c9/384a9b62f8cd89c8e3e609b8c9052c140e8c01d807261e0517c904b8bf29/rpds_py-2026.9.1-cp311-cp311-win_amd64.whl",
+ "sha256": "ce4d4f52e2a4324396caddbd45a97d8d7be5f42edd25d2355282a9c34f9b2f7f",
+ "bytes": 226045,
+ "filename": "rpds_py-2026.9.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "safetensors",
+ "version": "0.8.0",
+ "url": "https://files.pythonhosted.org/packages/1b/6d/3fba214c1e5e0f69991677ec3bc17023f0421776975e1de0c682dca475e2/safetensors-0.8.0-cp310-abi3-win_amd64.whl",
+ "sha256": "096ec1a98435df7beb08853bb5aa9081a84f23d0adc67ed1a0a10550f608373f",
+ "bytes": 355540,
+ "filename": "safetensors-0.8.0-cp310-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "scenepic",
+ "version": "1.1.2",
+ "url": "https://files.pythonhosted.org/packages/20/33/e66f87ccb7385742ab69f6610bad7694c18436f68a9fa30235813c1b8b34/scenepic-1.1.2-cp311-cp311-win_amd64.whl",
+ "sha256": "43b5905050b01de09e1dcbabedd6fe403b43ecd46bf4f50a31447da29a65aafb",
+ "bytes": 572855,
+ "filename": "scenepic-1.1.2-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "scikit-image",
+ "version": "0.26.0",
+ "url": "https://files.pythonhosted.org/packages/d3/c6/2eeacf173da041a9e388975f54e5c49df750757fcfc3ee293cdbbae1ea0a/scikit_image-0.26.0-cp311-cp311-win_amd64.whl",
+ "sha256": "9490360c8d3f9a7e85c8de87daf7c0c66507960cf4947bb9610d1751928721c7",
+ "bytes": 11878486,
+ "filename": "scikit_image-0.26.0-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "scikit-learn",
+ "version": "1.9.1",
+ "url": "https://files.pythonhosted.org/packages/29/8a/8d1e888fe3d0dd4e2a1f3356dad703eed569aaf673e222b6f647005ad30f/scikit_learn-1.9.1-cp311-cp311-win_amd64.whl",
+ "sha256": "220fa18152852a5ce29c49e1eaba9d44ec44631cd2e5cf65f5a40eafa5ab3412",
+ "bytes": 8329877,
+ "filename": "scikit_learn-1.9.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "scipy",
+ "version": "1.17.1",
+ "url": "https://files.pythonhosted.org/packages/95/da/0d1df507cf574b3f224ccc3d45244c9a1d732c81dcb26b1e8a766ae271a8/scipy-1.17.1-cp311-cp311-win_amd64.whl",
+ "sha256": "d30e57c72013c2a4fe441c2fcb8e77b14e152ad48b5464858e07e2ad9fbfceff",
+ "bytes": 36607512,
+ "filename": "scipy-1.17.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "seaborn",
+ "version": "0.13.2",
+ "url": "https://files.pythonhosted.org/packages/83/11/00d3c3dfc25ad54e731d91449895a79e4bf2384dc3ac01809010ba88f6d5/seaborn-0.13.2-py3-none-any.whl",
+ "sha256": "636f8336facf092165e27924f223d3c62ca560b1f2bb5dff7ab7fad265361987",
+ "bytes": 294914,
+ "filename": "seaborn-0.13.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "setuptools",
+ "version": "80.10.2",
+ "url": "https://files.pythonhosted.org/packages/94/b8/f1f62a5e3c0ad2ff1d189590bfa4c46b4f3b6e49cef6f26c6ee4e575394d/setuptools-80.10.2-py3-none-any.whl",
+ "sha256": "95b30ddfb717250edb492926c92b5221f7ef3fbcc2b07579bcd4a27da21d0173",
+ "bytes": 1064234,
+ "filename": "setuptools-80.10.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "simsimd",
+ "version": "6.5.16",
+ "url": "https://files.pythonhosted.org/packages/f4/10/64f681865af5bae1158c7d85b3e715e9be1f9987d6d73776ccd46cb6f75a/simsimd-6.5.16-cp311-cp311-win_amd64.whl",
+ "sha256": "30d1450f8d111d3f50cf3d1cee893ece23f0f3f959a18057d0fed0b7a206a9e1",
+ "bytes": 87200,
+ "filename": "simsimd-6.5.16-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "six",
+ "version": "1.17.0",
+ "url": "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl",
+ "sha256": "4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274",
+ "bytes": 11050,
+ "filename": "six-1.17.0-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "smplx",
+ "version": "0.1.28",
+ "url": "https://files.pythonhosted.org/packages/c9/33/bd37416aec828e7465652d9e2525fe52de0a29a581f1519cc51a74485091/smplx-0.1.28-py3-none-any.whl",
+ "sha256": "e8ff3d278a015c097dc86d44a38475da4ac170042943c84c08eee433629406a7",
+ "bytes": 29903,
+ "filename": "smplx-0.1.28-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "sniffio",
+ "version": "1.3.1",
+ "url": "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl",
+ "sha256": "2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2",
+ "bytes": 10235,
+ "filename": "sniffio-1.3.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "stack-data",
+ "version": "0.6.3",
+ "url": "https://files.pythonhosted.org/packages/f1/7b/ce1eafaf1a76852e2ec9b22edecf1daa58175c090266e9f6c64afcd81d91/stack_data-0.6.3-py3-none-any.whl",
+ "sha256": "d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695",
+ "bytes": 24521,
+ "filename": "stack_data-0.6.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "stringzilla",
+ "version": "5.3.2",
+ "url": "https://files.pythonhosted.org/packages/db/d1/dcc183d4256c813b2fddcd06dab90415bd76ac9d46e2dcb4641452e2c26e/stringzilla-5.3.2-cp311-cp311-win_amd64.whl",
+ "sha256": "fa3cbc0e7d977ebded38115a6a9fbd5597ae174a0ccfe542b8677efb1783bbde",
+ "bytes": 750849,
+ "filename": "stringzilla-5.3.2-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "sympy",
+ "version": "1.14.0",
+ "url": "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl",
+ "sha256": "e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5",
+ "bytes": 6299353,
+ "filename": "sympy-1.14.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "tabulate",
+ "version": "0.10.0",
+ "url": "https://files.pythonhosted.org/packages/99/55/db07de81b5c630da5cbf5c7df646580ca26dfaefa593667fc6f2fe016d2e/tabulate-0.10.0-py3-none-any.whl",
+ "sha256": "f0b0622e567335c8fabaaa659f1b33bcb6ddfe2e496071b743aa113f8774f2d3",
+ "bytes": 39814,
+ "filename": "tabulate-0.10.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "termcolor",
+ "version": "3.3.0",
+ "url": "https://files.pythonhosted.org/packages/33/d1/8bb87d21e9aeb323cc03034f5eaf2c8f69841e40e4853c2627edf8111ed3/termcolor-3.3.0-py3-none-any.whl",
+ "sha256": "cf642efadaf0a8ebbbf4bc7a31cec2f9b5f21a9f726f4ccbb08192c9c26f43a5",
+ "bytes": 7734,
+ "filename": "termcolor-3.3.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "threadpoolctl",
+ "version": "3.7.0",
+ "url": "https://files.pythonhosted.org/packages/43/3f/f88a53f60a472b46f4023f56d204dd7de33d34c5d2acbfa0d70a674e639e/threadpoolctl-3.7.0-py3-none-any.whl",
+ "sha256": "cd8b60b5641b45c67bbf73c64c843235fc2d8a480c87389f52f5dbee893b86be",
+ "bytes": 26362,
+ "filename": "threadpoolctl-3.7.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "tifffile",
+ "version": "2026.3.3",
+ "url": "https://files.pythonhosted.org/packages/1a/e4/e804505f87627cd8cdae9c010c47c4485fd8c1ce31a7dd0ab7fcc4707377/tifffile-2026.3.3-py3-none-any.whl",
+ "sha256": "e8be15c94273113d31ecb7aa3a39822189dd11c4967e3cc88c178f1ad2fd1170",
+ "bytes": 243960,
+ "filename": "tifffile-2026.3.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "timm",
+ "version": "1.0.30",
+ "url": "https://files.pythonhosted.org/packages/f5/85/b897716d0fa016af23b11e6526f5ef76d2013e8bc36b9c7ce15d9200e456/timm-1.0.30-py3-none-any.whl",
+ "sha256": "c8e27adf6801a2fdfb570dbbdd171f2f084756eefc673df8cfaab06bd14864f3",
+ "bytes": 2668917,
+ "filename": "timm-1.0.30-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "torch",
+ "version": "2.7.1+cu128",
+ "url": "https://download-r2.pytorch.org/whl/cu128/torch-2.7.1%2Bcu128-cp311-cp311-win_amd64.whl",
+ "sha256": "138c66dcd0ed2f07aafba3ed8b7958e2bed893694990e0b4b55b6b2b4a336aa6",
+ "bytes": 3273066072,
+ "filename": "torch-2.7.1+cu128-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "torchmetrics",
+ "version": "1.9.0",
+ "url": "https://files.pythonhosted.org/packages/c3/a2/c7f6ebf546f8f644edf0f999aa98ece106986a77a7b922316bf6414ff825/torchmetrics-1.9.0-py3-none-any.whl",
+ "sha256": "bfdcbff3dd1d96b3374bb2496eb39f23c4b28b8a845b6a18c313688e0d2d9ca1",
+ "bytes": 983384,
+ "filename": "torchmetrics-1.9.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "torchvision",
+ "version": "0.22.1+cu128",
+ "url": "https://download-r2.pytorch.org/whl/cu128/torchvision-0.22.1%2Bcu128-cp311-cp311-win_amd64.whl",
+ "sha256": "85ecd729c947151eccea502853be6efc2c0029dc26e6e5148e04684aed008390",
+ "bytes": 7638405,
+ "filename": "torchvision-0.22.1+cu128-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "tqdm",
+ "version": "4.70.1",
+ "url": "https://files.pythonhosted.org/packages/a7/03/921a3d3c75785aca9ebfbfcabfbc3a1be12e2ab5265deb026d55a5a3f83e/tqdm-4.70.1-py3-none-any.whl",
+ "sha256": "c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73",
+ "bytes": 80199,
+ "filename": "tqdm-4.70.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "traitlets",
+ "version": "5.16.1",
+ "url": "https://files.pythonhosted.org/packages/ad/66/0d785f0bc5e4315a96c989bb476d0fc07ea4f85132550c7b156ca2035d52/traitlets-5.16.1-py3-none-any.whl",
+ "sha256": "f775618166caa0396c8e337099240f2bd3e5e917d203b2e6fbe21a58d3cb1f6b",
+ "bytes": 86211,
+ "filename": "traitlets-5.16.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "transforms3d",
+ "version": "0.4.2",
+ "url": "https://files.pythonhosted.org/packages/61/7a/f38385f1b2d5f54221baf1db3d6371dc6eef8041d95abff39576c694e9d9/transforms3d-0.4.2-py3-none-any.whl",
+ "sha256": "1c70399d9e9473ecc23311fd947f727f7c69ed0b063244828c383aa1aefa5941",
+ "bytes": 1376759,
+ "filename": "transforms3d-0.4.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "trimesh",
+ "version": "5.2.0",
+ "url": "https://files.pythonhosted.org/packages/51/14/78624d9c89bab76c2a2e1e839c7641fa686828c2c1c8fb64aedf3b371a5d/trimesh-5.2.0-py3-none-any.whl",
+ "sha256": "04db2c7ec62afdd7763fb04c82bb5f257ddd984993a19ee83697f475fc58fd29",
+ "bytes": 751459,
+ "filename": "trimesh-5.2.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "truststore",
+ "version": "0.10.5",
+ "url": "https://files.pythonhosted.org/packages/51/e9/3a7820be2bb0fe53b6bc9c3be26d3d1158004e4c3ab953aa6840b955b1e9/truststore-0.10.5-py3-none-any.whl",
+ "sha256": "9aaaedaefaf06d8b206278cf8b5012bc897f485a874503501e12d776df78951c",
+ "bytes": 19017,
+ "filename": "truststore-0.10.5-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "typing-inspection",
+ "version": "0.4.4",
+ "url": "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl",
+ "sha256": "65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147",
+ "bytes": 14750,
+ "filename": "typing_inspection-0.4.4-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "typing_extensions",
+ "version": "4.16.0",
+ "url": "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl",
+ "sha256": "481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8",
+ "bytes": 45571,
+ "filename": "typing_extensions-4.16.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "tzdata",
+ "version": "2026.6",
+ "url": "https://files.pythonhosted.org/packages/0a/66/9a06c2227fedfd4919f0eaaa8b94377d9730882a7e4f95823c9a331ab5e1/tzdata-2026.6-py2.py3-none-any.whl",
+ "sha256": "0a10eec6e13ef16b627fabed9a5f2ba61a62b1c67f327305f4e7e412a70b4aec",
+ "bytes": 348210,
+ "filename": "tzdata-2026.6-py2.py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ultralytics",
+ "version": "8.4.191",
+ "url": "https://files.pythonhosted.org/packages/40/d3/efd56d1d2d6f41a9b4c7c0a496da1839f42542b1e0b9ebfeb91e440209fd/ultralytics-8.4.191-py3-none-any.whl",
+ "sha256": "261888048192da1f86ac59a2a2768eb64f30ca16f6c04c825079dfd35495890a",
+ "bytes": 1434031,
+ "filename": "ultralytics-8.4.191-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ultralytics-platform",
+ "version": "0.1.101",
+ "url": "https://files.pythonhosted.org/packages/2d/6e/cd477b1c5ce173bf1fd62ea870891c5868b08245179dd0006de688d01f79/ultralytics_platform-0.1.101-py3-none-any.whl",
+ "sha256": "a185b75895c2784856077df67fcc718a858b820642552c22ccb186e4925f697c",
+ "bytes": 99059,
+ "filename": "ultralytics_platform-0.1.101-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "ultralytics-thop",
+ "version": "2.2.3",
+ "url": "https://files.pythonhosted.org/packages/0e/9f/5246244e2674210549e8b6247bf28a6b586878c2e744d2c82b4d4f872bf7/ultralytics_thop-2.2.3-py3-none-any.whl",
+ "sha256": "d56c860b9422b6abfd7e9d7afdd8af3b1242a854c17305bd60ad05cbc7f4b5b6",
+ "bytes": 32807,
+ "filename": "ultralytics_thop-2.2.3-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "urllib3",
+ "version": "2.8.0",
+ "url": "https://files.pythonhosted.org/packages/92/9d/c4e665119135114480843e7ab388fa94d8480650450e6f8e26b70d323a4c/urllib3-2.8.0-py3-none-any.whl",
+ "sha256": "0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3",
+ "bytes": 135717,
+ "filename": "urllib3-2.8.0-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "waitress",
+ "version": "3.0.2",
+ "url": "https://files.pythonhosted.org/packages/8d/57/a27182528c90ef38d82b636a11f606b0cbb0e17588ed205435f8affe3368/waitress-3.0.2-py3-none-any.whl",
+ "sha256": "c56d67fd6e87c2ee598b76abdd4e96cfad1f24cacdea5078d382b1f9d7b5ed2e",
+ "bytes": 56232,
+ "filename": "waitress-3.0.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "wandb",
+ "version": "0.31.0",
+ "url": "https://files.pythonhosted.org/packages/90/7a/aaee2e55d1aa6f855d01e702263e2e0ef733da45583ecd9836d68ea3d67d/wandb-0.31.0-py3-none-win_amd64.whl",
+ "sha256": "488f8ef63cae217ba220e6d8c163ee8c5b98320ee1866ce774c4da0847235f02",
+ "bytes": 19596112,
+ "filename": "wandb-0.31.0-py3-none-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "wcwidth",
+ "version": "0.9.4",
+ "url": "https://files.pythonhosted.org/packages/d6/f1/c123f902bc2ff9e9c2ab66241b8872204df87cbb18ecdf035e120860fedc/wcwidth-0.9.4-cp310-abi3-win_amd64.whl",
+ "sha256": "f28d77153303450ee13ebbe888297e75cf532c754555b6cabafc9bdda16c421c",
+ "bytes": 597780,
+ "filename": "wcwidth-0.9.4-cp310-abi3-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "webdataset",
+ "version": "1.0.2",
+ "url": "https://files.pythonhosted.org/packages/d9/00/aca6beb3658dab4ed3dbb41a78e6e7f31342e0b41d28088f205525751601/webdataset-1.0.2-py3-none-any.whl",
+ "sha256": "3dbfced32b25c0d199c6b9787937b6f85742bc3c84f652c846893075c1c082d9",
+ "bytes": 74956,
+ "filename": "webdataset-1.0.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "Werkzeug",
+ "version": "3.1.9",
+ "url": "https://files.pythonhosted.org/packages/a1/38/df03f564f43cec2684823f3cccae1a652ee7face1cbaa76fb223096e64d7/werkzeug-3.1.9-py3-none-any.whl",
+ "sha256": "6392e50c78460ba618e5b21f08a71f59c99ce99cdc6cf6e3dd7e6ccca8754fab",
+ "bytes": 228700,
+ "filename": "werkzeug-3.1.9-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "widgetsnbextension",
+ "version": "4.0.16",
+ "url": "https://files.pythonhosted.org/packages/34/95/40e17e20046b7bc820d29d09ae84ec157ec8dd6e6f6cd722626292c31b2e/widgetsnbextension-4.0.16-py3-none-any.whl",
+ "sha256": "a31a8774885b96fe825462f5d6496166f0c7cae111195b6465c801d230eb5a4e",
+ "bytes": 2225148,
+ "filename": "widgetsnbextension-4.0.16-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "win32_setctime",
+ "version": "1.2.1",
+ "url": "https://files.pythonhosted.org/packages/bd/df/5593480bc1e932eeae28e4fa182ab68174edd0d77409ced3b6491d02d1d5/win32_setctime-1.2.1-py3-none-any.whl",
+ "sha256": "a9edc685b35414bec69392c866ed82456ad125ac4a6a4b703ec1d8b462d4f477",
+ "bytes": 4215,
+ "filename": "win32_setctime-1.2.1-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "xxhash",
+ "version": "4.0.2",
+ "url": "https://files.pythonhosted.org/packages/eb/20/6c0271610bec93dc62a24c15f023f81d1781bb1ee9df15daf8b649116d92/xxhash-4.0.2-cp311-cp311-win_amd64.whl",
+ "sha256": "c60fa1038814c3c682a8e3b68aeca598e7b90eb4a65d4a48b7e0e6fbae825507",
+ "bytes": 36982,
+ "filename": "xxhash-4.0.2-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "yacs",
+ "version": "0.1.8",
+ "url": "https://files.pythonhosted.org/packages/38/4f/fe9a4d472aa867878ce3bb7efb16654c5d63672b86dc0e6e953a67018433/yacs-0.1.8-py3-none-any.whl",
+ "sha256": "99f893e30497a4b66842821bac316386f7bd5c4f47ad35c9073ef089aa33af32",
+ "bytes": 14747,
+ "filename": "yacs-0.1.8-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "yarl",
+ "version": "1.25.1",
+ "url": "https://files.pythonhosted.org/packages/aa/9d/8cdceec66a9b940700cb45931741403f045b162afd79bcb93c41cadd0972/yarl-1.25.1-cp311-cp311-win_amd64.whl",
+ "sha256": "d7306dee25b8a0e737363f347362b875094b4dc4e367311470656ae420fdbf8e",
+ "bytes": 102894,
+ "filename": "yarl-1.25.1-cp311-cp311-win_amd64.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "zipp",
+ "version": "4.1.2",
+ "url": "https://files.pythonhosted.org/packages/b8/44/7bd2007260da11cccca29ba2d4c345f1287aa663db38ee7cefeabf6386a5/zipp-4.1.2-py3-none-any.whl",
+ "sha256": "b30cb6cd253122169c47de245ca24a86bac2a5d3802ba15bf7ba6414eb9e144d",
+ "bytes": 10581,
+ "filename": "zipp-4.1.2-py3-none-any.whl",
+ "kind": "wheel"
+ },
+ {
+ "name": "wheel",
+ "version": "0.48.0",
+ "url": "https://files.pythonhosted.org/packages/2e/29/69cfbb602cd91690c55d38ba9fe53e6a7e76a6fa647bf38f19c138d25449/wheel-0.48.0-py3-none-any.whl",
+ "sha256": "3217dcc807155e45db462d7ef2431f5ddda0d7273b700d05a67b271ceb1287ab",
+ "bytes": 33320,
+ "filename": "wheel-0.48.0-py3-none-any.whl",
+ "kind": "wheel"
+ }
+ ],
+ "uv_sha256": "4075a09490327d2bedfacc807fa48252fb93647c5bd7ef28f00e579160ea3fb5"
+}
diff --git a/installer/mamma_adapters.py b/installer/mamma_adapters.py
new file mode 100644
index 0000000..3471323
--- /dev/null
+++ b/installer/mamma_adapters.py
@@ -0,0 +1,91 @@
+"""Apply RGB MoCap's Windows adapters to a user's pinned upstream sources.
+
+Upstream source and data are downloaded directly, under their own licenses;
+they are never included in this repository. Fail on changed upstream syntax.
+"""
+from pathlib import Path
+import ast
+import re
+import shutil
+
+
+def replace(path, old, new, count=1):
+ source=path.read_text(encoding='utf-8')
+ if source.count(old)!=count:raise ValueError('Unsupported upstream source: '+path.name)
+ path.write_text(source.replace(old,new),encoding='utf-8')
+
+
+def adapt_engine(engine, helpers):
+ engine=Path(engine)
+ path=engine/'landmarks/run_ma_2d.py'
+ source=path.read_text(encoding='utf-8');tree=ast.parse(source)
+ # Mask-based inference never needs Detectron2 or its extra model download.
+ imports=[n for n in tree.body if isinstance(n,ast.ImportFrom) and
+ n.module in ('utils.utils_detectron2','detectron2.config')]
+ if len(imports)!=2:raise ValueError('Unexpected upstream detector imports.')
+ lines=source.splitlines(keepends=True)
+ for node in sorted(imports,key=lambda n:n.lineno,reverse=True):del lines[node.lineno-1:node.end_lineno]
+ source=''.join(lines);tree=ast.parse(source);edits=[]
+ functions={n.name:n for n in tree.body if isinstance(n,ast.FunctionDef)}
+ process=functions['process_data'];args=[a.arg for a in process.args.args]
+ expected=['frame_source','detector','device','model','cfg','out_folder','save_cam_output','masks_path']
+ if args!=expected+['downsampled_verts_pth']:raise ValueError('Unexpected upstream landmark interface.')
+ start=process.body[1].lineno if isinstance(process.body[0],ast.Expr) and isinstance(process.body[0].value,ast.Constant) else process.body[0].lineno
+ edits.append((start,process.end_lineno,
+ ' from speed_landmarks import process_fast\n return process_fast('+', '.join(expected)+')\n'))
+ main=functions['main']
+ first=next(n for n in main.body if isinstance(n,ast.Assign) and any(isinstance(t,ast.Name) and t.id=='cfg_path' for t in n.targets))
+ last=next(n for n in main.body if isinstance(n,ast.Assign) and any(isinstance(t,ast.Name) and t.id=='detector' for t in n.targets))
+ lines=source.splitlines(keepends=True)
+ original=''.join(lines[first.lineno-1:last.end_lineno])
+ block=' detector = None\n if masks_folder is None:\n'
+ block+=''.join(' '+ast.unparse(n)+'\n' for n in imports)
+ block+=''.join(' '+line for line in original.splitlines(keepends=True))
+ edits.append((first.lineno,last.end_lineno,block))
+ for begin,end,text in sorted(edits,reverse=True):lines[begin-1:end]=[text]
+ path.write_text(''.join(lines),encoding='utf-8')
+ replace(path,'torch.load(args.weights)',"torch.load(args.weights, weights_only=False, map_location='cpu')")
+ for name in ('optimization/scene_debug/renderer.py','optimization/utils/utils_camera.py'):
+ p=engine/name
+ replace(p,"os.environ['PYOPENGL_PLATFORM'] = 'egl'", "if os.name != 'nt':\n os.environ.setdefault('PYOPENGL_PLATFORM', 'egl')")
+ replace(engine/'optimization/utils/fitting.py',' if parallel:'," if parallel and os.name != 'nt':")
+ for name in ('landmarks/utils/video_utils.py','optimization/utils/video_tools.py'):
+ replace(engine/name,'"/usr/bin/ffmpeg"',"__import__('imageio_ffmpeg').get_ffmpeg_exe()")
+ replace(engine/'optimization/run_ma_3d.py',' use_cam_names = cam_names is not None',
+ ' if cam_names:\n cam_names = sorted(cam_names)\n use_cam_names = cam_names is not None')
+ path=engine/'optimization/utils/optimization.py'
+ replace(path,'import torch\n','import torch\nimport os\n')
+ # Keep the validated quiet-fit schedule, including its early-stop cadence.
+ replace(path,' show_log = True'," show_log = iter % 25 == 0")
+ source=path.read_text(encoding='utf-8');lines=source.splitlines(keepends=True);tree=ast.parse(source)
+ matches=[n for n in ast.walk(tree) if isinstance(n,ast.Expr) and isinstance(n.value,ast.Call) and
+ ast.unparse(n.value.func)=='self.errors.update']
+ if len(matches)!=1:raise ValueError('Unexpected fitting diagnostics.')
+ n=matches[0];lines[n.lineno-1:n.end_lineno]=[' pass # Scalar diagnostics omitted; uncertainty updates retained.\n']
+ path.write_text(''.join(lines),encoding='utf-8')
+ for name in ('speed_crop.py','speed_landmarks.py'):shutil.copy2(Path(helpers)/name,engine/name)
+ for name in ('landmarks/run_ma_2d.py','optimization/utils/optimization.py'):
+ ast.parse((engine/name).read_text(encoding='utf-8'))
+
+
+def adapt_sdf(root):
+ """MSVC integer-width/API fixes; leave the original SDF algorithm intact."""
+ root=Path(root)/'src'
+ for name,annotation in [('aabb.hpp','__align__(32)'),('triangle.hpp','__align__(48)')]:
+ replace(root/name,annotation,'')
+ path=root/'bvh_cuda_op.cu';source=path.read_text(encoding='utf-8')
+ source=source.replace('triangles.type(), "bvh_tree_building"','triangles.scalar_type(), "bvh_tree_building"')
+ source=re.sub(r'\blong\b','int64_t',source)
+ start=source.index(' AT_DISPATCH_FLOATING_TYPES(');head,tail=source[:start],source[start:]
+ lines=[];skip=False
+ for line in tail.splitlines(keepends=True):
+ if re.match(r'\s*#if (PRINT_TIMINGS|DEBUG_PRINT) == 1',line):
+ if skip:raise ValueError('Unexpected nested SDF diagnostics.')
+ skip=True;continue
+ if skip and re.match(r'\s*#endif',line):skip=False;continue
+ if not skip:lines.append(line)
+ if skip:raise ValueError('Unterminated SDF diagnostics.')
+ # Upstream defines BVH_PROFILING=0, but tests it with #ifdef. Retain that
+ # behavior while moving preprocessor directives out of the dispatch macro.
+ tail=''.join(lines).replace('#ifdef BVH_PROFILING\n','').replace('#endif\n','')
+ path.write_text(head+tail,encoding='utf-8')
diff --git a/installer/mamma_helpers/speed_crop.py b/installer/mamma_helpers/speed_crop.py
new file mode 100644
index 0000000..750a88d
--- /dev/null
+++ b/installer/mamma_helpers/speed_crop.py
@@ -0,0 +1,32 @@
+"""Exact, bounded Gaussian crop preprocessing in original image coordinates."""
+import math
+import numpy as np
+
+def install_exact_roi_crop(dataset_type):
+ """Keep original global affine coordinates; localize only Gaussian work."""
+ import threading,sys
+ module=sys.modules[dataset_type.__module__]
+ original_get=dataset_type.__getitem__;original_gaussian=module.gaussian
+ context=threading.local()
+ def gaussian(image,*args,**kwargs):
+ bounds=getattr(context,'bounds',None)
+ if bounds is None:return original_gaussian(image,*args,**kwargs)
+ x0,y0,x1,y1=bounds
+ part=original_gaussian(image[y0:y1,x0:x1],*args,**kwargs)
+ # Same full-frame coordinate system as the original warp. Pixels outside
+ # this halo cannot contribute to the output patch (rotation is zero).
+ full=np.zeros(image.shape,dtype=part.dtype)
+ full[y0:y1,x0:x1]=part
+ return full
+ def get(self,idx):
+ from lib.datasets.utils_eval import expand_to_aspect_ratio
+ box=expand_to_aspect_ratio(self.scale[idx]*200*1.2,target_aspect_ratio=self.cfg.data_cfg['image_size'])
+ cx,cy=self.center[idx];h,w=self.img_cv2.shape[:2]
+ downsampling=(box.max()/self.img_size[1])/2
+ sigma=max(0.,(downsampling-1)/2) if downsampling>1.1 else 0.
+ halo=math.ceil(4*sigma)+8
+ context.bounds=(max(0,math.floor(cx-box[0]/2)-halo),max(0,math.floor(cy-box[1]/2)-halo),
+ min(w,math.ceil(cx+box[0]/2)+halo),min(h,math.ceil(cy+box[1]/2)+halo))
+ try:return original_get(self,idx)
+ finally:context.bounds=None
+ module.gaussian=gaussian;dataset_type.__getitem__=get
diff --git a/installer/mamma_helpers/speed_landmarks.py b/installer/mamma_helpers/speed_landmarks.py
new file mode 100644
index 0000000..18aee47
--- /dev/null
+++ b/installer/mamma_helpers/speed_landmarks.py
@@ -0,0 +1,59 @@
+"""Bounded masked inference. Existing dataset transforms and output schema retained."""
+from pathlib import Path
+import os,time,json
+import numpy as np
+import torch
+import cv2
+from torch.utils.data._utils.collate import default_collate
+from lib.datasets.vitdet_dataset import ViTDetDataset
+
+def process_fast(source,detector,device,model,cfg,out_folder,save_cam_output,masks_path):
+ assert detector is None and masks_path is not None and not save_cam_output
+ batch_size=1
+ if not getattr(ViTDetDataset,'_roi_installed',False):
+ from speed_crop import install_exact_roi_crop
+ install_exact_roi_crop(ViTDetDataset)
+ ViTDetDataset._roi_installed=True
+ camera=str(source.cam_name)
+ masks=Path(masks_path)/camera/'masks'
+ ids=list(range(1,max(int(p.stem.split('_')[2]) for p in masks.glob('*.png'))+1))
+ count=len(source)
+ arrays={k:np.zeros((count,len(ids),cfg.num_joints,3 if k=='landmarks' else 1),dtype=np.float32) for k in ['landmarks','visibilities','contacts','floor_contacts']}
+ queue=[];times={'crop_seconds':0.,'inference_seconds':0.,'decode_seconds':0.,'calls':0,'items':0}
+ def flush():
+ if not queue:return
+ items=default_collate([x[2] for x in queue])
+ img=items['img'].to(device);mask=items['mask'].to(device)
+ torch.cuda.synchronize();start=time.perf_counter()
+ with torch.inference_mode():
+ output=model(img,mask)
+ torch.cuda.synchronize();times['inference_seconds']+=time.perf_counter()-start
+ points=output['joints2d'].float().cpu().numpy()
+ if cfg.data['train']['normalize_plus_min_one']:
+ points[:,:,:2]=(points[:,:,:2]+1)/2
+ # Backproject exactly as upstream, per crop, without image readback.
+ centers=items['box_center'].float().numpy();sizes=items['box_size'].float().numpy()
+ for dim in (0,1):points[:,:,dim]=points[:,:,dim]*sizes[:,None,dim]-sizes[:,None,dim]/2+centers[:,None,dim]
+ signals={k:torch.sigmoid(output[v].squeeze(-1).float()).cpu().numpy() for k,v in [('visibilities','visibility'),('contacts','contact'),('floor_contacts','floor_contact')]}
+ for j,(frame,person,_) in enumerate(queue):
+ arrays['landmarks'][frame,person]=points[j]
+ for key,values in signals.items():arrays[key][frame,person,:,0]=values[j]
+ times['calls']+=1;times['items']+=len(queue);queue.clear()
+ for frame in range(count):
+ start=time.perf_counter();image=cv2.cvtColor(source.read_rgb(frame),cv2.COLOR_RGB2BGR);times['decode_seconds']+=time.perf_counter()-start
+ for person,pid in enumerate(ids):
+ path=masks/f'mask_{frame:04d}_{pid:02d}.png'
+ mask=cv2.imread(str(path),cv2.IMREAD_GRAYSCALE) if path.exists() else None
+ if mask is None or np.sum(mask)/mask.size<.01:continue
+ ys,xs=np.where(mask);boxes=np.array([[xs.min(),ys.min(),xs.max(),ys.max()]])
+ start=time.perf_counter();dataset=ViTDetDataset(cfg,image,mask,boxes=boxes)
+ item=dataset[0];times['crop_seconds']+=time.perf_counter()-start
+ queue.append((frame,person,item))
+ if len(queue)>=batch_size:flush()
+ if frame%10==0:print(f'FAST camera={camera} frame={frame}/{count}',flush=True)
+ flush()
+ # Match upstream squeeze(-1) signal layout.
+ for key in ('visibilities','contacts','floor_contacts'):arrays[key]=arrays[key][...,0]
+ np.savez(Path(out_folder)/f'{camera}.npz',**arrays,contacts_gt=None,floor_contacts_gt=None)
+ (Path(os.environ['MAMMA_SPEED_DIR'])/f'profile-{camera}.json').write_text(json.dumps(times,indent=2))
+ print('FAST_PROFILE '+json.dumps(times),flush=True)
diff --git a/installer/runtime-lock.json b/installer/runtime-lock.json
index 2e1a2fd..fff5ca3 100644
--- a/installer/runtime-lock.json
+++ b/installer/runtime-lock.json
@@ -2244,6 +2244,6 @@
"uv_sha256": "4075a09490327d2bedfacc807fa48252fb93647c5bd7ef28f00e579160ea3fb5",
"all_runtimes": true,
"models_included": false,
- "registry_sha256": "d9caa1b0e8105cbe02a21134f18c89817926bb0a779134e90816782d1febf622",
- "id": "76ced5706ffa27d4ee8383b1ef02e385012c7af3b54b47c3184ab05827cc3057"
-}
\ No newline at end of file
+ "registry_sha256": "a210a4bee2802b0d7ce539fa53995062245b1d35bbbbf14f112e099e5412d36e",
+ "id": "c156b3130b170cdf1bcbb27f2d928e35d0952ca81f7208dc0c734f09fc346290"
+}
diff --git a/installer/verify_mamma.py b/installer/verify_mamma.py
new file mode 100644
index 0000000..fbd29be
--- /dev/null
+++ b/installer/verify_mamma.py
@@ -0,0 +1,58 @@
+"""Verify pinned dependencies and actual native CUDA kernels, without weights."""
+from pathlib import Path
+import argparse
+import base64
+import hashlib
+import importlib.metadata as metadata
+import json
+import sys
+
+
+def verify(lock):
+ if tuple(map(int,lock['python'].split('.')))!=sys.version_info[:3]:raise RuntimeError('MAMMA Python version mismatch.')
+ for p in lock['packages']:
+ if metadata.version(p['name'])!=p['version']:raise RuntimeError('MAMMA dependency mismatch: '+p['name'])
+ import torch,numpy,scipy,smplx,timm,torchvision,open_clip,cv2,sam2
+ from sam2 import _C
+ from pytorch_sdf import BVH,solid_angles_cuda
+ if not torch.cuda.is_available():raise RuntimeError('MAMMA requires an NVIDIA CUDA GPU.')
+ torch.set_num_threads(4);torch.manual_seed(17)
+ # Windows long/int64 and native-build mistakes must fail here, not on a video.
+ import trimesh
+ mesh=trimesh.creation.box(extents=[1,1,1])
+ tri=torch.tensor(numpy.asarray(mesh.triangles).copy(),dtype=torch.float32,device='cuda')[None]
+ pts=(torch.rand(1,101,3,device='cuda')*2-1).requires_grad_()
+ distance,closest,indices,_=BVH()(tri,pts)
+ _,reference,_=trimesh.proximity.closest_point_naive(mesh,pts.detach().cpu().numpy()[0])
+ error=float(numpy.max(numpy.abs(distance.detach().cpu().numpy()[0]-reference**2)))
+ distance.sum().backward();gradient_error=float((pts.grad-2*(pts.detach()-closest)).abs().max())
+ if error>2e-6 or gradient_error>2e-6 or indices.min()<0 or indices.max()>=len(mesh.faces):raise RuntimeError('SDF CUDA validation failed.')
+ probes=torch.tensor([[[0.,0.,0.],[2.,0.,0.]]],device='cuda')
+ winding=solid_angles_cuda.solid_angles_cuda(probes,tri,1e-8).sum(-1)/(4*torch.pi)
+ if abs(abs(float(winding[0,0]))-1)>1e-4 or abs(float(winding[0,1]))>1e-4:raise RuntimeError('SDF winding validation failed.')
+ mask=torch.zeros((1,1,8,8),device='cuda',dtype=torch.uint8);mask[:,:,2:4,2:4]=1
+ from sam2.utils.misc import get_connected_components
+ labels,areas=get_connected_components(mask)
+ if int(areas[0,0,2,2])!=4:raise RuntimeError('SAM 2 CUDA components validation failed.')
+ checked=0
+ for name in [p['name'] for p in lock['packages']]+['SAM-2','pytorch_sdf']:
+ distribution=metadata.distribution(name)
+ for entry in distribution.files or []:
+ if not entry.hash or entry.hash.mode!='sha256' or Path(entry).suffix.lower() in ('.pyc','.pyo','.lib','.exp','.pdb','.obj','.o','.a','.ilk'):continue
+ path=Path(distribution.locate_file(entry))
+ hasher=hashlib.sha256()
+ with path.open('rb') as stream:
+ for block in iter(lambda:stream.read(1024**2),b''):hasher.update(block)
+ value=hasher.digest()
+ if base64.urlsafe_b64encode(value).decode().rstrip('=')!=entry.hash.value:
+ raise RuntimeError('MAMMA installed file failed verification: '+str(entry))
+ checked+=1
+ return dict(python=sys.version.split()[0],packages=len(lock['packages'])+2,verified_files=checked,
+ gpu=torch.cuda.get_device_name(),cuda=torch.version.cuda,
+ sdf_error=error,sdf_gradient_error=gradient_error,sam2_components=True)
+
+
+if __name__=='__main__':
+ parser=argparse.ArgumentParser();parser.add_argument('--lock',required=True,type=Path);parser.add_argument('--output',required=True,type=Path)
+ args=parser.parse_args();report=verify(json.loads(args.lock.read_text()))
+ args.output.write_text(json.dumps(report,indent=2),encoding='utf-8');print(json.dumps(report),flush=True)
diff --git a/mamma_worker_boot.py b/mamma_worker_boot.py
new file mode 100644
index 0000000..0bb5a60
--- /dev/null
+++ b/mamma_worker_boot.py
@@ -0,0 +1,39 @@
+"""Optional MAMMA worker, isolated from the editor's Python dependencies."""
+from pathlib import Path
+import sys
+root = Path(__file__).resolve().parent
+sys.path.insert(0, str(root))
+import os
+os.environ.setdefault('RGB_MOCAP_WORKER_THREADS','4')
+from mocap.compute_policy import configure_worker_cpu
+configure_worker_cpu(sys.argv[1])
+for stream in (sys.stdout, sys.stderr):
+ if hasattr(stream, 'reconfigure'):
+ stream.reconfigure(encoding='utf-8', errors='backslashreplace')
+from mocap.mamma_runtime import activate
+engine = activate()
+import atexit,time,json
+started=time.monotonic()
+stage=sys.argv[1]
+request_path=sys.argv[sys.argv.index('--request')+1] if '--request' in sys.argv else None
+def report_resources():
+ try:
+ import psutil
+ info=psutil.Process().memory_info()
+ torch=sys.modules.get('torch')
+ cuda=bool(torch is not None and torch.cuda.is_initialized())
+ row=dict(stage=stage,process_seconds=time.monotonic()-started,
+ peak_working_set_bytes=getattr(info,'peak_wset',info.rss),
+ cuda_peak_allocated_bytes=torch.cuda.max_memory_allocated() if cuda else 0,
+ cuda_peak_reserved_bytes=torch.cuda.max_memory_reserved() if cuda else 0)
+ print('@@MOCAP@@'+json.dumps(dict(type='resource_usage',**row)),flush=True)
+ if request_path:
+ from mocap.mamma_pipeline import request,work_for
+ job=request(request_path)
+ from mocap.storage import atomic_json
+ suffix='-cache-resources.json' if job.get('cached') else '-resources.json'
+ atomic_json(work_for(job)/(row['stage']+suffix),row)
+ except Exception:pass
+atexit.register(report_resources)
+from mocap.mamma_pipeline import main
+raise SystemExit(main(sys.argv[1:], engine=engine))
diff --git a/mocap/correction.py b/mocap/correction.py
index 21e7997..f49dfec 100644
--- a/mocap/correction.py
+++ b/mocap/correction.py
@@ -566,7 +566,8 @@ def run(project,emit,result):
torch.set_num_threads(worker_threads('correct'))
project=Path(project)
cleanup_orphans(project)
- model=MODELS/'body_models/smplx/SMPLX_NEUTRAL.npz'
+ from .mamma_body import body_path
+ model=body_path(project)
model_stamp=file_stat(model)
body=smplx.SMPLX(str(model),gender='neutral',num_pca_comps=12,flat_hand_mean=False,batch_size=1).eval()
manifest=json.loads((project/'project.json').read_text(encoding='utf-8'))
diff --git a/mocap/export.py b/mocap/export.py
index d366e69..9792a0d 100644
--- a/mocap/export.py
+++ b/mocap/export.py
@@ -56,14 +56,20 @@ def export_project(project: Path, result="auto"):
from .motion_tools import require_supported_project
require_supported_project(project)
from .engines import activate, link_models
- root = activate("GVHMR")
- link_models(root)
+ import json
+ mamma=json.loads((project/"project.json").read_text(encoding="utf-8")).get("pipeline",{}).get("model")=="mamma"
+ if not mamma:
+ root = activate("GVHMR")
+ link_models(root)
import torch
- from hmr4d.utils.smplx_utils import make_smplx
+ if not mamma:
+ from hmr4d.utils.smplx_utils import make_smplx
from .result_artifacts import begin_update,commit_artifacts,file_stat
from .models import BY_KEY
- model_stamp=file_stat(BY_KEY['smplx'].path)
- body = make_smplx("supermotion").eval()
+ from .mamma_body import body_path,model_for
+ registered_body=body_path(project)
+ model_stamp=file_stat(registered_body)
+ body = model_for(project) if mamma else make_smplx("supermotion").eval()
result = resolve_motion_result(project, result)
import json
fps=float(json.loads((project/'project.json').read_text(encoding='utf-8')).get('fps',30)) if (project/'project.json').exists() else 30.
@@ -91,7 +97,7 @@ def export_project(project: Path, result="auto"):
prepare_mesh_preview(project, kinds=[name for name, _ in motions])
from .mixamo_data import prepare as prepare_target
prepare_target(project,result,body=body)
- if file_stat(BY_KEY['smplx'].path)!=model_stamp or not all(result_is_current(project,name) for name,_ in motions):
+ if file_stat(registered_body)!=model_stamp or not all(result_is_current(project,name) for name,_ in motions):
raise ValueError('Motion inputs changed during export. Run export again.')
for name,_ in motions:commit_artifacts(project,name,source_stamps[name],fps)
state=json.loads((project/'project.json').read_text(encoding='utf-8')) if (project/'project.json').exists() else {}
@@ -104,11 +110,12 @@ def export_project(project: Path, result="auto"):
"footmr_initial":"GVHMR + FootMR", "footmr_refined":"GVHMR + HTD-Refine + FootMR"}[body_result(result)]
exmr=state.get('pipeline',{}).get('model')=='exmr'
if exmr:label='ExMR original'
+ if mamma:label='MAMMA original'
from .motion_tools import has_handflow
if has_handflow(result):label+=' + HandFlow'
atomic_json(project / "export.json", {"format": "BVH", "frames": len(selected["body_pose"]), "fps": fps,
"length_unit": "meter", "up_axis": "Y", "rotation_order": target_record.get("export_bind",{}).get("rotation_order_default","ZXY"), "joints": target_record['names'],
- "skeleton":"Humanoid52", "finger_motion":"ExMR native finger inference" if exmr else "HandFlow finger inference; body and wrists preserved" if has_handflow(result) else "Source relaxed pose animated relative to open bind; finger inference is not enabled",
+ "skeleton":"Humanoid52", "finger_motion":"MAMMA fitted body and finger motion" if mamma else "ExMR native finger inference" if exmr else "HandFlow finger inference; body and wrists preserved" if has_handflow(result) else "Source relaxed pose animated relative to open bind; finger inference is not enabled",
"bind_pose":target_record.get('export_bind',{}),
"result_kind": result, "source": label + (" + Motion Correction" if result.startswith('corrected_') else '') + " SMPL-X motion",
"ground_truth_accuracy": None})
diff --git a/mocap/gui.py b/mocap/gui.py
index 4919615..2fd3e42 100644
--- a/mocap/gui.py
+++ b/mocap/gui.py
@@ -1,5 +1,7 @@
from __future__ import annotations
from .tooltips import tooltip_text
+from .ui_refresh import batch_readiness
+from .validation_snapshot import read_only_checks
import json
import math
@@ -36,6 +38,7 @@ from .workspace_ui import build_workspace
from .people_ui import PeopleWorkspace
from .project_save_ui import ProjectSaving
from .project_workspace_ui import ModelWorkspace
+STAGES.update(mamma_prepare='Prepare Multi-view Videos',mamma_masks='MAMMA Person Masks',mamma_landmarks='MAMMA Surface Landmarks',mamma_camera='MAMMA Cameras',mamma_fit='MAMMA 3D Fit',mamma_publish='MAMMA Motion Correction and Preview')
STAGES['save_project']='Save Project As'
STAGES.update(people='Find People',person='Prepare Person Motion')
STAGES.update(flow_camera='Estimate Scene Camera / VGGT-Omega', flow_features='Extract Body and Hand Features / SAM', flowhmr='Reconstruct Motion / FlowHMR', flow_export='Prepare FlowHMR Preview and FBX', import_model='Import Model')
@@ -121,7 +124,8 @@ class ModelsDialog(QDialog):
self.window = window
self.tool = MOTION_TOOLS[tool_key or window.model_choice.currentData()]
from .models import STAGE_REQUIREMENTS
- keys = {key for stage in (*self.tool.stages(refine=True, footmr=True, handflow=True),'people') for key in STAGE_REQUIREMENTS.get(stage, ())}
+ keys = ({key for key in STAGE_REQUIREMENTS['mamma_assets']} if self.tool.key=='mamma' else
+ {key for stage in (*self.tool.stages(refine=True, footmr=True, handflow=True),'people') for key in STAGE_REQUIREMENTS.get(stage, ())})
# Keep public automatic downloads together, followed by manual-only files.
# Stable sorting preserves the existing component order within each group.
self.models = sorted((model for model in MODELS_LIST if model.key in keys),
@@ -132,6 +136,9 @@ class ModelsDialog(QDialog):
description = QLabel(f"Models for {self.tool.label} and compatible add-ons.\nUse Auto Download for public files, or Manual Download and Import for any model.\nRegistered body model files are not redistributed by this app.")
description.setWordWrap(True)
layout.addWidget(description)
+ if self.tool.key=='mamma':
+ from .mamma_manager import runtime_panel
+ layout.addWidget(runtime_panel(self))
self.table = QTableWidget(len(self.models), 3)
self.table.setHorizontalHeaderLabels(["Model", "Status", "Action"])
self.table.horizontalHeader().setStretchLastSection(True)
@@ -185,6 +192,7 @@ class ModelsDialog(QDialog):
if item is None:
item = QTableWidgetItem(); self.table.setItem(i, column, item)
item.setText(text)
+ if column==0:item.setToolTip(str(model.path))
item.setForeground(QColor("#d5d5d5" if available else "#ffb45c"))
font = item.font(); font.setBold(not available); item.setFont(font)
cell = self.table.cellWidget(i, 2)
@@ -319,14 +327,16 @@ class ModelsDialog(QDialog):
from .character_ui import CharacterWorkspace
+from .mamma_ui import MammaWorkspace
-class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace,QMainWindow):
+class MainWindow(MammaWorkspace,CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace,QMainWindow):
def __init__(self, video: Path | None = None):
super().__init__()
self.setWindowTitle("RGB MoCap | Motion Workspace")
self.resize(1440, 880)
self.setMinimumSize(1100, 700)
self.video_path = None
+ self.init_mamma()
self.project = None
self.workspace_root=None
self._workspace_loading=False
@@ -401,7 +411,11 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
if video:
self.load_video(video)
+ @read_only_checks
def update_readiness(self):
+ if getattr(self,'_readiness_depth',0):
+ self._readiness_pending=True
+ return
if hasattr(self,'character_loader'):self.sync_characters()
self.update_people_readiness()
tool = MOTION_TOOLS[self.model_choice.currentData()]
@@ -410,6 +424,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
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')
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"
@@ -456,6 +471,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.exmr_smoothing.setEnabled(not self.busy)
self.analyze_button.setVisible(tool.key=='gvhmr')
self.sync_correction_floor_preview()
+ self.sync_mamma_controls()
def sync_correction_floor_preview(self):
self.motion_view.correction_floor_applicable=self.correction_mode.currentData()=='flat'
@@ -520,6 +536,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.slider.update()
self.correction_description.setText('Only checked contact types are corrected. Uses the selected '+tool.label+' result.')
self.analyze_button.setToolTip(tooltip_text('Find body points in the video for GVHMR refinement. Reconstruct 3D normally includes this step when needed.'))
+ self.mamma_mode_changed(previous,tool.key)
self.update_readiness()
def selected_result(self, correction=None):
@@ -534,7 +551,8 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
def current_export(self):
info=self.contact_tracks.get(base_result(self.active_result))
if self.active_result.startswith('corrected_') and (self.contact_saving or (info and info.get('unsaved'))):return None
- if self.project is not None and result_is_current(self.project, self.active_result):
+ # selected_export checks source, correction and target receipts itself.
+ if self.project is not None:
return selected_export(self.project, self.active_result)
return None
@@ -597,13 +615,20 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.update_readiness()
def choose_video(self):
+ if self.model_choice.currentData()=='mamma':
+ names,_=QFileDialog.getOpenFileNames(self,'Open MAMMA Camera Videos','', 'Videos (*.mp4 *.mov *.avi *.mkv *.webm)')
+ if names:self.load_mamma_videos(names)
+ return
name, _ = QFileDialog.getOpenFileName(self, "Open Video", "", "Videos (*.mp4 *.mov *.avi *.mkv *.webm)")
if name:
self.load_video(Path(name))
def load_video(self, path):
+ if self.model_choice.currentData()=='mamma':
+ return self.load_mamma_videos([path])
try:
if self.workspace_root is not None:self.remember_workspace_model()
+ self.clear_mamma_inputs()
self.workspace_root=None;self._workspace_video_reference=False;self._workspace_camera=None
self.stop_playback()
self.clear_preview()
@@ -635,6 +660,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
QMessageBox.warning(self, "Video Error", str(error))
def video_ready(self, info):
+ if self.mamma_video_ready(info):return
self.video_readable = True
self.slider.set_media(self.info["fps"] if self.info else info["fps"])
if self.project is None and not self._workspace_video_reference:
@@ -670,6 +696,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.load_project(project)
except (OSError,ValueError,KeyError) as error:self.status.setText('Cannot open project: '+str(error))
+ @batch_readiness
def load_project(self, project):
from .project_workspace import is_workspace
if is_workspace(project):return self.open_workspace(project)
@@ -684,10 +711,15 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
except UnsupportedMotionTool as error:
self.status.setText(str(error))
return False
+ manifest = json.loads((project / "project.json").read_text(encoding="utf-8"))
+ if manifest.get('pipeline',{}).get('model')=='mamma':
+ group=(project/manifest.get('people_root','.')).resolve()
+ if (group/'mamma_pending.json').exists():
+ self.status.setText('MAMMA publication is incomplete. Reconstruct again to finish; previous projects were preserved.')
+ return False
self.stop_playback()
self.clear_preview()
self.motion_view.auto_fit = True
- manifest = json.loads((project / "project.json").read_text(encoding="utf-8"))
self.project = project
self.workspace_project_loaded(project,manifest)
from .project_storage import storage_root
@@ -733,7 +765,10 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.info = {"fps": fps, "frames": manifest["frames"], "duration": manifest["frames"] / fps}
self.source_offset, self.source_end = manifest["start"], manifest["end"]
self.slider.set_media(fps)
- self.video_view.open(select_preview(project), (manifest["width"], manifest["height"]))
+ # MAMMA restores its selected camera below. Opening the actor's default
+ # clip first discards that decoder and its cache on every row selection.
+ if not (pipeline.get('model')=='mamma' and self.mamma_inputs and self.mamma_thumbnail_buttons):
+ self.video_view.open(select_preview(project), (manifest["width"], manifest["height"]))
self.slider.setRange(0, manifest["frames"] - 1)
self.filename.setText(f"{self.video_path.name} · Project loaded · {manifest['frames']} frames")
self.slider.reset_trim()
@@ -754,6 +789,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.slider.setValue(max(0,min(int(workspace.get('frame',0)),manifest['frames']-1)))
self.seek(self.slider.value())
self.update_readiness()
+ self.mamma_project_loaded(project,manifest)
return True
def seek(self, index):
@@ -850,6 +886,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.timer.start(max(1, math.ceil(remaining * 1000)))
def shutdown_preview(self):
+ self.shutdown_mamma()
self.stop_playback()
if hasattr(self,'character_loader'):
self.character_loader.close();self.character_assets.clear()
@@ -875,6 +912,9 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
super().hideEvent(event)
def input_jobs(self, stages, result=None):
+ if MOTION_TOOLS[self.model_choice.currentData()].input_setup_only:
+ self.status.setText('MAMMA camera input setup is available; reconstruction is not integrated yet.')
+ return
if self.video_path is None:
self.choose_video()
return
@@ -919,6 +959,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
def run_full(self):
tool = MOTION_TOOLS[self.model_choice.currentData()]
+ if tool.key=='mamma':return self.run_mamma()
if tool.key=='exmr' and self.people_root is not None:
from .storage import atomic_json
path=self.people_root/'project.json';state=json.loads(path.read_text(encoding='utf-8'))
@@ -1192,6 +1233,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
'flow_camera', 'flow_features', 'flowhmr',
'exmr_preprocess', 'exmr_features', 'exmr'}:
self._batch_has_motion = True
+ if stage.startswith('mamma_'):self._batch_has_motion=True
self.current_stage = stage
if arguments is None:
arguments = ["--project", str(self.project)]
@@ -1282,7 +1324,11 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
if self.people_event(event):
self._queued_task_estimates=[self.task_descriptor(s,a) for s,a in self.jobs]
self.update_task_progress();return
- if kind == "prepared":
+ if kind=='mamma_ready':
+ self.workspace_root=Path(event['root'])
+ self.load_project(Path(event['project']))
+ self.set_active_result(event['result'])
+ elif kind == "prepared":
self._task_preparing=False
self._task_manifests={}
self.project = Path(event["project"])
@@ -1418,6 +1464,7 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.preview_data.close()
self.preview_data = None
+ @batch_readiness
def preview_ready(self, generation, result):
if generation != self.data_loader.generation:
result.close()
@@ -1442,6 +1489,8 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
self.restore_workspace_camera(consume=True)
if previous is not None:previous.close()
+ @batch_readiness
+ @read_only_checks
def apply_preview(self):
data = self.preview_data
signature=project_signature(data.project)
@@ -1623,7 +1672,8 @@ class MainWindow(CharacterWorkspace,ModelWorkspace,ProjectSaving,PeopleWorkspace
def dropEvent(self, event):
urls = event.mimeData().urls()
if urls and not self.busy:
- self.load_video(Path(urls[0].toLocalFile()))
+ if self.model_choice.currentData()=='mamma':self.load_mamma_videos([Path(url.toLocalFile()) for url in urls])
+ else:self.load_video(Path(urls[0].toLocalFile()))
def closeEvent(self, event):
if self.busy and self.process:
diff --git a/mocap/mamma_body.py b/mocap/mamma_body.py
new file mode 100644
index 0000000..cb72057
--- /dev/null
+++ b/mocap/mamma_body.py
@@ -0,0 +1,148 @@
+"""Exact MAMMA body-data bridge. Never substitute the standard SMPL-X model.
+
+The editor's GPU skin format has ten shape slots. For a constant 16-beta
+MAMMA actor, fold the final six linear shape terms into a private template.
+This is algebraically exact, not a shape approximation or a motion refit.
+All derived body data stays in the user's project, under its original license.
+"""
+from pathlib import Path
+import hashlib
+import json
+import os
+import uuid
+import numpy as np
+from .storage import atomic_json
+from .result_artifacts import file_stat
+
+VERSION = 1
+WORLD_ROTATION = np.array([[1., 0., 0.], [0., 0., 1.], [0., -1., 0.]])
+
+
+def body_path(project):
+ """Resolve a project-private registered body; no fallback on bad metadata."""
+ project = Path(project).resolve()
+ state = json.loads((project/'project.json').read_text(encoding='utf-8'))
+ if state.get('pipeline', {}).get('model') != 'mamma':
+ from .models import BY_KEY
+ return BY_KEY['smplx'].path
+ entry = state.get('mamma_body')
+ if not isinstance(entry, dict):
+ raise ValueError('MAMMA actor body data is missing. Prepare its source result again.')
+ name = entry.get('file', '')
+ path = (project/name).resolve()
+ if not name or not path.is_relative_to(project) or path == project:
+ raise ValueError('Invalid MAMMA body data path.')
+ if not path.is_file() or file_stat(path) != entry.get('stat'):
+ raise ValueError('MAMMA actor body data changed or is missing; the result was preserved.')
+ return path
+
+
+def model_for(project):
+ import smplx
+ return smplx.SMPLX(str(body_path(project)), gender='neutral', num_pca_comps=12,
+ flat_hand_mean=False, batch_size=1).eval()
+
+
+def make_actor_body(source, betas, project):
+ source, project = Path(source), Path(project)
+ source_stamp=file_stat(source)
+ beta = np.asarray(betas, np.float64).reshape(-1)
+ if beta.shape != (16,) or not np.isfinite(beta).all():
+ raise ValueError('MAMMA requires sixteen constant finite shape coefficients.')
+ # Registered model NPZs are arrays, never arbitrary pickled Python objects.
+ required = ('shapedirs', 'v_template', 'f', 'J_regressor', 'posedirs',
+ 'kintree_table', 'weights', 'hands_componentsl', 'hands_componentsr',
+ 'hands_meanl', 'hands_meanr', 'lmk_faces_idx', 'lmk_bary_coords')
+ with np.load(source, allow_pickle=False) as archive:
+ data = {key: archive[key] for key in required}
+ for key in ('dynamic_lmk_faces_idx', 'dynamic_lmk_bary_coords'):
+ if key in archive.files:
+ data[key] = archive[key]
+ dirs, template = data['shapedirs'], data['v_template']
+ if dirs.shape[:2] != (10475, 3) or dirs.shape[-1] < 310 or template.shape != (10475, 3):
+ raise ValueError('Import the supported locked-head SMPL-X NPZ, including its expression directions.')
+ if not np.isfinite(dirs).all() or not np.isfinite(template).all():
+ raise ValueError('The registered body model contains non-finite data.')
+ delta = np.einsum('vci,i->vc', dirs[..., 10:16].astype(np.float64), beta[10:])
+ data['v_template'] = (template.astype(np.float64)+delta).astype(template.dtype)
+ if file_stat(source)!=source_stamp:raise ValueError('The registered MAMMA body changed during conversion.')
+ from .storage import sha256
+ token = hashlib.sha256((sha256(Path(__file__))+str(VERSION)+str(source_stamp)+beta.tobytes().hex()).encode()).hexdigest()[:20]
+ destination = project/'body'/('SMPLX_NEUTRAL-'+token+'.npz')
+ destination.parent.mkdir(parents=True, exist_ok=True)
+ receipt=destination.with_suffix('.receipt.json')
+ existing=False
+ try:existing=json.loads(receipt.read_text(encoding='utf-8')).get('stat')==file_stat(destination)
+ except (OSError,ValueError,TypeError):pass
+ if destination.exists() and not existing:
+ # Never certify or overwrite an unverified derived model. An old
+ # renderer may still own arrays from its immutable generation.
+ destination=destination.with_name(destination.stem+'-'+uuid.uuid4().hex[:12]+'.npz')
+ receipt=destination.with_suffix('.receipt.json')
+ if not existing:
+ temporary = destination.with_name('.'+uuid.uuid4().hex+'.npz')
+ try:
+ np.savez_compressed(temporary, **data)
+ os.replace(temporary, destination)
+ atomic_json(receipt,dict(version=VERSION,stat=file_stat(destination)))
+ finally:
+ temporary.unlink(missing_ok=True)
+ expected = template.astype(np.float64)+np.einsum('vci,i->vc', dirs[..., :16].astype(np.float64), beta)
+ actual = data['v_template'].astype(np.float64)+np.einsum('vci,i->vc', dirs[..., :10].astype(np.float64), beta[:10])
+ error = float(np.abs(expected-actual).max())
+ if error > 1e-6:
+ raise ValueError('MAMMA body conversion did not preserve registered geometry.')
+ return dict(version=VERSION, file=destination.relative_to(project).as_posix(),
+ stat=file_stat(destination), source_stat=file_stat(source),
+ original_betas=beta.tolist(), template_error_max_m=error,
+ license='Derived registered SMPL-X data; do not redistribute.')
+
+
+def convert_motion(pose, betas, translation, body):
+ """Z-up MAMMA world to Y-up editor, around the shaped pelvis pivot."""
+ import torch
+ from scipy.spatial.transform import Rotation
+ pose = np.asarray(pose, np.float32)
+ trans = np.asarray(translation, np.float32)
+ beta = np.asarray(betas, np.float32).reshape(1, 16)
+ n = len(pose)
+ if pose.shape != (n, 165) or trans.shape != (n, 3) or n < 1:
+ raise ValueError('Invalid MAMMA frame/pose/translation dimensions.')
+ if not all(np.isfinite(a).all() for a in (pose, trans, beta)):
+ raise ValueError('MAMMA motion contains non-finite data.')
+ shaped = body.v_template.detach().numpy()+np.einsum('vci,i->vc', body.shapedirs.detach().numpy(), beta[0, :10])
+ pelvis = body.J_regressor.detach().numpy()[0]@shaped
+ root = Rotation.from_matrix([email protected]_rotvec(pose[:, :3]).as_matrix()).as_rotvec().astype(np.float32)
+ moved = ((trans+pelvis)@WORLD_ROTATION.T-pelvis).astype(np.float32)
+ # MAMMA's cached parameters already include the body's non-flat hand mean
+ # convention. Do not subtract/re-add it as though these were ExMR angles.
+ params = dict(global_orient=torch.from_numpy(root), body_pose=torch.from_numpy(pose[:, 3:66].copy()),
+ jaw_pose=torch.from_numpy(pose[:, 66:69].copy()), leye_pose=torch.from_numpy(pose[:, 69:72].copy()),
+ reye_pose=torch.from_numpy(pose[:, 72:75].copy()), left_hand_pose=torch.from_numpy(pose[:, 75:120].copy()),
+ right_hand_pose=torch.from_numpy(pose[:, 120:165].copy()), transl=torch.from_numpy(moved),
+ betas=torch.from_numpy(np.repeat(beta[:, :10], n, axis=0)), expression=torch.zeros(n, 10))
+ return params
+
+
+def contact_probabilities(body, betas, downsample, floor_contact):
+ """Map MAMMA surface support to the existing four sole-region inputs."""
+ weights = body.lbs_weights.detach().numpy()
+ shaped = body.v_template.detach().numpy()+np.einsum('vci,i->vc', body.shapedirs.detach().numpy(), np.asarray(betas)[:10])
+ D = np.asarray(downsample)
+ probabilities = np.asarray(floor_contact, np.float32)
+ if D.shape != (512, 10475) or probabilities.ndim != 2 or probabilities.shape[1] != 512:
+ raise ValueError('Invalid MAMMA contact topology.')
+ if not np.isfinite(D).all() or not np.isfinite(probabilities).all():
+ raise ValueError('Non-finite MAMMA contact data.')
+ points, skin = D@shaped, D@weights
+ result = []
+ for ankle, toe in ((7, 10), (8, 11)):
+ ids = np.flatnonzero(skin[:, ankle]+skin[:, toe] > .6)
+ physical = np.flatnonzero(weights[:, ankle]+weights[:, toe] > .6)
+ middle = np.median(shaped[physical, 2])
+ for front in (False, True):
+ region = ids[(points[ids, 2] >= middle) if front else (points[ids, 2] <= middle)]
+ if not len(region):
+ raise ValueError('MAMMA sole landmark region is empty.')
+ result.append(probabilities[:, region].max(1))
+ return np.clip(np.stack(result, axis=1), 0, 1)
diff --git a/mocap/mamma_camera.py b/mocap/mamma_camera.py
new file mode 100644
index 0000000..f0099e5
--- /dev/null
+++ b/mocap/mamma_camera.py
@@ -0,0 +1,135 @@
+"""VGGT fixed-camera estimation and explicit original-pixel calibration.
+
+Metric scale and gravity are priors when calibration is absent; they are not
+measured scene geometry. No per-frame camera or body-pose smoothing is added.
+"""
+from pathlib import Path
+import json
+import sys
+import numpy as np
+from scipy.spatial.transform import Rotation
+from .storage import atomic_json
+
+
+def infer(work,job,emit):
+ import cv2,torch,gc
+ from .models import BY_KEY
+ from .paths import ROOT
+ sys.path.insert(0,str(ROOT/'third_party/FlowHMR/third_party/vggt-omega'))
+ from vggt_omega.models import VGGTOmega
+ from vggt_omega.utils.load_fn import load_and_preprocess_images,_balanced_target_shape
+ from vggt_omega.utils.pose_enc import encoding_to_camera
+ entries=json.loads((work/'inputs.json').read_text(encoding='utf-8'))
+ frames=job['frames'];first=0
+ def frame(entry,index):
+ cap=cv2.VideoCapture(entry['path'])
+ try:
+ cap.set(cv2.CAP_PROP_POS_FRAMES,index);ok,im=cap.read()
+ if not ok:raise ValueError('Cannot read a VGGT camera frame.')
+ return im
+ finally:cap.release()
+ for f in sorted(set(min(frames-1,x) for x in (0,10,20,30))):
+ if all(float(frame(e,f).mean())>20 for e in entries):first=f;break
+ else:raise ValueError('The initial camera images are too dark for VGGT. Adjust the common trim.')
+ selected=sorted(set((first,min(max(first+30,60),frames-1),min(max(first+60,90),frames-1))))
+ images_dir=work/'camera-images';images_dir.mkdir(exist_ok=True)
+ paths=[];sizes=[];camera_ids=[]
+ for f in selected:
+ for c,entry in enumerate(entries):
+ im=frame(entry,f);h,w=im.shape[:2]
+ if not .5<=h/w<=2:raise ValueError('VGGT camera calibration currently requires image aspect ratios between 1:2 and 2:1.')
+ for mask in (work/'clean-masks/motion'/entry['id']/'masks').glob(f'mask_{f:04}_*.png'):
+ m=cv2.imread(str(mask),0)
+ if m is None:raise ValueError('Unreadable camera exclusion mask.')
+ y,x=np.where(m>127)
+ if len(x):im[max(0,y.min()-18):min(h,y.max()+19),max(0,x.min()-18):min(w,x.max()+19)]=0
+ path=images_dir/f'{f:06}-{c}.png'
+ if not cv2.imwrite(str(path),im):raise OSError('Cannot prepare a VGGT input image.')
+ paths.append(str(path));sizes.append((w,h,_balanced_target_shape(h/w,512,16)));camera_ids.append(c)
+ emit('progress',current=0,total=0,message=f'VGGT: estimate {len(entries)} fixed cameras from {len(paths)} background images')
+ model=VGGTOmega(enable_depth=False).eval()
+ state=torch.load(BY_KEY['flow_vggt'].path,map_location='cpu',mmap=True,weights_only=False)
+ model.load_state_dict({k:v for k,v in state.items() if not k.startswith('dense_head.')})
+ del state;gc.collect();model=model.cuda()
+ images=load_and_preprocess_images(paths,mode='balanced',image_resolution=512).cuda()
+ with torch.inference_mode():
+ prediction=model(images);E,K=encoding_to_camera(prediction['pose_enc'],images.shape[-2:])
+ E=E[0].cpu().numpy();K=K[0].cpu().numpy();H,W=images.shape[-2:]
+ for i,(w,h,(hh,ww)) in enumerate(sizes):
+ K[i,0,2]-=(W-ww)//2;K[i,1,2]-=(H-hh)//2
+ K[i,0,:]*=w/ww;K[i,1,:]*=h/hh
+ if not np.isfinite(E).all() or not np.isfinite(K).all():raise ValueError('VGGT returned invalid cameras.')
+ del model,images,prediction;gc.collect();torch.cuda.empty_cache()
+ ci=np.array(camera_ids);RR=[];tt=[];KK=[]
+ for c in range(len(entries)):
+ es=E[ci==c];r=Rotation.from_matrix(es[:,:,:3]).mean().as_matrix()
+ 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)
+ uv=[];vis=[]
+ for entry in entries:
+ with np.load(work/'landmarks/motion'/(entry['id']+'.npz'),allow_pickle=False) as z:
+ uv.append(z['landmarks'][...,:2]);vis.append(z['visibilities'])
+ uv=np.stack(uv,axis=3);vis=np.stack(vis,axis=3);U=uv.reshape(-1,len(entries),2);V=vis.reshape(-1,len(entries))
+ [email protected]((RR,tt[...,None]),axis=-1)
+ X=np.empty((len(U),3),np.float64)
+ for first in range(0,len(U),4096):
+ u=U[first:first+4096];weights=np.clip(V[first:first+4096],.05,1)
+ A=np.stack([v for c in range(len(entries)) for v in (
+ (u[:,c,0,None]*P[c,2]-P[c,0])*weights[:,c,None],
+ (u[:,c,1,None]*P[c,2]-P[c,1])*weights[:,c,None])],axis=1)
+ _,_,vh=np.linalg.svd(A,full_matrices=False)
+ X[first:first+len(u)]=vh[:,-1,:3]/vh[:,-1,3,None]
+ X=X.reshape(*uv.shape[:3],3)
+ if not np.isfinite(X).all():raise ValueError('VGGT ray geometry is degenerate. Use manual camera calibration or better-separated views.')
+ import pickle
+ with BY_KEY['mamma_vertices'].path.open('rb') as f:D=pickle.load(f).cpu().numpy()
+ with np.load(BY_KEY['mamma_body'].path,allow_pickle=False) as z:neutral=D@z['v_template']
+ head=neutral[:,1]>np.quantile(neutral[:,1],.94);sole=neutral[:,1]<np.quantile(neutral[:,1],.025)
+ train=np.arange(min(10,frames-1),min(60,frames),5);cal=X[train]
+ feet=np.median(cal[:,:,sole],axis=2);heads=np.median(cal[:,:,head],axis=2);vectors=heads-feet
+ 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]))
+ 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.')
+ origin=np.array([0.,0.,scale*np.median((cal[:,:,sole]@Q.T)[...,2])])
+ cameras={}
+ for c,entry in enumerate(entries):
+ 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.'))
+ return cameras
+
+
+def run(engine,work,job,emit):
+ import yaml
+ entries=json.loads((work/'inputs.json').read_text(encoding='utf-8'))
+ if job['options']['camera_mode']=='manual':
+ from .mamma_inputs import match_calibration
+ match_calibration(job['options']['calibration'],job['inputs'])
+ cameras={}
+ for entry in entries:
+ cam=dict(job['options']['calibration']['cameras'][entry['id']])
+ K=np.asarray(cam['intrinsic_matrix'],float);w,h=cam['image_size'];rw,rh=entry['size']
+ K[0]*=rw/w;K[1]*=rh/h
+ cameras[entry['id']]={**cam,'intrinsic_matrix':K.tolist(),'image_size':entry['size']}
+ else:cameras=infer(work,job,emit)
+ output={'cameras':{}}
+ for name,cam in cameras.items():
+ E=np.array(cam['extrinsics_matrix']);R=E[:,:3];K=np.array(cam['intrinsic_matrix'])
+ q=Rotation.from_matrix(R.T).as_quat()
+ output['cameras'][name]=dict(camera_model='pinhole',distortion_model='radtan',
+ intrinsics=[float(K[0,0]),float(K[1,1]),float(K[0,2]),float(K[1,2])],resolution=cam['image_size'],
+ translation=(-R.T@E[:,3]).tolist(),rotation_quaternion=q[[3,0,1,2]].tolist(),distortion_coeffs=cam.get('distortion_coeffs',[0.]*4))
+ (work/'calibration.yaml').write_text(yaml.safe_dump(output,sort_keys=False),encoding='utf-8')
+ atomic_json(work/'camera-world.json',cameras)
+ from .mamma_pipeline import run_script
+ run_script(engine,'capture','run_ma_cap.py',['--videos_dir',work/'videos','--calibration',work/'calibration.yaml',
+ '--cam_names',*[e['id'] for e in entries],'--out',work/'capture','--seq_name','motion','--start',0,'--end',job['frames']])
diff --git a/mocap/mamma_inputs.py b/mocap/mamma_inputs.py
new file mode 100644
index 0000000..89e68d1
--- /dev/null
+++ b/mocap/mamma_inputs.py
@@ -0,0 +1,149 @@
+"""Validated multi-view input metadata; no models, inference or Qt imports."""
+from pathlib import Path
+import hashlib
+import json
+import math
+import numpy as np
+
+
+def video_paths(paths):
+ paths = [Path(p).resolve() for p in paths]
+ if not paths:
+ raise ValueError('Choose at least one video.')
+ if len({str(p).casefold() for p in paths}) != len(paths):
+ raise ValueError('The same video was selected more than once.')
+ names = [p.stem for p in paths]
+ if len({n.casefold() for n in names}) != len(names):
+ raise ValueError('Use different video filenames so each camera has a unique name.')
+ return paths
+
+
+def common_media(entries, fps=30.):
+ if not entries:
+ raise ValueError('Open the camera videos first.')
+ for e in entries:
+ m = e['metadata']
+ if any(not math.isfinite(float(m[k])) or float(m[k]) <= 0
+ for k in ('fps', 'frames', 'duration', 'width', 'height')):
+ raise ValueError('A video has invalid timing or dimensions.')
+ duration = min(float(e['metadata']['duration']) for e in entries)
+ frames = int(math.floor(duration * fps + 1e-6))
+ if frames < 1:
+ raise ValueError('The videos have no common playback interval.')
+ return dict(fps=fps, frames=frames, duration=frames/fps,
+ width=entries[0]['metadata']['width'], height=entries[0]['metadata']['height'])
+
+
+def _rotation(matrix, name):
+ matrix = np.asarray(matrix, dtype=float)
+ if matrix.shape != (3, 3) or not np.isfinite(matrix).all() or not np.allclose(matrix.T@matrix, np.eye(3), atol=1e-4, rtol=0) or abs(np.linalg.det(matrix)-1) > 1e-4:
+ raise ValueError(f'{name}: camera rotation must be a proper 3D rotation.')
+ return matrix
+
+
+def read_calibration(path):
+ path = Path(path)
+ with path.open('rb') as f:
+ raw = f.read(1024*1024+1)
+ if len(raw) > 1024*1024:
+ raise ValueError('Camera calibration exceeds the 1 MiB limit.')
+ if path.suffix.lower() == '.json':
+ data = json.loads(raw.decode('utf-8-sig'))
+ elif path.suffix.lower() in {'.yaml', '.yml'}:
+ import yaml
+ data = yaml.safe_load(raw.decode('utf-8-sig'))
+ else:
+ raise ValueError('Choose a JSON or YAML camera calibration file.')
+ if not isinstance(data, dict):
+ raise ValueError('Camera calibration must contain named cameras.')
+ if data.get('units', 'metres') not in {'m', 'meter', 'meters', 'metre', 'metres'}:
+ raise ValueError('Camera translations must use metres.')
+ if data.get('extrinsics_convention', 'world_to_camera') != 'world_to_camera':
+ raise ValueError('JSON extrinsic matrices must use world_to_camera.')
+ cameras = data.get('cameras', data)
+ if not isinstance(cameras, dict) or not cameras:
+ raise ValueError('Camera calibration must contain named cameras.')
+ output = {}
+ for name, c in cameras.items():
+ if not isinstance(name, str) or not name or len(name) > 240 or not isinstance(c, dict):
+ raise ValueError('Each camera needs a name and camera parameters.')
+ if c.get('units', 'metres') not in {'m', 'meter', 'meters', 'metre', 'metres'}:
+ raise ValueError(f'{name}: camera translations must use metres.')
+ if c.get('camera_model', 'pinhole') != 'pinhole' or c.get('distortion_model', 'radtan') != 'radtan':
+ raise ValueError(f'{name}: only pinhole/radtan calibration is supported.')
+ if 'rotation_quaternion' in c:
+ # MAMMA YAML: camera-to-world pose, Hamilton quaternion [w,x,y,z].
+ q = np.asarray(c['rotation_quaternion'], float)
+ if q.shape != (4,) or not np.isfinite(q).all() or abs(np.linalg.norm(q)-1) > 1e-3:
+ raise ValueError(f'{name}: use a unit quaternion [w,x,y,z].')
+ w,x,y,z = q/np.linalg.norm(q)
+ r = _rotation([[1-2*(y*y+z*z),2*(x*y-z*w),2*(x*z+y*w)],
+ [2*(x*y+z*w),1-2*(x*x+z*z),2*(y*z-x*w)],
+ [2*(x*z-y*w),2*(y*z+x*w),1-2*(x*x+y*y)]], name)
+ t = np.asarray(c['translation'], float)
+ if t.shape != (3,) or not np.isfinite(t).all():
+ raise ValueError(f'{name}: invalid camera position.')
+ ext = np.column_stack([r.T, -r.T@t])
+ values = np.asarray(c['intrinsics'], float)
+ if values.shape != (4,):
+ raise ValueError(f'{name}: YAML intrinsics must be [fx,fy,cx,cy].')
+ fx,fy,cx,cy = values
+ k = np.array([[fx,0,cx],[0,fy,cy],[0,0,1.]])
+ size = c['resolution']
+ else:
+ k = np.asarray(c['intrinsic_matrix'], float)
+ ext = np.asarray(c['extrinsics_matrix'], float)
+ if ext.shape == (4,4):
+ if not np.allclose(ext[3], [0,0,0,1], atol=1e-6, rtol=0):
+ raise ValueError(f'{name}: invalid homogeneous camera matrix.')
+ ext = ext[:3]
+ if ext.shape != (3,4) or not np.isfinite(ext).all():
+ raise ValueError(f'{name}: extrinsics_matrix must be 3x4 or 4x4.')
+ _rotation(ext[:,:3], name)
+ size = c['image_size']
+ if k.shape != (3,3) or not np.isfinite(k).all() or min(k[0,0], k[1,1]) <= 0 or abs(k[1,0])>1e-6 or not np.allclose(k[2], [0,0,1], atol=1e-6, rtol=0):
+ raise ValueError(f'{name}: invalid camera intrinsics.')
+ size = np.asarray(size, float)
+ if size.shape != (2,) or not np.isfinite(size).all() or np.any(size <= 0) or np.any(size != np.round(size)):
+ raise ValueError(f'{name}: image size must be [width,height] in pixels.')
+ distortion = np.asarray(c.get('distortion_coeffs', [0.]*5), float)
+ if distortion.shape not in {(4,), (5,)} or not np.isfinite(distortion).all():
+ raise ValueError(f'{name}: invalid radtan distortion coefficients.')
+ output[name] = dict(intrinsic_matrix=k.tolist(), extrinsics_matrix=ext.tolist(),
+ image_size=size.astype(int).tolist(), distortion_coeffs=distortion.tolist())
+ return dict(filename=path.name, sha256=hashlib.sha256(raw).hexdigest(),
+ units='metres', extrinsics_convention='world_to_camera', cameras=output)
+
+
+def match_calibration(calibration, entries):
+ cameras = calibration.get('cameras', {})
+ names = [e['id'] for e in entries]
+ if set(cameras) != set(names):
+ raise ValueError('Calibration camera names must exactly match video filenames without extensions: '+', '.join(names))
+ for e in entries:
+ # Preserve original intrinsics and resolution. Future preprocessing
+ # must scale K explicitly; never silently substitute image dimensions.
+ if cameras[e['id']]['image_size'] != [e['metadata']['width'], e['metadata']['height']]:
+ raise ValueError(e['id']+': calibration resolution does not match the original video.')
+ return True
+
+
+def resolved_entries(root, entries):
+ result = []
+ for e in entries:
+ value = dict(e)
+ name=e.get('id','')
+ if not isinstance(name,str) or not name or len(name)>240 or any(c in name for c in '/\\:') or name in {'.','..'}:
+ raise ValueError('Invalid saved camera name.')
+ if e.get('media'):
+ path = (Path(root)/e['media']).resolve()
+ if not path.is_relative_to(Path(root).resolve()) or path == Path(root).resolve():
+ raise ValueError('Invalid saved camera video location.')
+ else:
+ path = Path(e['path']).resolve()
+ value['path'] = str(path)
+ result.append(value)
+ if len({e['id'].casefold() for e in result})!=len(result):
+ raise ValueError('Duplicate saved camera names.')
+ video_paths([e['path'] for e in result])
+ return result
diff --git a/mocap/mamma_manager.py b/mocap/mamma_manager.py
new file mode 100644
index 0000000..30f3337
--- /dev/null
+++ b/mocap/mamma_manager.py
@@ -0,0 +1,64 @@
+"""Runtime readiness and setup instructions for the MAMMA model manager."""
+from pathlib import Path
+from html import escape
+import json
+from PySide6.QtCore import Qt
+from PySide6.QtWidgets import QApplication,QDialog,QHBoxLayout,QLabel,QPushButton,QTextBrowser,QVBoxLayout,QWidget
+from .paths import ROOT
+
+
+def runtime_panel(parent):
+ panel=QWidget();box=QHBoxLayout(panel);box.setContentsMargins(0,0,0,0)
+ label=QLabel();label.setWordWrap(True);label.setTextFormat(Qt.PlainText)
+ try:
+ from .mamma_runtime import configuration
+ cfg=configuration()
+ label.setText('MAMMA runtime: Ready' if cfg.get('version')==3 else 'MAMMA runtime: Configured separately')
+ label.setToolTip('Python: '+cfg['python']+'\nEngine: '+cfg['engine']+'\nThis environment is isolated from the single-video models.')
+ except (OSError,RuntimeError,ValueError) as error:
+ label.setText('MAMMA runtime: Setup required');label.setToolTip(str(error));label.setStyleSheet('color:#ffb45c')
+ button=QPushButton('Runtime Setup...')
+ button.setToolTip('Show the separate MAMMA runtime installation steps, disk requirements and license conditions. Model weights are installed in the table below.')
+ button.clicked.connect(lambda:setup_instructions(parent))
+ box.addWidget(label,1);box.addWidget(button)
+ return panel
+
+
+def setup_instructions(parent):
+ dialog=QDialog(parent);dialog.setWindowTitle('MAMMA Runtime Setup');dialog.resize(690,530)
+ layout=QVBoxLayout(dialog);text=QTextBrowser();text.setOpenExternalLinks(True)
+ text.document().setDefaultStyleSheet('a { color: #8ed2ff; text-decoration: underline; }')
+ report={}
+ try:report=json.loads((ROOT/'.setup/mamma-install-report.json').read_text(encoding='utf-8'))
+ except (OSError,ValueError):pass
+ size=report.get('installed_bytes',0)
+ measured=(f'{size/1024**3:.2f} GiB on this PC' if size else 'approximately 6–8 GiB')
+ text.setHtml(f'''<h3>MAMMA separate runtime</h3>
+<p>Installed size: <b>{measured}</b>, excluding model weights and developer tools.
+Allow about <b>18 GiB free</b> during setup for downloads and compilation. Other model runtimes stay unchanged.</p>
+<ol><li>Install <a href="https://visualstudio.microsoft.com/downloads/">Visual Studio 2022 Build Tools</a> with
+<b>Desktop development with C++</b> and the Windows SDK.</li>
+<li>Install <a href="https://developer.nvidia.com/cuda-12-8-0-download-archive">NVIDIA CUDA Toolkit 12.8</a>.
+The GPU driver alone does not include the compiler.</li>
+<li>Save your work, close RGB MoCap, then run <b>Setup_MAMMA.cmd</b> in the app folder.</li>
+<li>Review the upstream license prompt. Setup downloads pinned Python/packages and official sources,
+builds SAM 2 and SDF for this GPU, and tests the CUDA kernels before enabling the runtime.</li>
+<li>Reopen the app. Select MAMMA and prepare the files in Model Manager.</li></ol>
+<p><a href="https://github.com/cuevhv/mamma/blob/main/LICENSE">MAMMA</a> and
+<a href="https://github.com/cuevhv/pytorch_sdf/blob/main/LICENSE">pytorch_sdf</a> have restricted, non-commercial licenses.
+Their code and compiled modules are not redistributed by RGB MoCap. They are downloaded and built locally.
+The compiler tools can add substantial disk usage beyond the runtime.</p>
+<p>Registered MAMMA checkpoint, correspondence data and the three locked-head SMPL-X body files require
+manual downloads. For the MAMMA checkpoint and surface landmarks, open the
+<a href="https://mamma.is.tue.mpg.de/">official MAMMA website</a>, click <b>Data</b>,
+register if needed, review and accept the provider terms, then sign in to download the files.
+Return to Model Manager and use <b>Import</b> for each matching row.
+The locked-head body files come from the separate SMPL-X website.
+The table provides instructions and SHA-256 checked imports. Public supporting weights can be downloaded there.</p>
+<p>Setup logs: <code>.setup/logs/mamma-*.log</code>.<br>Details: <code>docs/MAMMA.md</code>.</p>''')
+ layout.addWidget(text);buttons=QHBoxLayout()
+ copy=QPushButton('Copy Setup Command');copy.setToolTip('Copy a command to run after closing RGB MoCap.')
+ copy.clicked.connect(lambda:QApplication.clipboard().setText('cd /d "'+str(ROOT)+'"\r\nSetup_MAMMA.cmd'))
+ close=QPushButton('Close');close.clicked.connect(dialog.accept)
+ buttons.addWidget(copy);buttons.addStretch();buttons.addWidget(close);layout.addLayout(buttons)
+ dialog.exec();dialog.deleteLater()
diff --git a/mocap/mamma_models.py b/mocap/mamma_models.py
new file mode 100644
index 0000000..67f25a4
--- /dev/null
+++ b/mocap/mamma_models.py
@@ -0,0 +1,40 @@
+"""MAMMA assets, separate from the three single-view body-model families."""
+
+ASSETS = (
+ dict(key='mamma', name='Multi-view Motion / MAMMA', relative='mamma/mamma_mask_full_cvpr.ckpt',
+ url='https://mamma.is.tue.mpg.de/', minimum_bytes=1621536317,
+ expected_sha256='3fd6793cf72f9994eded544d902a30b2cd5e9e5d225c1be110980ee4cadd8b29'),
+ dict(key='mamma_vertices', name='MAMMA Surface Landmarks / verts_512', relative='mamma/verts_512.pkl',
+ url='https://mamma.is.tue.mpg.de/', minimum_bytes=21453208,
+ expected_sha256='85c6acd5618a2b93d96640285a6f3e1e02383a046140d882663e6de5a6185c82'),
+ dict(key='mamma_body', name='MAMMA Body / Locked-head SMPL-X Neutral', relative='mamma/smplx/SMPLX_NEUTRAL.npz',
+ url='https://smpl-x.is.tue.mpg.de/', minimum_bytes=137106406,
+ expected_sha256='43d8f3a1375d7c5baae207870a5d51def0f7e6b507df709b4937598b5e7d965d'),
+ dict(key='mamma_sam2', name='MAMMA Masks / SAM 2.1 Hiera Large', relative='mamma/sam2.1_hiera_large.pt',
+ url='https://github.com/facebookresearch/sam2', minimum_bytes=898083611,
+ download_url='https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt',
+ expected_sha256='2647878d5dfa5098f2f8649825738a9345572bae2d4350a2468587ece47dd318'),
+ dict(key='mamma_yolo', name='MAMMA Person Detection / YOLO12x', relative='mamma/yolo12x.pt',
+ url='https://github.com/ultralytics/ultralytics', minimum_bytes=119322638,
+ download_url='https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo12x.pt',
+ expected_sha256='682ce8dadee004dbe964950f1bf3eda451671815a6ed62db80b398916b9b7c6f'),
+ dict(key='mamma_clip', name='MAMMA View Matching / OpenCLIP ViT-B-32', relative='mamma/open_clip_model.safetensors',
+ url='https://huggingface.co/laion/CLIP-ViT-B-32-laion2B-s34B-b79K', minimum_bytes=605143316,
+ download_url='https://huggingface.co/laion/CLIP-ViT-B-32-laion2B-s34B-b79K/resolve/1a25a446712ba5ee05982a381eed697ef9b435cf/open_clip_model.safetensors',
+ expected_sha256='ac4f8c4b88af6d963118cbf40ad93176d092abbedfcb752601ae1866352656e6'),
+ dict(key='mamma_body_male', name='MAMMA Body Initialization / Locked-head Male', relative='mamma/smplx/SMPLX_MALE.npz',
+ url='https://smpl-x.is.tue.mpg.de/', minimum_bytes=137147214,
+ expected_sha256='44e57050d127538e20e10e27f8274ba9ca3dd09c992e954d3d2b5ae5e5bb8313'),
+ dict(key='mamma_body_female', name='MAMMA Body Initialization / Locked-head Female', relative='mamma/smplx/SMPLX_FEMALE.npz',
+ url='https://smpl-x.is.tue.mpg.de/', minimum_bytes=137193916,
+ expected_sha256='a32f91b24e13023b979ec0b5c8e9086f5918197132329c8a258ad1f1c6c557f6'),
+)
+KEYS = tuple(entry['key'] for entry in ASSETS)+('flow_vggt',)
+
+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.',
+ 'mamma_vertices': '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 verts_512.pkl.\n4. Return to this window, click Import and select the PKL file intact.\nThis is registered surface correspondence data, not an ordinary SMPL-X body model. Import checks its supported SHA-256 without executing the file.',
+ 'mamma_body': 'Register at the SMPL-X website and accept its terms. Download "SMPL-X with removed head bun (NPZ, 392 MB)". Extract it and import the locked-head SMPLX_NEUTRAL.npz. The standard SMPL-X v1.1 model used by GVHMR/ExMR is different and cannot replace this file. MAMMA data and source code have separate non-commercial and redistribution restrictions.',
+}
+for gender in ('male', 'female'):
+ INSTRUCTIONS['mamma_body_'+gender] = INSTRUCTIONS['mamma_body'].replace('SMPLX_NEUTRAL.npz', 'SMPLX_'+gender.upper()+'.npz')
diff --git a/mocap/mamma_pipeline.py b/mocap/mamma_pipeline.py
new file mode 100644
index 0000000..a6e5068
--- /dev/null
+++ b/mocap/mamma_pipeline.py
@@ -0,0 +1,324 @@
+"""Cancellable, process-isolated multi-view research pipeline.
+
+Official MAMMA code remains in its separately licensed user installation.
+Completed inference is immutable; new attempts cannot replace displayed work.
+"""
+from pathlib import Path
+import argparse
+import hashlib
+import json
+import math
+import os
+import subprocess
+import sys
+import time
+import traceback
+import uuid
+from .storage import atomic_json
+from .result_artifacts import file_stat
+
+STAGES = ('mamma_prepare', 'mamma_masks', 'mamma_landmarks', 'mamma_camera', 'mamma_fit', 'mamma_publish')
+
+
+def emit(kind, **data):
+ print('@@MOCAP@@'+json.dumps(dict(type=kind, **data), ensure_ascii=False), flush=True)
+
+
+def request(path):
+ path = Path(path)
+ if path.stat().st_size > 2*1024**2:
+ raise ValueError('Invalid MAMMA request size.')
+ value = json.loads(path.read_text(encoding='utf-8'))
+ if value.get('version') != 1:
+ raise ValueError('Unsupported MAMMA request.')
+ from .mamma_inputs import video_paths
+ paths = video_paths([v['path'] for v in value['inputs']])
+ if len(paths) < 2:
+ raise ValueError('MAMMA reconstruction requires at least two synchronized fixed-camera videos.')
+ if not all(math.isfinite(float(value[k])) for k in ('start','end')) or not 0 <= float(value['start']) < float(value['end']):
+ raise ValueError('Invalid common MAMMA trim range.')
+ for entry,path in zip(value['inputs'],paths):
+ if entry['id']!=path.stem or len(entry['id'])>120:
+ raise ValueError('Use short, unique camera filenames matching their saved camera IDs.')
+ options=value['options']
+ if options.get('camera_mode') not in ('vggt','manual') or not isinstance(options.get('people',0),int) or not 0<=options.get('people',0)<=8:
+ raise ValueError('Invalid MAMMA camera/person settings.')
+ height=float(options.get('height_m',1.7))
+ if not math.isfinite(height) or not .5<=height<=2.5:raise ValueError('Invalid reference height.')
+ value['root'] = Path(value['root']).resolve()
+ return value
+
+
+def work_for(job):
+ root = job['root']
+ relative = job.get('work', '')
+ work = (root/relative).resolve()
+ if not relative or not work.is_relative_to(root/'mamma'):
+ raise ValueError('Invalid MAMMA generation path.')
+ return work
+
+
+def validate_inputs(job):
+ from .models import BY_KEY
+ for value in job['identity']['inputs']:
+ if file_stat(value['path'])!=value['stat']:
+ raise ValueError('A source video changed during MAMMA processing. Start a new reconstruction.')
+ for key,stamp in job['identity']['models'].items():
+ if file_stat(BY_KEY[key].path)!=stamp:
+ raise ValueError('A MAMMA model changed during processing. The previous result was preserved.')
+
+
+def prepare(path, job):
+ from .mamma_inputs import common_media, match_calibration
+ from .mamma_runtime import configuration
+ from .models import missing
+ from .project_workspace import create
+ from .video import executable, probe
+ common = common_media(job['inputs'])
+ if job['end'] > common['duration']+1e-4:
+ raise ValueError('The common trim extends beyond a camera video.')
+ 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')):
+ raise ValueError('Prepare the missing MAMMA models in Model Manager first.')
+ options = job['options']
+ if options['camera_mode'] == 'manual':
+ match_calibration(options['calibration'], job['inputs'])
+ for camera in options['calibration']['cameras'].values():
+ if abs(camera['intrinsic_matrix'][0][1])>1e-6 or any(abs(float(v))>1e-9 for v in camera.get('distortion_coeffs',[])):
+ raise ValueError('This camera adapter requires undistorted pinhole video with zero skew and zero lens distortion. It will not silently discard lens calibration.')
+ runtime = configuration()
+ from .mamma_runtime import verify_engine
+ verify_engine(runtime)
+ 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'})
+ 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')}
+ token=hashlib.sha256(json.dumps(identity,sort_keys=True).encode()).hexdigest()[:24]
+ slot=job['root']/'mamma'/'inference'/token
+ cached=False
+ try:
+ done=json.loads((slot/'complete.json').read_text(encoding='utf-8'))
+ cached=(done['identity']==identity and all(file_stat(slot/name)==stamp for name,stamp in done['outputs'].items()))
+ except (OSError,ValueError,KeyError,TypeError):pass
+ if slot.exists() and not cached:
+ # Retain interrupted generations for diagnosis; never reuse mixed files.
+ slot=slot.with_name(token+'-'+uuid.uuid4().hex[:12])
+ slot.mkdir(parents=True,exist_ok=True)
+ create(job['root'],Path(job['inputs'][0]['path']),dict(path=job['inputs'][0]['path'],**common),'mamma')
+ job.update(work=slot.relative_to(job['root']).as_posix(), frames=n, identity=identity, cached=cached)
+ serial={**job,'root':str(job['root'])}
+ atomic_json(path,serial)
+ if cached:
+ emit('progress',current=1,total=1,message='Reusing verified MAMMA inference; original and applied edits are retained.')
+ return
+ atomic_json(slot/'pending.json',identity)
+ videos=slot/'videos';videos.mkdir()
+ entries=[]
+ for i,entry in enumerate(job['inputs']):
+ emit('progress',current=i,total=len(job['inputs']),message='Prepare synchronized camera '+entry['id'])
+ output=videos/(entry['id']+'.mp4')
+ actual=probe(Path(entry['path']))
+ if any(actual[key]!=entry['metadata'][key] for key in ('width','height','frames','fps')):
+ raise ValueError('Source video metadata changed since it was opened. Open the cameras again.')
+ # Trim/resample on one common time grid; do not independently reset a
+ # camera's start or stretch short footage to fill the other cameras.
+ vf=f"trim=start={job['start']:.9f}:end={job['end']:.9f},setpts=PTS-STARTPTS,fps=30,scale=w='min(1920,iw)':h='min(1080,ih)':force_original_aspect_ratio=decrease:force_divisible_by=2"
+ subprocess.run([executable('ffmpeg'),'-hide_banner','-loglevel','error','-i',entry['path'],
+ '-map','0:v:0','-an','-vf',vf,'-frames:v',str(n),'-fps_mode','cfr','-c:v','libx264',
+ '-preset','fast','-crf','18','-pix_fmt','yuv420p','-threads','2',str(output)],
+ check=True,creationflags=0x08000000)
+ info=probe(output)
+ if info['frames']!=n or abs(info['fps']-30)>.001:
+ raise ValueError('Camera frame count differs from the common trim; synchronize or shorten the inputs.')
+ entries.append(dict(id=entry['id'],path=str(output),size=[info['width'],info['height']],original_size=[entry['metadata']['width'],entry['metadata']['height']]))
+ atomic_json(slot/'inputs.json',entries)
+ emit('progress',current=len(entries),total=len(entries),message='Synchronized camera clips prepared')
+
+
+def run_script(engine, section, filename, args):
+ import runpy
+ directory=engine/section
+ sys.path[:0]=[str(directory),str(engine)]
+ os.chdir(directory)
+ sys.argv=[str(directory/filename),*map(str,args)]
+ runpy.run_path(sys.argv[0],run_name='__main__')
+
+
+def masks(engine, work, job):
+ import cv2
+ import open_clip
+ import yaml
+ from .models import BY_KEY
+ original_clip=open_clip.create_model_and_transforms
+ def local_clip(name,*args,**kwargs):
+ if name!='ViT-B-32' or kwargs.get('pretrained')!='laion2b_s34b_b79k':
+ raise ValueError('Unsupported MAMMA appearance model; no automatic downloads are allowed.')
+ kwargs['pretrained']=str(BY_KEY['mamma_clip'].path)
+ return original_clip(name,*args,**kwargs)
+ open_clip.create_model_and_transforms=local_clip
+ sys.path[:0]=[str(engine/'segmentation'),str(engine)]
+ from core.pipeline import SegmentMultipleFrames
+ from core.frame_source import VideoSource
+ original=SegmentMultipleFrames._resolve_sam_video_source
+ def resolve(self,frames,cam_data=None):
+ if not isinstance(frames,VideoSource):return original(self,frames,cam_data)
+ dest=Path(self.output_path)/frames.cam_name/'_sam_frames_lossless'
+ dest.mkdir(parents=True,exist_ok=True)
+ for i in range(len(frames)):
+ if i%30==0:emit('progress',current=i,total=len(frames),message='Prepare SAM frames: '+frames.cam_name)
+ if not cv2.imwrite(str(dest/f'{i:06}.png'),frames.reader.read_bgr(i)):
+ raise OSError('Cannot write a lossless SAM input frame.')
+ return str(dest)
+ SegmentMultipleFrames._resolve_sam_video_source=resolve
+ names=[v['id'] for v in job['inputs']]
+ config=yaml.safe_load((engine/'segmentation/configs/sam2.yaml').read_text(encoding='utf-8'))
+ # Frozen settings from the completed occlusion trials: a single anatomical
+ # identity anchor, bidirectional propagation and bounded CPU video storage.
+ config.setdefault('matching',{}).update(max_anchors_per_id=1,init_anchor_enable=False)
+ config.setdefault('sam',{}).update(propagate_reverse=True,offload_video_to_cpu=True,
+ offload_state_to_cpu=True,offload_state_min_frames=1500,fp16_frames=False)
+ config.setdefault('exports',{}).update(export_masked_outputs_mp4=False,export_prompt_overlays_mp4=False,
+ export_prompt_similarity_mp4=False,debug_full_masks_npy=False,debug_crop_summary=False)
+ config_path=work/'sam2.yaml';config_path.write_text(yaml.safe_dump(config,sort_keys=False),encoding='utf-8')
+ args=['--seq_name','motion','--out',work/'masks','--dataset_name','mamma_example',
+ '--sam_version','sam2','--yolo-checkpoint',BY_KEY['mamma_yolo'].path,
+ '--sam_checkpoint',BY_KEY['mamma_sam2'].path,'--cam_names',*names,
+ '--videos_dir',work/'videos','--start',0,'--end',job['frames'],
+ '--init_frame',min(30,job['frames']//2),'--cam_init',names[0],
+ '--skip_masked_outputs','--skip_collage','--cfg',config_path]
+ people=job['options'].get('people',0)
+ if people:args+=['--expected_subjects',people]
+ run_script(engine,'segmentation','run_ma_masks.py',args)
+ raw=work/'masks/mamma_example/motion'
+ cleaned=work/'clean-masks/motion'
+ count=0
+ import numpy as np
+ for path in raw.glob('*/masks/*.png'):
+ im=cv2.imread(str(path),0)
+ if im is None:raise ValueError('MAMMA produced an unreadable mask.')
+ _,labels,stats,_=cv2.connectedComponentsWithStats((im>127).astype('uint8'),connectivity=8)
+ sizes=stats[1:,cv2.CC_STAT_AREA]
+ if len(sizes) and sizes.max()>=128:
+ im[np.isin(labels,np.flatnonzero(sizes<8)+1)]=0
+ out=cleaned/path.relative_to(raw);out.parent.mkdir(parents=True,exist_ok=True)
+ if not cv2.imwrite(str(out),im):raise OSError('Cannot write cleaned MAMMA mask.')
+ count+=1
+ if not count:raise ValueError('MAMMA produced no person masks. Check visibility and the initial camera.')
+
+
+def landmarks(engine,work,job):
+ from .models import BY_KEY
+ os.environ['MAMMA_SPEED_VARIANT']='fast-cpu-ckpt-exact-roi'
+ os.environ['MAMMA_SPEED_DIR']=str(work)
+ run_script(engine,'landmarks','run_ma_2d.py',[
+ '--config_path','configs/train/models_2d/config_mammanet_mask_512.yaml',
+ '--weights',BY_KEY['mamma'].path,'--out_folder',work/'landmarks',
+ '--seq_name','motion','--mask_path',work/'clean-masks','--downsampled-verts',BY_KEY['mamma_vertices'].path,
+ '--cam_names',*[v['id'] for v in job['inputs']], '--videos_dir',work/'videos',
+ '--start',0,'--end',job['frames'],'--no-save_cam_output'])
+
+
+def fit(engine,work,job):
+ import inspect
+ import torch
+ import numpy as np
+ import shutil
+ sys.path[:0]=[str(engine/'optimization'),str(engine)]
+ from losses import losses
+ original=losses.proj_pts_loss
+ source=inspect.getsource(original)
+ old='torch.clip(per_point_weight[cam_id][..., None], min=vis_clip_value)*pred_in_img'
+ if source.count(old)!=1:raise RuntimeError('The configured MAMMA visibility loss is not the validated version.')
+ scope=dict(original.__globals__)
+ exec(compile(source.replace(old,'torch.clamp(per_point_weight[cam_id][..., None], min=0., max=1.)*pred_in_img'),'<MAMMA visibility bridge>','exec'),scope)
+ unfloored=scope['proj_pts_loss']
+ def weighted(pts2d,pts3d_pred,intrinsics,extrinsics,loss='mse',per_point_weight=None,vis_clip_value=.8,weight=1.):
+ weights=per_point_weight
+ if weights is not None:
+ weights=[]
+ for v in per_point_weight:
+ q=((v.mean(-1)-.03)/.12).clamp(0,1);q=q*q*(3-2*q)
+ if len(q)>1:
+ kernel=v.new_tensor([1.,4.,6.,4.,1.])[None,None]/16
+ for _ in range(2):
+ q=torch.nn.functional.conv1d(torch.nn.functional.pad(q[None,None],(2,2),mode='replicate'),kernel)[0,0]
+ weights.append(v*q[:,None])
+ return unfloored(pts2d,pts3d_pred,intrinsics,extrinsics,loss,weights,0.,weight)
+ losses.proj_pts_loss=weighted
+ from .models import BY_KEY
+ os.environ['MAMMA_SPEED_VARIANT']='quiet-fit'
+ # Upstream expects its body-part index arrays beside the registered D512
+ # matrix. Derive the small NPZ from the user's installed upstream JSON;
+ # do not put those restricted correspondence arrays in this repository.
+ parts=json.loads((engine/'landmarks/lib/datasets/_smplx_512_body_parts.json').read_text(encoding='utf-8'))
+ parts={k:np.asarray(v,dtype=np.int64) for k,v in parts.items()}
+ if not {'body','left_head','right_head','left_hand','right_hand','left_feet','right_feet'}<=parts.keys() or any(v.ndim!=1 or np.any((v<0)|(v>=512)) for v in parts.values()):
+ raise ValueError('Invalid upstream MAMMA body-part correspondence indices.')
+ data=work/'model-data';data.mkdir(exist_ok=True)
+ downsample=data/'verts_512.pkl'
+ if not downsample.exists():shutil.copy2(BY_KEY['mamma_vertices'].path,downsample)
+ np.savez(data/'smplx_512_body_parts.npz',**parts)
+ run_script(engine,'optimization','run_ma_3d.py',[
+ '--config_file','config_files/contact_configs/config_real_gmf_small_vals_detr_exp_no_vtemplate.yaml',
+ '--seq_name','motion','--ma_2d_dir',work/'landmarks','--out_path',work/'fit',
+ '--ma_cap_dir',work/'capture','--smplx-models',BY_KEY['mamma_body'].path.parent.parent,
+ '--downsampled-verts',downsample,'--cam_names',*[v['id'] for v in job['inputs']],
+ '--skip_detection_analysis'])
+ outputs=list((work/'fit/motion').glob('smplx_params_body_id-*.npz'))
+ if not outputs:raise ValueError('MAMMA did not produce a complete motion result.')
+ outputs.extend([work/'camera-world.json',work/'inputs.json',*(work/'videos').glob('*.mp4'),
+ *(work/'landmarks/motion').glob('*.npz')])
+ atomic_json(work/'complete.json',dict(identity=job['identity'],outputs={p.relative_to(work).as_posix():file_stat(p) for p in outputs}))
+ (work/'pending.json').unlink(missing_ok=True)
+
+
+def main(argv=None,engine=None):
+ parser=argparse.ArgumentParser()
+ parser.add_argument('stage',choices=STAGES)
+ parser.add_argument('--request',required=True,type=Path)
+ args=parser.parse_args(argv);started=time.monotonic()
+ try:
+ job=request(args.request)
+ emit('progress',current=0,total=0,message=args.stage.replace('mamma_','MAMMA: '))
+ if args.stage=='mamma_prepare':prepare(args.request,job)
+ elif args.stage=='mamma_publish':
+ validate_inputs(job)
+ from .mamma_publish import publish
+ publish(job,emit)
+ elif not job.get('cached'):
+ validate_inputs(job)
+ if engine is None:raise RuntimeError('MAMMA inference requires its separate configured environment.')
+ from .paths import HOME
+ import tempfile
+ cache=HOME/'cache/mamma';cache.mkdir(parents=True,exist_ok=True)
+ temp=cache/'temp';temp.mkdir(exist_ok=True);tempfile.tempdir=str(temp)
+ os.environ.update(TEMP=str(temp),TMP=str(temp),YOLO_CONFIG_DIR=str(cache/'yolo'),
+ HF_HOME=str(cache/'hf'),HF_HUB_OFFLINE='1',MPLCONFIGDIR=str(cache/'mpl'),MPLBACKEND='Agg',
+ WANDB_MODE='disabled',NO_ALBUMENTATIONS_UPDATE='1')
+ import torch,cv2
+ from .compute_policy import configure_worker_cpu,gpu_memory_fraction
+ torch.set_num_threads(configure_worker_cpu(args.stage));cv2.setNumThreads(1)
+ torch.backends.cuda.matmul.allow_tf32=False;torch.backends.cudnn.allow_tf32=False
+ if not torch.cuda.is_available():raise RuntimeError('MAMMA requires a supported CUDA GPU.')
+ free,total=torch.cuda.mem_get_info();torch.cuda.set_per_process_memory_fraction(gpu_memory_fraction(free,total))
+ work=work_for(job)
+ if args.stage=='mamma_masks':masks(engine,work,job)
+ elif args.stage=='mamma_landmarks':landmarks(engine,work,job)
+ elif args.stage=='mamma_camera':
+ from .mamma_camera import run
+ run(engine,work,job,emit)
+ elif args.stage=='mamma_fit':fit(engine,work,job)
+ validate_inputs(job)
+ emit('complete',stage=args.stage,elapsed=time.monotonic()-started,cached=job.get('cached',False),output=str(job['root']))
+ return 0
+ except Exception as error:
+ traceback.print_exc()
+ emit('failed',message=str(error))
+ return 1
diff --git a/mocap/mamma_publish.py b/mocap/mamma_publish.py
new file mode 100644
index 0000000..0bedaf5
--- /dev/null
+++ b/mocap/mamma_publish.py
@@ -0,0 +1,151 @@
+"""Publish native MAMMA actors through the app's source/export/contact paths."""
+from pathlib import Path
+import json
+import os
+import pickle
+import shutil
+import time
+import numpy as np
+from .storage import atomic_json,sha256
+from .result_artifacts import file_stat
+from .mamma_body import make_actor_body,model_for,convert_motion,contact_probabilities,WORLD_ROTATION
+
+
+def media_link(source,destination):
+ destination.parent.mkdir(parents=True,exist_ok=True)
+ if destination.exists():return
+ try:os.link(source,destination)
+ except OSError:shutil.copy2(source,destination)
+
+
+def publish(job,emit):
+ import torch
+ from scipy.spatial.transform import Rotation
+ from .mamma_pipeline import work_for
+ from .models import BY_KEY
+ from .engines import save_tensor
+ from .people_store import visible_runs,person_color,media_receipt
+ from .project_workspace import read,set_active
+ from .scene_camera import camera_sources,VERSION
+ torch.set_num_threads(4)
+ work=work_for(job);root=job['root'];n=job['frames']
+ # Actor-only native data lives with the workspace, never in a global cache.
+ group=root/'mamma'/'results'/work.name
+ group.mkdir(parents=True,exist_ok=True)
+ atomic_json(group/'mamma_pending.json',dict(work=str(work),stage='native publication'))
+ entries=json.loads((work/'inputs.json').read_text(encoding='utf-8'))
+ cameras=json.loads((work/'camera-world.json').read_text(encoding='utf-8'))
+ primary=cameras[entries[0]['id']]
+ transform=np.eye(4);transform[:3,:3]=np.asarray(primary['extrinsics_matrix'])[:,:3]@WORLD_ROTATION.T
+ transform[:3,3]=np.asarray(primary['extrinsics_matrix'])[:,3]
+ source={**job['inputs'][0]['metadata'],**job['inputs'][0]};source['path']=str(Path(source['path']).resolve())
+ media_link(Path(entries[0]['path']),group/'input.mp4')
+ selected='corrected_initial' if job['correction_enabled'] else 'initial'
+ common=dict(version=1,source=source,start=job['start'],end=job['start']+n/30,fps=30,frames=n,
+ width=entries[0]['size'][0],height=entries[0]['size'][1],camera='static',stages={},
+ timeline=dict(start=job['start'],step=1/30,frames=n),pipeline=dict(model='mamma',result=selected),
+ correction=job['correction'],mamma_options=job['options'],mamma_work=os.path.relpath(work,group),
+ workspace_root=os.path.relpath(root,group))
+ atomic_json(group/'project.json',common)
+ with BY_KEY['mamma_vertices'].path.open('rb') as f:D=pickle.load(f).cpu().numpy()
+ prior={}
+ try:prior={p['id']:p for p in json.loads((group/'people.json').read_text(encoding='utf-8'))['people']}
+ except (OSError,ValueError,KeyError):pass
+ people=[];projects=[]
+ fit=work/'fit/motion'
+ filenames=sorted(fit.glob('smplx_params_body_id-*.npz'))
+ if not filenames or len(filenames)>8:raise ValueError('MAMMA returned no actors or more than eight actors for this experimental integration.')
+ for number,path in enumerate(filenames,1):
+ raw_id=int(path.stem.rsplit('-',1)[1])
+ with np.load(path,allow_pickle=False) as archive:
+ pose=archive['smplx_pose'];beta=archive['smplx_betas'];trans=archive['smplx_translation'];contacts=archive['smplx_floor_contact']
+ if pose.shape!=(n,165) or np.asarray(beta).shape!=(1,16) or contacts.shape!=(n,512):
+ raise ValueError('MAMMA result dimensions do not match the selected common trim.')
+ seen=np.zeros(n,bool)
+ for e in entries:
+ with np.load(work/'landmarks/motion'/(e['id']+'.npz'),allow_pickle=False) as z:
+ if raw_id>=z['visibilities'].shape[1]:raise ValueError('MAMMA actor identity does not match its landmark/mask ID.')
+ seen|=(z['visibilities'][:,raw_id].max(axis=1)>.01)
+ runs=visible_runs(np.flatnonzero(seen),30,0,n)
+ if not runs:continue
+ person=dict(id=number,name=prior.get(number,{}).get('name',f'Person {number}'),
+ color=prior.get(number,{}).get('color',person_color(number)),checked=prior.get(number,{}).get('checked',True),
+ observations=int(seen.sum()),first=int(np.flatnonzero(seen)[0]),last=int(np.flatnonzero(seen)[-1]),takes=[])
+ for take,(first,end) in enumerate(runs):
+ project=group/'actors'/f'person_{number:04}'/f'take_{take:03}'
+ project.mkdir(parents=True,exist_ok=True)
+ from . import mamma_body
+ native=dict(raw_stat=file_stat(path),raw_source=path.relative_to(root).as_posix(),range=[first,end],
+ body_source=file_stat(BY_KEY['mamma_body'].path),adapter=sha256(Path(mamma_body.__file__)))
+ receipt=project/'mamma_source.json'
+ reuse=False
+ try:
+ reuse=json.loads(receipt.read_text(encoding='utf-8'))['native']==native and file_stat(project/'hmr4d_results.pt')==json.loads(receipt.read_text(encoding='utf-8'))['output']
+ if reuse:
+ from .mamma_body import body_path
+ body_path(project)
+ except (OSError,ValueError,KeyError):reuse=False
+ state=dict(common,frames=end-first,start=job['start']+first/30,end=job['start']+end/30,
+ people_root=os.path.relpath(group,project),person_id=number,person_frames=[first,end],
+ workspace_root=os.path.relpath(root,project),
+ timeline=dict(start=job['start']+first/30,step=1/30,frames=end-first),
+ mamma_preview_videos=[dict(id=e['id'],path=os.path.relpath(e['path'],project),first=first) for e in entries])
+ if reuse:
+ old=json.loads((project/'project.json').read_text(encoding='utf-8'))
+ state['mamma_body']=old['mamma_body']
+ atomic_json(project/'project.json',state)
+ else:
+ entry=make_actor_body(BY_KEY['mamma_body'].path,beta,project)
+ state['mamma_body']=entry;atomic_json(project/'project.json',state)
+ body=model_for(project)
+ params=convert_motion(pose[first:end],beta,trans[first:end],body)
+ prob=contact_probabilities(body,beta[0],D,contacts[first:end])
+ confidence=torch.logit(torch.from_numpy(np.clip(prob,1e-6,1-1e-6)))
+ incam={k:v.clone() for k,v in params.items()}
+ r=transform[:3,:3];t=transform[:3,3]
+ root_r=Rotation.from_rotvec(params['global_orient'].numpy()).as_matrix()
+ incam['global_orient']=torch.from_numpy(Rotation.from_matrix(r@root_r).as_rotvec().astype('float32'))
+ shaped=body.v_template.numpy()+np.einsum('vci,i->vc',body.shapedirs.numpy(),beta[0,:10])
+ pelvis=body.J_regressor.numpy()[0]@shaped
+ incam['transl']=torch.from_numpy(((params['transl'].numpy()+pelvis)@r.T+t-pelvis).astype('float32'))
+ save_tensor(dict(smpl_params_global=params,smpl_params_incam=incam,
+ net_outputs=dict(static_conf_logits=confidence[None]),source_model='mamma'),project/'hmr4d_results.pt')
+ atomic_json(receipt,dict(version=1,native=native,output=file_stat(project/'hmr4d_results.pt')))
+ del body,params,incam
+ # Local clips make source/take timing unambiguous in the generic UI.
+ from .video import executable
+ if not (project/'input.mp4').exists():
+ if first==0 and end==n:media_link(group/'input.mp4',project/'input.mp4')
+ else:
+ import subprocess
+ subprocess.run([executable('ffmpeg'),'-v','error','-i',str(group/'input.mp4'),'-vf',f'trim=start_frame={first}:end_frame={end},setpts=PTS-STARTPTS',
+ '-an','-c:v','libx264','-crf','18','-preset','fast','-threads','2',str(project/'input.mp4')],check=True,creationflags=0x08000000)
+ atomic_json(project/'scene_camera.json',dict(version=VERSION,sources=camera_sources(project),model=file_stat(project/state['mamma_body']['file']),
+ world_to_camera=transform.tolist(),K=primary['intrinsic_matrix'],htd_compatible=False,source_model='mamma',method='One calibrated MAMMA world; fixed camera, exact shaped pelvis'))
+ relative=project.relative_to(group).as_posix()
+ person['takes'].append(dict(first=first,end=end,project=relative))
+ projects.append(project)
+ person['preview']=person['takes'][0]['project'];people.append(person)
+ emit('progress',current=number,total=len(filenames),message=f'Prepare MAMMA source actor {number}')
+ if not projects:raise ValueError('No sufficiently visible MAMMA actor takes could be published.')
+ atomic_json(group/'people.json',dict(version=1,input=media_receipt(group),people=people,active=people[0]['id']))
+ from .mamma_scene import prepare_cameras
+ prepare_cameras(group)
+ from .scene_floor import save_config,resolve
+ save_config(group,job['correction']);resolve(group)
+ from .export import export_project
+ from .correction import run as correct
+ for index,project in enumerate(projects):
+ emit('progress',current=index,total=len(projects),message=f'Prepare MAMMA motion, contacts and export bones {index+1}/{len(projects)}')
+ export_project(project,'initial')
+ if job['correction_enabled']:
+ correct(project,emit,selected)
+ export_project(project,selected)
+ set_active(root,'mamma',projects[0])
+ from .mamma_pipeline import validate_inputs
+ validate_inputs(job)
+ state=read(root);state['mamma_inputs']=job['inputs'];state['mamma_active_camera']=job.get('active_camera',0)
+ state['models']['mamma']['settings']=dict(result=selected,correction=job['correction'],mamma_options=job['options'])
+ atomic_json(root/'project.json',state)
+ (group/'mamma_pending.json').unlink(missing_ok=True)
+ emit('mamma_ready',project=str(projects[0]),group=str(group),root=str(root),result=selected)
diff --git a/mocap/mamma_runtime.py b/mocap/mamma_runtime.py
new file mode 100644
index 0000000..a35317c
--- /dev/null
+++ b/mocap/mamma_runtime.py
@@ -0,0 +1,102 @@
+"""Optional, user-installed MAMMA engine; never distribute registered code.
+
+The private environment is explicitly configured and checked. It cannot fall
+back to an unrelated application runtime or download models during inference.
+"""
+from pathlib import Path
+import json
+import subprocess
+import sys
+from .paths import ROOT
+from .storage import atomic_json, sha256
+
+PACKAGES = {'torch': '2.7.1+cu128', 'numpy': '1.26.4', 'scipy': '1.17.1',
+ 'smplx': '0.1.28', 'timm': '1.0.30', 'torchvision': '0.22.1+cu128'}
+ENGINE_FILES = ('LICENSE', 'segmentation/run_ma_masks.py', 'landmarks/run_ma_2d.py',
+ 'optimization/run_ma_3d.py', 'capture/run_ma_cap.py',
+ 'landmarks/lib/datasets/vitdet_dataset.py',
+ 'optimization/losses/losses.py', 'speed_landmarks.py', 'speed_crop.py')
+
+
+def configuration(root=ROOT):
+ path = Path(root)/'.setup/mamma-runtime.json'
+ if not path.is_file():
+ raise RuntimeError('MAMMA runtime is not installed. Close the app and run Setup_MAMMA.cmd. See docs/MAMMA.md.')
+ if path.stat().st_size > 2*1024**2:
+ raise ValueError('Invalid MAMMA runtime configuration.')
+ value = json.loads(path.read_text(encoding='utf-8'))
+ if value.get('version') not in (2,3) or not value.get('license_reviewed'):
+ raise ValueError('Review the official MAMMA license before configuring its optional environment.')
+ for key in ('python', 'engine'):
+ if not isinstance(value.get(key), str) or not Path(value[key]).is_absolute():
+ raise ValueError('Invalid MAMMA '+key+' path.')
+ if not Path(value['python']).is_file() or not Path(value['engine']).is_dir():
+ raise RuntimeError('The configured MAMMA environment is missing. Its project data was preserved.')
+ if value.get('version')==3:
+ from tools.setup_mamma import identity
+ if value.get('managed_id')!=identity(root):
+ raise RuntimeError('MAMMA runtime configuration changed. Close the app and run Setup_MAMMA.cmd; other models and projects are preserved.')
+ return value
+
+
+def command(stage, args):
+ cfg = configuration()
+ return [cfg['python'], '-I', '-u', str(ROOT/'mamma_worker_boot.py'), stage, *map(str, args)]
+
+
+def activate():
+ import importlib.metadata as metadata
+ cfg = configuration()
+ if Path(sys.executable).resolve() != Path(cfg['python']).resolve() or sys.version_info[:2] != (3, 11):
+ raise RuntimeError('MAMMA must run in its separately configured Python 3.11 environment.')
+ for name, version in PACKAGES.items():
+ if metadata.version(name) != version:
+ raise RuntimeError('Unsupported MAMMA '+name+' version. Keep its validated environment separate.')
+ if cfg.get('version')==3:
+ import torch
+ if not torch.cuda.is_available() or list(torch.cuda.get_device_capability())!=cfg.get('compute_capability'):
+ raise RuntimeError('MAMMA native kernels were built for a different GPU architecture. Run Setup_MAMMA.cmd on this PC.')
+ engine = Path(cfg['engine'])
+ verify_engine(cfg)
+ return engine
+
+
+def snapshot(engine):
+ engine=Path(engine).resolve()
+ names=set(ENGINE_FILES)
+ for folder in ('capture','segmentation','landmarks','optimization'):
+ for path in (engine/folder).rglob('*'):
+ if path.suffix.lower() not in ('.py','.yaml','.yml','.json'):continue
+ if any(part in ('__pycache__','.git','outputs','results','data') for part in path.relative_to(engine).parts):continue
+ if not path.resolve().is_relative_to(engine):raise ValueError('Linked MAMMA engine code leaves its installation.')
+ names.add(path.relative_to(engine).as_posix())
+ if len(names)>8192:raise ValueError('MAMMA engine code inventory is too large.')
+ return {name:sha256(engine/name) for name in sorted(names)}
+
+
+def verify_engine(cfg):
+ if snapshot(cfg['engine'])!=cfg.get('engine_files'):
+ raise RuntimeError('MAMMA engine or configuration changed. Run Setup_MAMMA.cmd or revalidate the separately configured environment.')
+
+
+def configure(python, engine, root=ROOT, managed_id=None):
+ python, engine = Path(python).resolve(), Path(engine).resolve()
+ for name in ENGINE_FILES:
+ if not (engine/name).is_file():
+ raise ValueError('Missing validated Windows engine component: '+name)
+ # Version and imports are checked by the target interpreter, not this GUI.
+ code = ('import sys,json,importlib.metadata as m;'
+ 'import torch,numpy,scipy,smplx,timm,torchvision,sam2,pytorch_sdf,open_clip;'
+ 'print(json.dumps(dict(python=list(sys.version_info[:3]),packages={n:m.version(n) for n in '+repr(list(PACKAGES))+'},cuda=torch.cuda.is_available(),compute_capability=list(torch.cuda.get_device_capability()) if torch.cuda.is_available() else None)))')
+ result = subprocess.run([str(python), '-I', '-c', code], capture_output=True, text=True,
+ encoding='utf-8', errors='replace', timeout=120, creationflags=0x08000000)
+ if result.returncode:
+ raise RuntimeError('MAMMA runtime import check failed:\n'+result.stderr[-4000:])
+ checked = json.loads(result.stdout.strip().splitlines()[-1])
+ if checked['python'][:2] != [3, 11] or checked['packages'] != PACKAGES or not checked['cuda']:
+ raise ValueError('The environment does not match the validated CUDA/Python MAMMA profile: '+str(checked))
+ entry = dict(version=2, python=str(python), engine=str(engine), license_reviewed=True,
+ packages=PACKAGES, engine_files=snapshot(engine))
+ if managed_id:entry.update(version=3,managed_id=managed_id,compute_capability=checked['compute_capability'])
+ atomic_json(Path(root)/'.setup/mamma-runtime.json', entry)
+ return checked
diff --git a/mocap/mamma_scene.py b/mocap/mamma_scene.py
new file mode 100644
index 0000000..d2416ae
--- /dev/null
+++ b/mocap/mamma_scene.py
@@ -0,0 +1,19 @@
+"""MAMMA actors already share one metric world; never re-estimate placement."""
+import json
+from pathlib import Path
+from .storage import atomic_json
+from .people_store import load_people,media_receipt,safe_child
+from .scene_camera import read_camera,VERSION,take_projects
+
+
+def prepare_cameras(root):
+ root=Path(root);state=load_people(root)
+ rows=take_projects(root,state)
+ if not rows:raise ValueError('MAMMA shared scene has no source takes.')
+ for _,project in rows:
+ if read_camera(project) is None:raise ValueError('MAMMA calibrated camera/body receipt changed. Prepare its source result again.')
+ person,project=rows[0];camera=read_camera(project)
+ target=root/'people_scene.json'
+ atomic_json(target,dict(version=VERSION,input=media_receipt(root),anchor=project.relative_to(root).as_posix(),
+ anchor_id=person,world_to_camera=camera['world_to_camera'],sources=camera['sources'],floor=0.,K=camera['K'],camera_mode='static',scale=1.))
+ return target
diff --git a/mocap/mamma_ui.py b/mocap/mamma_ui.py
new file mode 100644
index 0000000..e56b1f8
--- /dev/null
+++ b/mocap/mamma_ui.py
@@ -0,0 +1,436 @@
+"""Synchronized multi-view inputs and MAMMA settings."""
+from pathlib import Path
+from threading import Condition
+import math
+import cv2
+from PySide6.QtCore import Qt, QSize, QThread, Signal
+from PySide6.QtGui import QImage, QPixmap, QIcon
+from PySide6.QtWidgets import (QWidget,QVBoxLayout,QGridLayout,QScrollArea,QToolButton,
+ QComboBox,QLabel,QPushButton,QFileDialog,QSizePolicy,QSpinBox,QDoubleSpinBox)
+from .mamma_inputs import video_paths, common_media, read_calibration, match_calibration, resolved_entries
+from .ui_refresh import batch_readiness
+
+
+class CameraThumbnail(QToolButton):
+ def minimumSizeHint(self):return QSize(48,88)
+ def sizeHint(self):return QSize(100,88)
+ def resizeEvent(self,event):
+ self.setIconSize(QSize(max(16,min(100,self.width()-10)),48))
+ super().resizeEvent(event)
+
+
+class InputInspector(QThread):
+ finished_input = Signal(str,int,object)
+ failed_input = Signal(str,int,str)
+
+ def __init__(self,parent):
+ super().__init__(parent)
+ self.condition=Condition();self.pending={};self.tokens={};self.stopping=False
+
+ def request(self,kind,value):
+ with self.condition:
+ token=self.tokens.get(kind,0)+1;self.tokens[kind]=token
+ self.pending[kind]=(token,value);self.condition.notify()
+ return token
+
+ def obsolete(self,kind,token):
+ with self.condition:return self.stopping or self.tokens.get(kind)!=token
+
+ def stop(self):
+ with self.condition:self.stopping=True;self.pending.clear();self.condition.notify()
+
+ def run(self):
+ while True:
+ with self.condition:
+ while not self.pending and not self.stopping:self.condition.wait()
+ if self.stopping:return
+ kind=next(iter(self.pending));token,value=self.pending.pop(kind)
+ try:
+ if kind=='calibration':result=read_calibration(value)
+ else:
+ result=[]
+ for path in video_paths(value):
+ if self.obsolete(kind,token):break
+ cap=cv2.VideoCapture(str(path),cv2.CAP_FFMPEG,
+ [cv2.CAP_PROP_N_THREADS,1,cv2.CAP_PROP_OPEN_TIMEOUT_MSEC,1500,cv2.CAP_PROP_READ_TIMEOUT_MSEC,1500])
+ try:
+ fps=cap.get(cv2.CAP_PROP_FPS);frames=int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
+ w,h=int(cap.get(3)),int(cap.get(4));ok,im=cap.read()
+ if not cap.isOpened() or not ok or not math.isfinite(fps) or min(fps,frames,w,h)<=0:
+ raise ValueError('Cannot read camera video: '+path.name)
+ # A bounded early sample is more useful than a black
+ # first frame in recordings that begin with lights off.
+ cap.set(cv2.CAP_PROP_POS_FRAMES,min(frames-1,round(fps)))
+ sample_ok,sample=cap.read()
+ if sample_ok:im=sample
+ scale=min(144/w,81/h)
+ im=cv2.resize(im,(max(1,round(w*scale)),max(1,round(h*scale))))
+ im=cv2.cvtColor(im,cv2.COLOR_BGR2RGB)
+ image=QImage(im.data,im.shape[1],im.shape[0],im.strides[0],QImage.Format_RGB888).copy()
+ result.append((dict(id=path.stem,path=str(path),metadata=dict(width=w,height=h,fps=fps,frames=frames,duration=frames/fps)),image))
+ finally:cap.release()
+ if not self.obsolete(kind,token):common_media([e for e,image in result])
+ if not self.obsolete(kind,token):self.finished_input.emit(kind,token,result)
+ except Exception as error:
+ message=('Missing camera calibration field: '+str(error) if kind=='calibration' and isinstance(error,KeyError) else str(error))
+ if not self.obsolete(kind,token):self.failed_input.emit(kind,token,message)
+
+
+class MammaWorkspace:
+ def init_mamma(self):
+ self.mamma_inputs=[];self.mamma_active_camera=0;self.mamma_calibration=None
+ self.mamma_inspector=None;self.mamma_tokens={};self.mamma_pending=False
+ self._mamma_restore=None;self._mamma_switching=False;self._mamma_resume=False
+ self._mamma_primary_opening=False
+
+ def build_mamma_thumbnails(self,parent_layout):
+ self.mamma_thumbnails=QScrollArea()
+ self.mamma_thumbnails.setWidgetResizable(True)
+ self.mamma_thumbnails.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
+ self.mamma_thumbnails.setMaximumHeight(220)
+ self.mamma_thumbnails.setAccessibleName('MAMMA camera thumbnails')
+ inner=QWidget();self.mamma_thumbnail_grid=QGridLayout(inner)
+ self.mamma_thumbnail_grid.setContentsMargins(4,4,4,4);self.mamma_thumbnail_grid.setSpacing(4)
+ for c in range(4):self.mamma_thumbnail_grid.setColumnStretch(c,1)
+ self.mamma_thumbnails.setWidget(inner);self.mamma_thumbnails.hide()
+ parent_layout.addWidget(self.mamma_thumbnails)
+ self.mamma_thumbnail_buttons=[]
+
+ def build_mamma_settings(self):
+ page=QWidget();page.setProperty('motion_tool','mamma')
+ box=QVBoxLayout(page);box.setContentsMargins(8,0,8,0)
+ box.addWidget(QLabel('Camera Calibration'))
+ self.mamma_camera_mode=QComboBox()
+ self.mamma_camera_mode.addItem('VGGT (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.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.setMaximumHeight(72)
+ self.mamma_camera_note.setTextFormat(Qt.PlainText)
+ box.addWidget(self.mamma_camera_note)
+ self.mamma_people=QSpinBox();self.mamma_people.setRange(0,8);self.mamma_people.setValue(0)
+ people_label=QLabel('People');people_label.setBuddy(self.mamma_people)
+ self.mamma_people.setAccessibleName('Number of people')
+ self.mamma_people.setToolTip('0 = automatically detect the number of people. Set 1-8 to specify how many people to track if someone is missed or a background person is included. Count each person once across all cameras. Find person is not needed.')
+ people_label.setToolTip(self.mamma_people.toolTip());box.addWidget(people_label)
+ self.mamma_people.valueChanged.connect(self.mamma_settings_changed);box.addWidget(self.mamma_people)
+ self.mamma_height=QDoubleSpinBox();self.mamma_height.setRange(.5,2.5);self.mamma_height.setDecimals(2);self.mamma_height.setValue(1.7);self.mamma_height.setSingleStep(.01)
+ self.mamma_height.setAccessibleName('Reference height in metres')
+ height_label=QLabel('Reference Height (m)');height_label.setBuddy(self.mamma_height)
+ self.mamma_height.setToolTip('VGGT has no absolute metric scale. Approximate standing height sets the scene scale. This estimate assumes visible, initially standing people; it does not force every actor to this height. Supplied metric calibration does not use this value.')
+ height_label.setToolTip(self.mamma_height.toolTip());box.addWidget(height_label)
+ self.mamma_height.valueChanged.connect(self.mamma_settings_changed);box.addWidget(self.mamma_height)
+ self.mamma_setup_notice=QLabel('MAMMA runtime required. Open Model Manager > Runtime Setup.')
+ self.mamma_setup_notice.setWordWrap(True);self.mamma_setup_notice.setStyleSheet('color:#ffb45c')
+ box.addWidget(self.mamma_setup_notice)
+ page.setToolTip('Open synchronized, fixed-camera videos of the same performance. All videos share one trim range, starting at the same time. Select a thumbnail to change the preview camera.')
+ self.model_pages.addWidget(page)
+
+ def mamma_worker(self):
+ if self.mamma_inspector is None:
+ self.mamma_inspector=InputInspector(self)
+ self.mamma_inspector.finished_input.connect(self.mamma_input_ready)
+ self.mamma_inspector.failed_input.connect(self.mamma_input_failed)
+ self.mamma_inspector.start()
+ return self.mamma_inspector
+
+ def clear_mamma_inputs(self):
+ self.mamma_inputs=[];self.mamma_active_camera=0;self.mamma_pending=False;self._mamma_restore=None
+ self._mamma_switching=False;self._mamma_resume=False
+ self._mamma_primary_opening=False
+ if self.mamma_inspector:
+ with self.mamma_inspector.condition:
+ for kind in ('videos','calibration'):
+ token=self.mamma_inspector.tokens.get(kind,0)+1
+ self.mamma_inspector.tokens[kind]=self.mamma_tokens[kind]=token
+ self.mamma_inspector.pending.pop(kind,None)
+ self.mamma_thumbnails.hide()
+ self.slider.video_track_label='Source clip';self.slider._cache_key=None
+
+ def load_mamma_videos(self,paths,restore=None):
+ if self.busy or self.contact_saving:return False
+ try:
+ paths=video_paths(paths)
+ self.stop_playback();self.mamma_pending=True;self._mamma_restore=restore
+ self.mamma_tokens['videos']=self.mamma_worker().request('videos',paths)
+ self.status.setText('Checking camera videos and preparing thumbnails...')
+ self.update_readiness();return True
+ except (OSError,ValueError) as error:
+ self.status.setText('Cannot open camera videos: '+str(error));return False
+
+ def mamma_input_ready(self,kind,token,result):
+ if token!=self.mamma_tokens.get(kind):return
+ if kind=='calibration':
+ try:
+ if self.mamma_inputs:match_calibration(result,self.mamma_inputs)
+ self.mamma_calibration=result
+ self.mamma_camera_mode.setCurrentIndex(self.mamma_camera_mode.findData('manual'))
+ self.mamma_settings_changed()
+ self.status.setText('Camera calibration loaded: '+result['filename'])
+ except (ValueError,KeyError,TypeError) as error:self.mamma_input_failed(kind,token,str(error))
+ return
+ self.mamma_pending=False
+ if self.model_choice.currentData()!='mamma':self.update_readiness();return
+ entries=[e for e,image in result];info=common_media(entries)
+ restore=self._mamma_restore;self._mamma_restore=None
+ if restore:
+ for entry,saved in zip(entries,restore.get('entries',[])):
+ if saved.get('media'):entry['media']=saved['media']
+ if not restore:
+ if self.workspace_root is not None:self.remember_workspace_model()
+ self.workspace_root=None;self._workspace_video_reference=False;self._workspace_camera=None
+ self.clear_preview();self.reset_people();self.project=None
+ self.motion_view.auto_fit=True
+ self.video_path=Path(entries[0]['path'])
+ self.setWindowTitle('RGB MoCap | MAMMA Multi-View Inputs')
+ for control in (self.htd_refine,self.footmr_refine,self.motion_correction):
+ control.blockSignals(True);control.setChecked(True);control.blockSignals(False)
+ self.restore_correction_options({});self.active_result=self.selected_result()
+ self.mamma_calibration=None;self.mamma_camera_mode.blockSignals(True)
+ self.mamma_camera_mode.setCurrentIndex(0);self.mamma_camera_mode.blockSignals(False)
+ self.mamma_inputs=entries;self.info=info;self.source_offset=0.;self.source_end=info['duration']
+ if restore and restore.get('result_project'):
+ import json
+ state=json.loads((Path(restore['result_project'])/'project.json').read_text(encoding='utf-8'))
+ info=dict(fps=state['fps'],frames=state['frames'],duration=state['frames']/state['fps'])
+ self.info=info;self.source_offset=state['start'];self.source_end=state['end']
+ self.slider.set_media(info['fps']);self.slider.setRange(0,info['frames']-1);self.slider.reset_trim()
+ self.slider.video_track_label=f'{len(entries)} cameras · common trim';self.slider._cache_key=None
+ while self.mamma_thumbnail_grid.count():
+ widget=self.mamma_thumbnail_grid.takeAt(0).widget()
+ if widget:widget.deleteLater()
+ self.mamma_thumbnail_buttons=[]
+ for i,(entry,image) in enumerate(result):
+ button=CameraThumbnail();button.setCheckable(True);button.setAutoExclusive(True)
+ button.setToolButtonStyle(Qt.ToolButtonTextUnderIcon);button.setIcon(QIcon(QPixmap.fromImage(image)))
+ button.setIconSize(QSize(100,48));button.setText(str(i+1));button.setMinimumWidth(0)
+ button.setFixedHeight(88);button.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed)
+ button.setToolTip(entry['id']+'\n'+entry['path']);button.setAccessibleName('Preview camera '+entry['id'])
+ button.setStyleSheet('QToolButton{background:#303030;border:1px solid #555;padding:3px;color:#ddd}QToolButton:checked{border:2px solid #8ac1ff;background:#385571}')
+ button.clicked.connect(lambda checked=False,i=i:self.select_mamma_camera(i))
+ self.mamma_thumbnail_grid.addWidget(button,i//4,i%4);self.mamma_thumbnail_buttons.append(button)
+ self.mamma_thumbnails.setFixedHeight(min(220,8+math.ceil(len(entries)/4)*92))
+ self.mamma_thumbnails.setVisible(len(entries)>1)
+ if restore:
+ self.restore_mamma_options(restore.get('options',{}))
+ self.restore_workspace_view(restore.get('view',{}))
+ self.mamma_active_camera=-1
+ self.select_mamma_camera(min(int((restore or {}).get('active_camera',0)),len(entries)-1))
+ self.clip_changed(self.slider.clip_in,self.slider.clip_out)
+ self.status.setText(f'{len(entries)} camera videos loaded. Common trim applies to every camera; video starts must already be synchronized. Use synchronized views of the same performance, then Reconstruct 3D.')
+ self.mamma_settings_changed()
+
+ def mamma_input_failed(self,kind,token,error):
+ if token!=self.mamma_tokens.get(kind):return
+ if kind=='videos':self.mamma_pending=False;self._mamma_restore=None
+ self.status.setText(('Cannot open camera videos: ' if kind=='videos' else 'Cannot import camera calibration: ')+error)
+ self.update_readiness()
+
+ @batch_readiness
+ def select_mamma_camera(self,index,*,refresh=False):
+ if not 0<=index<len(self.mamma_inputs) or (index==self.mamma_active_camera and not refresh):return
+ self._mamma_resume=self.timer.isActive();self.stop_playback();self.mamma_active_camera=index
+ self.mamma_thumbnail_buttons[index].setChecked(True)
+ self._mamma_switching=True;self.video_readable=False
+ entry=self.mamma_inputs[index]
+ path=Path(entry['path']);first=0
+ if self.project is not None:
+ import json
+ state=json.loads((self.project/'project.json').read_text(encoding='utf-8'))
+ if state.get('pipeline',{}).get('model')=='mamma':
+ saved=next((v for v in state.get('mamma_preview_videos',[]) if v['id']==entry['id']),None)
+ if saved:
+ path=(self.project/saved['path']).resolve();first=saved['first']
+ if self.workspace_root is None or not path.is_relative_to(self.workspace_root.resolve()):
+ raise ValueError('Invalid saved MAMMA preview camera path.')
+ opened=self.video_view.open(path,timeline_fps=self.info['fps'],timeline_start=first,reuse=True)
+ self.filename.setText(f"{len(self.mamma_inputs)} camera videos · {entry['id']} · common range {self.info['duration']:.2f} s")
+ if not opened:self.mamma_video_ready(dict(fps=self.video_view.native_fps))
+ self.update_readiness()
+
+ def mamma_video_ready(self,info):
+ if self._mamma_primary_opening:
+ self._mamma_primary_opening=False;self.video_readable=True
+ self.seek(self.slider.value());self.update_readiness();return True
+ if self.model_choice.currentData()!='mamma' or not self.mamma_inputs:return False
+ self.video_readable=True;self._mamma_switching=False
+ self.fps_label.setText(f"Camera {self.mamma_active_camera+1} · Source {info['fps']:.2f} | Timeline {self.info['fps']:.0f} fps")
+ self.seek(self.slider.value())
+ if self._mamma_resume:self._mamma_resume=False;self.toggle_play()
+ self.update_readiness();return True
+
+ @batch_readiness
+ def mamma_project_loaded(self,project,state):
+ if state.get('pipeline',{}).get('model')!='mamma':return
+ import json
+ root=self.workspace_root
+ if root is None:return
+ saved=json.loads((root/'project.json').read_text(encoding='utf-8'))
+ entries=resolved_entries(root,saved.get('mamma_inputs',[]))
+ if not entries:return
+ active=min(saved.get('mamma_active_camera',0),len(entries)-1)
+ options=state.get('mamma_options',{})
+ import copy
+ self._mamma_committed_options=copy.deepcopy(options)
+ if [(e['id'],str(Path(e['path']).resolve())) for e in self.mamma_inputs]==[(e['id'],e['path']) for e in entries] and self.mamma_thumbnail_buttons:
+ self.restore_mamma_options(options)
+ # The selected camera is independent of the selected person.
+ self.select_mamma_camera(min(self.mamma_active_camera,len(entries)-1),refresh=True)
+ else:
+ # Loading an actor resets the viewport before thumbnails arrive.
+ # That temporary default is not the user's saved scene camera.
+ view=saved.get('models',{}).get('mamma',{}).get('view') or {}
+ if not view:
+ view=dict(source_time=state['start'],trim_time=[state['start'],state['end']])
+ self.load_mamma_videos([e['path'] for e in entries],restore=dict(options=options,
+ active_camera=active,view=view,entries=entries,result_project=str(project)))
+
+ def mamma_mode_changed(self,previous,model):
+ if previous=='mamma' and model!='mamma' and self.mamma_inputs and self.project is None:
+ # A single-view model must never show camera 3 while processing
+ # the primary camera 1. This is display switching, not inference.
+ self.stop_playback();self._mamma_primary_opening=True;self.video_readable=False
+ self.video_view.open(Path(self.mamma_inputs[0]['path']),timeline_fps=self.info['fps'])
+ elif model=='mamma' and previous!='mamma' and self.mamma_inputs and self.project is None:
+ oldfps=self.info['fps'];start,end=self.processing_range();frame=self.source_offset+self.slider.value()/oldfps
+ self.info=common_media(self.mamma_inputs);self.source_offset=0.;self.source_end=self.info['duration']
+ self.slider.set_media(30.);self.slider.setRange(0,self.info['frames']-1)
+ self.slider.set_clip(round(start*30),round(end*30));self.slider.setValue(round(frame*30))
+ self.slider.video_track_label=f'{len(self.mamma_inputs)} cameras · common trim'
+ self.mamma_active_camera=-1;self.select_mamma_camera(0)
+
+ def choose_mamma_calibration(self):
+ name,_=QFileDialog.getOpenFileName(self,'Import Camera Calibration','','Camera calibration (*.json *.yaml *.yml)')
+ if name:
+ self.mamma_tokens['calibration']=self.mamma_worker().request('calibration',name)
+ self.status.setText('Checking camera calibration...')
+
+ def mamma_options(self):
+ return dict(camera_mode=self.mamma_camera_mode.currentData(),calibration=self.mamma_calibration,people=self.mamma_people.value(),height_m=self.mamma_height.value())
+
+ def restore_mamma_options(self,options):
+ if not isinstance(options,dict) or options.get('camera_mode','vggt') not in {'vggt','manual'}:
+ raise ValueError('Invalid saved MAMMA camera settings.')
+ people=options.get('people',0);height=options.get('height_m',1.7)
+ if isinstance(people,bool) or not isinstance(people,int) or not 0<=people<=8:
+ raise ValueError('Invalid saved MAMMA person count.')
+ if isinstance(height,bool) or not isinstance(height,(int,float)) or not math.isfinite(height) or not .5<=height<=2.5:
+ raise ValueError('Invalid saved MAMMA reference height.')
+ self.mamma_people.blockSignals(True);self.mamma_height.blockSignals(True)
+ self.mamma_people.setValue(int(options.get('people',0)));self.mamma_height.setValue(float(options.get('height_m',1.7)))
+ self.mamma_people.blockSignals(False);self.mamma_height.blockSignals(False)
+ self.mamma_calibration=options.get('calibration')
+ if self.mamma_calibration is not None and (not isinstance(self.mamma_calibration,dict) or
+ not isinstance(self.mamma_calibration.get('filename'),str) or not isinstance(self.mamma_calibration.get('cameras'),dict)):
+ self.mamma_calibration=None
+ raise ValueError('Invalid saved MAMMA calibration data.')
+ self.mamma_camera_mode.blockSignals(True)
+ self.mamma_camera_mode.setCurrentIndex(max(0,self.mamma_camera_mode.findData(options.get('camera_mode','vggt'))))
+ self.mamma_camera_mode.blockSignals(False)
+ self.mamma_settings_changed()
+
+ def mamma_settings_changed(self,*_):
+ manual=self.mamma_camera_mode.currentData()=='manual';message=''
+ if manual:
+ if self.mamma_calibration:
+ message=self.mamma_calibration['filename']
+ try:
+ if self.mamma_inputs:match_calibration(self.mamma_calibration,self.mamma_inputs)
+ except ValueError as error:message='Warning: '+str(error)
+ else:message='Import camera calibration to use Manual Camera Data.'
+ self.mamma_camera_note.setText(message[:240]+('…' if len(message)>240 else ''))
+ self.mamma_camera_note.setToolTip(message)
+ self.mamma_camera_note.setVisible(manual)
+ self.mamma_camera_import.setEnabled(not self.busy)
+ self.mamma_camera_mode.setEnabled(not self.busy)
+ self.mamma_height.setEnabled(not self.busy and not manual)
+ self.mamma_people.setEnabled(not self.busy)
+ if hasattr(self,'readiness'):self.update_readiness()
+
+ def run_mamma(self):
+ import hashlib,json,uuid
+ from .paths import HOME,PROJECTS
+ from .storage import atomic_json
+ from .mamma_pipeline import STAGES
+ from .mamma_runtime import configuration
+ from .models import missing
+ if self.busy or self.mamma_pending or self.contact_saving:return
+ try:
+ if len(self.mamma_inputs)<2:
+ raise ValueError('Use at least two synchronized fixed-camera videos for MAMMA reconstruction.')
+ 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']
+ if absent:
+ self.status.setText('Prepare the missing MAMMA models first.');self.open_model_manager();return
+ first,end=self.processing_range()
+ root=self.workspace_root
+ if root is None:
+ token=hashlib.sha256('|'.join(e['path'] for e in self.mamma_inputs).encode()).hexdigest()[:14]
+ root=PROJECTS/(Path(self.mamma_inputs[0]['path']).stem[:80]+'_'+token+'_project')
+ folder=HOME/'cache/mamma-jobs';folder.mkdir(parents=True,exist_ok=True)
+ request=folder/(uuid.uuid4().hex+'.json')
+ atomic_json(request,dict(version=1,root=str(root),inputs=self.mamma_inputs,start=first,end=end,
+ options=options,active_camera=self.mamma_active_camera,
+ correction_enabled=self.motion_correction.isChecked(),correction=self.selected_correction_options()))
+ self.start_jobs([(stage,['--request',str(request)]) for stage in STAGES])
+ except (OSError,ValueError,RuntimeError,KeyError) as error:
+ self.status.setText('Cannot start MAMMA: '+str(error))
+
+ def sync_mamma_controls(self):
+ mamma=self.model_choice.currentData()=='mamma'
+ self.find_person_button.setVisible(not mamma)
+ from .people_ui import PEOPLE_HELP
+ self.people_help_dialog.setText(
+ 'MAMMA detects and matches people across the camera videos during Reconstruct 3D. Find person is not needed. '
+ 'Set People to 0 for automatic detection, or 1-8 for the expected number of people. The first camera should show the intended people clearly.\n\n'
+ 'After reconstruction, check rows to show people and select a row to edit its contact timings. '
+ 'Right-click to rename; click the color square to change its preview color. Source motion is preserved.' if mamma else PEOPLE_HELP)
+ self.mamma_thumbnails.setVisible(mamma and len(self.mamma_inputs)>1)
+ if mamma:
+ self.run_button.setEnabled(not self.busy and self.video_readable and len(self.mamma_inputs)>=2)
+ self.find_person_button.setEnabled(False)
+ self.models_button.setEnabled(not self.busy)
+ self.run_button.setToolTip('Reconstruct the same performance from two or more synchronized fixed-camera videos. No fixed camera-count maximum; available RAM and VRAM determine practical capacity. Uses SAM 2.1 masks, MAMMA FP32 landmarks, VGGT or supplied cameras and the full MAMMA body fit. No automatic video synchronization is performed.')
+ try:
+ from .mamma_runtime import configuration
+ configuration()
+ message=''
+ if self.mamma_inputs and len(self.mamma_inputs)<2:
+ message='Reconstruction requires at least two synchronized camera videos.'
+ elif self.project is not None and getattr(self,'_mamma_committed_options',None)!=self.mamma_options():
+ message='Camera/person settings changed. Reconstruct 3D to apply; the previous motion is still displayed.'
+ self.mamma_setup_notice.setText(message);self.mamma_setup_notice.setVisible(bool(message))
+ except (OSError,ValueError,RuntimeError) as error:
+ self.mamma_setup_notice.setText(str(error));self.mamma_setup_notice.show()
+ self.run_button.setEnabled(False)
+ self.mamma_camera_import.setEnabled(not self.busy)
+ self.mamma_camera_mode.setEnabled(not self.busy)
+ else:
+ self.run_button.setToolTip('Create 3D motion for checked people in the trimmed video range using the selected model.')
+ if self.mamma_pending:
+ self.save_project_action.setEnabled(False);self.slider.trim_enabled=False;self.play_button.setEnabled(False)
+ self.run_button.setEnabled(False);self.find_person_button.setEnabled(False)
+ for button in self.mamma_thumbnail_buttons:button.setEnabled(not self.busy and not self.mamma_pending)
+
+ def restore_mamma_project_inputs(self,state,root,view):
+ entries=resolved_entries(root,state.get('mamma_inputs',[]))
+ if not entries:return False
+ active=state.get('mamma_active_camera',0)
+ if not isinstance(active,int) or not 0<=active<len(entries):
+ raise ValueError('Invalid saved preview camera.')
+ options=state.get('models',{}).get('mamma',{}).get('settings',{}).get('mamma_options',{})
+ self.restore_mamma_options(options)
+ return self.load_mamma_videos([e['path'] for e in entries],restore=dict(
+ options=options,active_camera=active,view=view,entries=entries))
+
+ def shutdown_mamma(self):
+ if self.mamma_inspector:
+ for kind in ('videos','calibration'):self.mamma_tokens[kind]=self.mamma_tokens.get(kind,0)+1
+ self.mamma_inspector.stop();self.mamma_inspector.wait();self.mamma_inspector.deleteLater();self.mamma_inspector=None
diff --git a/mocap/mesh_data.py b/mocap/mesh_data.py
index 7bfa176..e1dd445 100644
--- a/mocap/mesh_data.py
+++ b/mocap/mesh_data.py
@@ -28,7 +28,8 @@ def prepare_mesh_preview(project, model_path=None, kinds=None):
from smplx.lbs import batch_rodrigues, batch_rigid_transform
from .paths import MODELS
project = Path(project)
- model_path = Path(model_path or MODELS / "body_models/smplx/SMPLX_NEUTRAL.npz")
+ from .mamma_body import body_path
+ model_path = Path(model_path) if model_path is not None else body_path(project)
body = smplx.SMPLX(str(model_path), gender="neutral", num_pca_comps=12,
flat_hand_mean=False, batch_size=1).eval()
stat = model_path.stat()
diff --git a/mocap/mesh_gl.py b/mocap/mesh_gl.py
index ae2fea7..6ce920a 100644
--- a/mocap/mesh_gl.py
+++ b/mocap/mesh_gl.py
@@ -134,14 +134,13 @@ class MeshRenderer:
self.vertex_count = int(asset["vertex_count"])
self.index_count = asset["faces"].size
self.vao.bind()
- if self.shared and self.shared.asset_key!=asset['key']:
- raise ValueError('Shared scene meshes must use the same body model')
- self.model = self.shared.model if self.shared else self.buffer(asset["packed"])
+ owner = self.shared if self.shared and self.shared.asset_key==asset['key'] else None
+ self.model = owner.model if owner else self.buffer(asset["packed"])
self.vertices = self.buffer(self.vertex_count*32)
- self.offsets = self.shared.offsets if self.shared else self.buffer(asset["offsets"])
- self.neighbors = self.shared.neighbors if self.shared else self.buffer(asset["neighbors"])
+ self.offsets = owner.offsets if owner else self.buffer(asset["offsets"])
+ self.neighbors = owner.neighbors if owner else self.buffer(asset["neighbors"])
self.frame = self.buffer(1389*4)
- self.indices = self.shared.indices if self.shared else self.buffer(asset["faces"],QOpenGLBuffer.IndexBuffer)
+ self.indices = owner.indices if owner else self.buffer(asset["faces"],QOpenGLBuffer.IndexBuffer)
self.indices.bind()
for index,b in enumerate((self.model,self.vertices,self.offsets,self.neighbors,self.frame)):
self.gl.glBindBufferBase(0x90D2,index,b.bufferId())
diff --git a/mocap/mixamo_data.py b/mocap/mixamo_data.py
index cdf8a70..fb3f79f 100644
--- a/mocap/mixamo_data.py
+++ b/mocap/mixamo_data.py
@@ -31,7 +31,10 @@ def current(project,kind):
require_supported_project(project)
if float(state.get('fps',30))!=record['fps']:return False
from .models import BY_KEY
- model=BY_KEY[record.get('model_key','smplx')].path
+ if state.get('pipeline',{}).get('model')=='mamma':
+ from .mamma_body import body_path
+ model=body_path(project)
+ else:model=BY_KEY[record.get('model_key','smplx')].path
if model.is_file() and record.get('model_stat') is not None and file_stat(model)!=record['model_stat']:return False
for name,stamp in record['sources'].items():
from .project_storage import resolve_reference
@@ -99,7 +102,8 @@ def prepare(project, result, emit=lambda *a, **k: None, body=None):
from .correction import contact_strength
from .models import BY_KEY
project = Path(project)
- model = BY_KEY['smplx'].path
+ from .mamma_body import body_path
+ model = body_path(project)
model_stamp = file_stat(model)
if body is None:
body = smplx.SMPLX(str(model), gender='neutral', num_pca_comps=12, flat_hand_mean=False, batch_size=1).eval()
diff --git a/mocap/model_guide.py b/mocap/model_guide.py
index c83e494..01ac680 100644
--- a/mocap/model_guide.py
+++ b/mocap/model_guide.py
@@ -12,11 +12,13 @@ BENCHMARKS = {
'exmr': ('1m 08s', '11.32', '19.31'),
}
PROJECT_URLS = {
+ 'mamma': 'https://mamma.is.tue.mpg.de/',
'gvhmr': 'https://github.com/zju3dv/GVHMR',
'flowhmr': 'https://github.com/flowhmr/flowhmr',
'exmr': 'https://github.com/twehrbein/ExMR',
}
DESCRIPTIONS = {
+ '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.',
'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.',
@@ -26,7 +28,7 @@ DESCRIPTIONS = {
def guide_html(selected):
descriptions = ''.join(
- f'<p><b>{tool.label}</b> &nbsp; <a href="{PROJECT_URLS[key]}">GitHub project</a><br>'
+ f'<p><b>{tool.label}</b> &nbsp; <a href="{PROJECT_URLS[key]}">Original project</a><br>'
f'{DESCRIPTIONS[key]}</p>' for key, tool in MOTION_TOOLS.items())
rows = ''.join(
('<tr bgcolor="#303f50">' if key == selected else '<tr>') +
@@ -47,7 +49,12 @@ Try another model if a particular movement looks wrong.</p>""" + descriptions +
<p>GVHMR: HTD + FootMR + HandFlow on. FlowHMR: original SAM; today's Fast SAM can
be faster. Recorded processing only, excluding tracking, app correction and export.
Memory shows measured worker peaks, not minimum requirements. Results vary by video and PC.</p>
-<p>All three support Motion Correction for foot and hand contacts. Contact correction reduces sliding;
+<h3>MAMMA: separate multi-view workflow</h3>
+<p>A manual app test with three 1080p-bounded camera videos, two people and 413 frames at 30 fps
+took 11m 52s through correction and preview on the test PC. Masks: 4m 18s; landmarks: 1m 30s;
+VGGT cameras: 14s; 3D fitting: 4m 54s; correction/preview: 32s. This is a different clip and workflow
+from the table above, so it is not a direct speed comparison. Start with a short common trim.</p>
+<p>All four support Motion Correction for foot and hand contacts. Contact correction reduces sliding;
it is separate from tracking fingers or refining ankle angles.</p></body></html>"""
diff --git a/mocap/models.py b/mocap/models.py
index fdeb65b..5c93884 100644
--- a/mocap/models.py
+++ b/mocap/models.py
@@ -91,6 +91,8 @@ MODELS_LIST.extend([
download_url='https://huggingface.co/facebook/sapiens2-pose-1b/resolve/f5fed8b97b99698d5eea1d14ff0855d0b4c3f000/sapiens2_1b_pose.safetensors',
expected_sha256='2dab7014a17e99e460c18817325a71dd7a81ce48d87027f01c2ee7d7b3af969f'),
])
+from .mamma_models import ASSETS as MAMMA_ASSETS, KEYS as MAMMA_KEYS, INSTRUCTIONS as MAMMA_INSTRUCTIONS
+MODELS_LIST.extend(Model(**entry) for entry in MAMMA_ASSETS)
BY_KEY = {model.key: model for model in MODELS_LIST}
MANUAL_INSTRUCTIONS = {
'mano_right': '1. Open the Recommended download link below, or click Open Download Page. This opens the official download server for the exact archive. Sign in and accept the provider terms; register on the official MANO website if needed.\n2. Download mano_v1_2.zip. If browsing the MANO website instead, this is Models & Code > Models & Code.\n3. Extract the ZIP and open mano_v1_2/models.\n4. Return to Hand Model / MANO Right, click Import and select MANO_RIGHT.pkl. Keep this PKL file intact.\nHandFlow uses a right-hand canonical model for both hands, reflecting the left result back. The separate SMPL-H downloads cannot replace this hand model.',
@@ -104,6 +106,8 @@ MANUAL_INSTRUCTIONS = {
}
+MANUAL_INSTRUCTIONS.update(MAMMA_INSTRUCTIONS)
+
for _key in ('mano_right','smplh'):
MANUAL_INSTRUCTIONS[_key] += ('\nIf the MANO website shows 502 Bad Gateway, use the Recommended download link below '
'to open the official download server and sign in there. If sign-in or downloading still fails, '
@@ -173,6 +177,8 @@ def manual_instructions_html(key: str) -> str:
links = [('Official website', model.url)]
if key in {'smplx','smpl'}:
links.append(('Download page (sign-in required)', manual_download_page(key)))
+ if key in {'mamma','mamma_vertices'}:
+ links.append(('MAMMA Data (registration and sign-in required)', 'https://mamma.is.tue.mpg.de/download.php'))
if model.drive_id:
links.append(('Download file: ' + model.path.name, 'https://drive.google.com/file/d/' + model.drive_id + '/view'))
elif model.download_url:
@@ -218,12 +224,19 @@ STAGE_REQUIREMENTS = {
'exmr_preprocess': ('exmr_sapiens',),
'exmr_features': ('flow_sam','flow_sam_config','flow_mhr','hand_hamer','hand_mean','mano_right'),
'exmr': ('exmr','smplx'),
+ 'mamma_assets': MAMMA_KEYS,
+ 'mamma_prepare': MAMMA_KEYS,
+ 'mamma_masks': ('mamma_sam2','mamma_yolo','mamma_clip'),
+ 'mamma_landmarks': ('mamma','mamma_vertices'),
+ 'mamma_camera': ('flow_vggt',),
+ 'mamma_fit': ('mamma_vertices','mamma_body','mamma_body_male','mamma_body_female'),
+ 'mamma_publish': ('mamma_body','mamma_vertices'),
}
def ready(model: Model) -> bool:
valid=model.path.is_file() and model.path.stat().st_size >= model.minimum_bytes
- if valid and (model.key.startswith(('flow','hand','exmr')) or model.key in ('smplh','mano_right')):
+ if valid and (model.key.startswith(('flow','hand','exmr','mamma')) or model.key in ('smplh','mano_right')):
import json
try:
receipt=json.loads(model.path.with_suffix(model.path.suffix+'.receipt.json').read_text(encoding='utf-8'))
diff --git a/mocap/motion_tools.py b/mocap/motion_tools.py
index 253cc19..c3704bd 100644
--- a/mocap/motion_tools.py
+++ b/mocap/motion_tools.py
@@ -9,8 +9,12 @@ class MotionTool:
label: str
reconstruction: tuple[str, ...]
refinement: tuple[str, ...] = ()
+ input_setup_only: bool = False
def stages(self, refine=False, footmr=False, correction=False, handflow=False):
+ if self.input_setup_only:
+ return []
+ if self.key == 'mamma':return list(self.reconstruction)
if self.key == 'flowhmr':
return [*self.reconstruction, *(('correct',) if correction else ()), 'flow_export']
return [*self.reconstruction, *(self.refinement if refine else ()), *(('footmr',) if footmr and self.key == 'gvhmr' else ()),
@@ -20,7 +24,8 @@ class MotionTool:
MOTION_TOOLS = {"gvhmr": MotionTool("gvhmr", "GVHMR", ("track", "gvhmr"), ("pva", "refine")),
"flowhmr": MotionTool("flowhmr", "FlowHMR", ("track", "flow_camera", "flow_features", "flowhmr")),
- "exmr": MotionTool("exmr", "ExMR", ("track", "exmr_preprocess", "exmr_features", "exmr"))}
+ "exmr": MotionTool("exmr", "ExMR", ("track", "exmr_preprocess", "exmr_features", "exmr")),
+ "mamma": MotionTool("mamma", "MAMMA", ("mamma_prepare","mamma_masks","mamma_landmarks","mamma_camera","mamma_fit","mamma_publish"))}
class UnsupportedMotionTool(ValueError):
@@ -146,7 +151,10 @@ def result_is_current(project, kind, ignore_contacts=False):
from .models import BY_KEY
# Already-baked previews remain usable without an imported model,
# just as uncorrected previews do. Compare it when available.
- model_path=BY_KEY[report.get('model_key','smplx')].path
+ if state.get('pipeline',{}).get('model')=='mamma':
+ from .mamma_body import body_path
+ model_path=body_path(project)
+ else:model_path=BY_KEY[report.get('model_key','smplx')].path
if model_path.is_file():
model=model_path.stat()
if report['model_stat']!=[model.st_size,model.st_mtime_ns]:return False
diff --git a/mocap/paths.py b/mocap/paths.py
index af9a432..acaf9ba 100644
--- a/mocap/paths.py
+++ b/mocap/paths.py
@@ -13,5 +13,8 @@ COMPAT = ROOT / "native_compat"
def worker_command(stage: str, *args: str) -> list[str]:
+ if stage.startswith('mamma_') and stage not in ('mamma_prepare','mamma_publish'):
+ from .mamma_runtime import command as mamma_command
+ return mamma_command(stage,args)
from .runtime_registry import command
return command(ROOT, stage, args, frozen=bool(getattr(sys, "frozen", False)))
diff --git a/mocap/people_ui.py b/mocap/people_ui.py
index c862342..2a15bdb 100644
--- a/mocap/people_ui.py
+++ b/mocap/people_ui.py
@@ -1,6 +1,7 @@
"""Person selection is separate from extraction checkboxes and model settings."""
from __future__ import annotations
from .tooltips import tooltip_text
+from .ui_refresh import batch_readiness
import json
from collections import OrderedDict
from pathlib import Path
@@ -281,6 +282,7 @@ class PeopleWorkspace:
movie_layout.setContentsMargins(0,0,0,0);movie_layout.setSpacing(0)
video.setMinimumWidth(260)
movie_layout.addWidget(video,1)
+ self.build_mamma_thumbnails(movie_layout)
footer = QWidget();footer.setObjectName('editorHeader')
bar = QHBoxLayout(footer);bar.setContentsMargins(7,3,7,3)
self.find_person_button = QPushButton('Find person')
@@ -470,6 +472,7 @@ class PeopleWorkspace:
save_people(self.people_root,self.people_state)
self.sync_scene_visibility()
+ @batch_readiness
def person_selected(self,item,previous=None):
if self._people_syncing or item is None or self.busy or self.contact_saving:return
if isinstance(item.data(Qt.UserRole),str):
@@ -477,6 +480,7 @@ class PeopleWorkspace:
self.activate_person(item.data(Qt.UserRole))
self.update_readiness()
+ @batch_readiness
def activate_person(self,ident,path=None):
if self.people_state is None:return
self.active_person_id=ident
diff --git a/mocap/project_save.py b/mocap/project_save.py
index 2c8516c..59e2b49 100644
--- a/mocap/project_save.py
+++ b/mocap/project_save.py
@@ -80,6 +80,21 @@ def save_project(request, emit=lambda *a, **k: None, cancelled=lambda: False):
raise ValueError('The project video is missing. Restore it before saving a copy.')
media_internal = source is not None and media.is_relative_to(source)
relative_media = media.relative_to(source).as_posix() if media_internal else 'media/' + media.name
+ # Each camera video is a project asset. Copy external inputs once; retain
+ # project-relative references so the saved folder can be moved intact.
+ camera_entries=request.get('mamma_inputs') or state.get('mamma_inputs',[])
+ camera_copies=[];saved_cameras=[]
+ if camera_entries:
+ from .mamma_inputs import resolved_entries
+ for i,entry in enumerate(resolved_entries(source or target,camera_entries)):
+ camera_path=Path(entry['path'])
+ if not camera_path.is_file():raise ValueError('Camera video is missing: '+camera_path.name)
+ internal=source is not None and camera_path.is_relative_to(source)
+ relative=(relative_media if camera_path==media else camera_path.relative_to(source).as_posix()
+ if internal else f'media/cameras/{i+1:02d}/'+camera_path.name)
+ if camera_path!=media and not internal:camera_copies.append((camera_path,relative))
+ value=dict(entry,media=relative,path=str(target/relative))
+ saved_cameras.append(value)
staging = target.parent / ('.' + target.name + '.saving-' + uuid.uuid4().hex)
def check():
if cancelled():
@@ -117,6 +132,7 @@ def save_project(request, emit=lambda *a, **k: None, cancelled=lambda: False):
total += stamp.st_size
if not media_internal:
total += media.stat().st_size
+ total+=sum(path.stat().st_size for path,_ in camera_copies)
if shutil.disk_usage(target.parent).free < total + 64 * 1024**2:
raise OSError('Not enough free space to save this project.')
check()
@@ -126,6 +142,8 @@ def save_project(request, emit=lambda *a, **k: None, cancelled=lambda: False):
copy_file(path, staging / path.relative_to(source), stamp)
if not media_internal:
copy_file(media, staging / relative_media, media.stat())
+ for camera_path,relative in camera_copies:
+ copy_file(camera_path,staging/relative,camera_path.stat())
if not source:
from . import video
from .project_workspace import create
@@ -139,6 +157,9 @@ def save_project(request, emit=lambda *a, **k: None, cancelled=lambda: False):
if grouped:
value=manifest(staging)
value.update(name=target.name,media=relative_media,time_offset=offset,active_model=request.get('model',value['active_model']))
+ if saved_cameras:
+ value['mamma_inputs']=saved_cameras
+ value['mamma_active_camera']=request.get('mamma_active_camera',state.get('mamma_active_camera',0))
origins=value.setdefault('origins',[])
if source and not any(p['path']==str(source) and p.get('relative','.')=='.' for p in origins):
origins.append(dict(path=str(source),relative='.'))
diff --git a/mocap/project_save_ui.py b/mocap/project_save_ui.py
index 345f0a1..aa08978 100644
--- a/mocap/project_save_ui.py
+++ b/mocap/project_save_ui.py
@@ -8,7 +8,7 @@ from .storage import atomic_json
class ProjectSaving:
def save_project_as(self):
- if self.busy or self.contact_saving or self.video_path is None:
+ if self.busy or self.contact_saving or self.mamma_pending or self.video_path is None:
return
if any(info.get('unsaved') for info in self.contact_tracks.values()):
self.status.setText('Save the contact timing successfully before saving a project copy.')
@@ -21,7 +21,7 @@ class ProjectSaving:
self.submit_project_save(Path(name))
def submit_project_save(self, target):
- if self.busy or self.contact_saving or self.video_path is None:
+ if self.busy or self.contact_saving or self.mamma_pending or self.video_path is None:
return False
if any(info.get('unsaved') for info in self.contact_tracks.values()):
self.status.setText('Save the contact timing successfully before saving a project copy.')
@@ -46,6 +46,8 @@ class ProjectSaving:
preview_fps=self.info['fps'],
workspace_view=self.workspace_view(),
workspace_settings=self.workspace_settings(),
+ mamma_inputs=self.mamma_inputs,
+ mamma_active_camera=self.mamma_active_camera,
flow_options={'camera_interval':self.flow_sampling.currentData(),'fast_sam':self.fast_sam.isChecked()},
exmr_options={'static_camera':self.exmr_camera.currentData(),'smoothing':'global' if self.exmr_smoothing.isChecked() else 'none'},
correction=self.selected_correction_options(), frame=self.slider.value(),
diff --git a/mocap/project_workspace_ui.py b/mocap/project_workspace_ui.py
index 7fe5e97..84f9f29 100644
--- a/mocap/project_workspace_ui.py
+++ b/mocap/project_workspace_ui.py
@@ -11,6 +11,7 @@ from .video import select_preview
class ModelWorkspace:
def workspace_settings(self):
return dict(result=self.active_result,correction=self.selected_correction_options(),
+ mamma_options=self.mamma_options(),
flow_options={'camera_interval':self.flow_sampling.currentData(),'fast_sam':self.fast_sam.isChecked()},
exmr_options={'static_camera':self.exmr_camera.currentData(),'smoothing':'global' if self.exmr_smoothing.isChecked() else 'none'})
@@ -29,6 +30,7 @@ class ModelWorkspace:
self.exmr_camera.setCurrentIndex(self.exmr_camera.findData(exmr.get('static_camera',True)))
self.exmr_smoothing.setChecked(exmr.get('smoothing','global')=='global')
self.active_result=self.selected_result()
+ self.restore_mamma_options(settings.get('mamma_options',{}))
def workspace_view(self):
fps=self.info['fps'] if self.info else 30.
@@ -52,6 +54,9 @@ class ModelWorkspace:
model=self._selected_tool
saved=workspace.set_active(root,model,view=self.workspace_view())
saved['models'][model]['settings']=self.workspace_settings()
+ if self.mamma_inputs:
+ saved['mamma_inputs']=self.mamma_inputs
+ saved['mamma_active_camera']=self.mamma_active_camera
atomic_json(root/'project.json',saved)
def restore_workspace_view(self,view):
@@ -86,6 +91,7 @@ class ModelWorkspace:
workspace.model_project(root,state['active_model'],state)
if self.workspace_root is not None and self.workspace_root!=root and not self.busy:
self.remember_workspace_model()
+ self.clear_mamma_inputs()
self.workspace_root=root
self._workspace_camera=None
return self.switch_workspace_model(state['active_model'],opening=True)
@@ -115,8 +121,9 @@ class ModelWorkspace:
self.model_choice.blockSignals(False)
self.select_model()
self.restore_workspace_settings(state.get('models',{}).get(model,{}).get('settings',{}))
- if opening:self.open_workspace_video(state)
- self.status.setText(f'{self.model_choice.currentText()} has no saved motion in this project. Use Reconstruct 3D.')
+ if opening or (model=='mamma' and state.get('mamma_inputs') and not self.mamma_inputs):self.open_workspace_video(state)
+ self.status.setText('MAMMA inputs loaded. Prepare its runtime and models in Model Manager, then Reconstruct 3D.' if model=='mamma' else
+ f'{self.model_choice.currentText()} has no saved motion in this project. Use Reconstruct 3D.')
finally:self._workspace_loading=False
workspace.set_active(root,model,target if (target/'project.json').is_file() else None,view)
self._workspace_pending_view=view
@@ -133,6 +140,10 @@ class ModelWorkspace:
def open_workspace_video(self,state):
self.video_path=workspace.media_path(self.workspace_root,state)
self.video_readable=False
+ if self.model_choice.currentData()=='mamma' and state.get('mamma_inputs'):
+ view=state.get('models',{}).get('mamma',{}).get('view',state.get('view',{}))
+ self.restore_mamma_project_inputs(state,self.workspace_root,view)
+ return
relative=state.get('reference')
reference=workspace.child(self.workspace_root,relative) if relative else None
self._workspace_video_reference=bool(reference and (reference/'project.json').is_file() and (reference/'input.mp4').is_file())
diff --git a/mocap/result_artifacts.py b/mocap/result_artifacts.py
index f213a16..ec66939 100644
--- a/mocap/result_artifacts.py
+++ b/mocap/result_artifacts.py
@@ -63,7 +63,10 @@ def artifacts_current(project,kind):
if mesh['frames_file'] not in outputs:return False
if not all(Path(name).name==name and file_stat(project/name)==stamp for name,stamp in outputs.items()):return False
from .models import BY_KEY
- model=BY_KEY['smplh' if mesh.get('representation')=='smplh' else 'smplx'].path
+ if state.get('pipeline',{}).get('model')=='mamma':
+ from .mamma_body import body_path
+ model=body_path(project)
+ else:model=BY_KEY['smplh' if mesh.get('representation')=='smplh' else 'smplx'].path
return not model.is_file() or file_stat(model)==record['model_stat']
# Existing baked projects remain usable. Their mesh metadata already
# ties the generation to its source tensor. Version 3 corrections must
@@ -76,7 +79,10 @@ def artifacts_current(project,kind):
info=json.loads(mesh.read_text(encoding='utf-8'))
if file_stat(source)!=[info['source_size'],info['source_mtime_ns']]:return False
from .models import BY_KEY
- model=BY_KEY['smplh' if info.get('representation')=='smplh' else 'smplx'].path
+ from .mamma_body import body_path
+ state_path=project/'project.json'
+ mamma=state_path.exists() and json.loads(state_path.read_text(encoding='utf-8')).get('pipeline',{}).get('model')=='mamma'
+ model=body_path(project) if mamma else BY_KEY['smplh' if info.get('representation')=='smplh' else 'smplx'].path
return not model.is_file() or file_stat(model)==[info['model_size'],info['model_mtime_ns']]
return True # Legacy joint-only preview projects without motion tensors.
except (OSError,ValueError,KeyError,TypeError):return False
diff --git a/mocap/retarget/source.py b/mocap/retarget/source.py
index 69159c4..0ab7426 100644
--- a/mocap/retarget/source.py
+++ b/mocap/retarget/source.py
@@ -42,7 +42,10 @@ def prepare(project,kind,out):
mesh_info=json.loads(mesh_metadata.read_text(encoding='utf8'))
paths += [mesh_metadata,resolve_reference(project,mesh_info['asset']),project/mesh_info['frames_file']]
topology='smplh' if model=='flowhmr' else 'smplx'
- bodypath=MODELS/('body_models/smplh/neutral/model.npz' if topology=='smplh' else 'body_models/smplx/SMPLX_NEUTRAL.npz')
+ if model=='mamma':
+ from mocap.mamma_body import body_path
+ bodypath=body_path(project)
+ else:bodypath=MODELS/('body_models/smplh/neutral/model.npz' if topology=='smplh' else 'body_models/smplx/SMPLX_NEUTRAL.npz')
paths.append(bodypath)
before=stamp(paths)
frames=np.load(paths[1],mmap_mode='r');asset=np.load(paths[2]);n=len(frames)
diff --git a/mocap/runtime_registry.py b/mocap/runtime_registry.py
index e3fda89..232645f 100644
--- a/mocap/runtime_registry.py
+++ b/mocap/runtime_registry.py
@@ -29,7 +29,7 @@ def profile_for(stage, args=()):
except (OSError,ValueError,IndexError) as exc:
raise RuntimeError('Cannot select a processing runtime: project metadata is unavailable.') from exc
if model=='flowhmr': return 'flow'
- if model not in {None,'gvhmr','exmr'}: raise RuntimeError('Unsupported saved motion model: '+str(model))
+ if model not in {None,'gvhmr','exmr','mamma'}: raise RuntimeError('Unsupported saved motion model: '+str(model))
return 'shared'
def command(root,stage,args=(),*,frozen):
diff --git a/mocap/scene_camera.py b/mocap/scene_camera.py
index 75b6d50..f6b8d60 100644
--- a/mocap/scene_camera.py
+++ b/mocap/scene_camera.py
@@ -30,6 +30,8 @@ def validate_transform(value):
def camera_sources(project):
+ if (project/'mamma_source.json').exists():
+ return {name:stamp(project/name) for name in ('hmr4d_results.pt','input.mp4','mamma_source.json') if (project/name).exists()}
if (project/'exmr_camera_sources.json').exists():
# ExMR's paired native roots and registered shape determine the camera.
# Publishing its first preview must not change the shared-floor identity.
@@ -47,7 +49,10 @@ def read_camera(project):
record=json.loads(path.read_text(encoding='utf-8'))
if record.get('version')!=VERSION or record.get('sources')!=camera_sources(project):return None
from .paths import MODELS
- model=MODELS/('body_models/smplh/neutral/model.npz' if record.get('source_model')=='flowhmr' else 'body_models/smplx/SMPLX_NEUTRAL.npz')
+ if record.get('source_model')=='mamma':
+ from .mamma_body import body_path
+ model=body_path(project)
+ else:model=MODELS/('body_models/smplh/neutral/model.npz' if record.get('source_model')=='flowhmr' else 'body_models/smplx/SMPLX_NEUTRAL.npz')
if model.exists() and record.get('model')!=stamp(model):return None
validate_transform(record['world_to_camera'])
intrinsic=np.asarray(record['K'],dtype=float)
@@ -79,6 +84,9 @@ def prepare_cameras(root):
if not state:raise ValueError('No people group')
rows=take_projects(root,state)
manifest=json.loads((root/'project.json').read_text(encoding='utf-8'))
+ if manifest.get('pipeline',{}).get('model')=='mamma':
+ from .mamma_scene import prepare_cameras as prepare_mamma
+ return prepare_mamma(root)
if manifest.get('pipeline',{}).get('model')=='flowhmr':
from .flow_scene import prepare_cameras as prepare_flow
return prepare_flow(root,rows)
diff --git a/mocap/scene_data.py b/mocap/scene_data.py
index 2ce36af..0609ce0 100644
--- a/mocap/scene_data.py
+++ b/mocap/scene_data.py
@@ -177,6 +177,8 @@ class SceneDataLoader(QThread):
return load_scene(root,kind,cancelled)
if psutil.virtual_memory().available<256*1024**2:
raise MemoryError('Free at least 256 MiB RAM to open a shared people scene.')
+ if (root/'mamma_pending.json').exists():
+ raise ValueError('MAMMA publication is incomplete; finish reconstruction before opening this scene.')
state=load_people(root)
if state is None:raise ValueError('People group unavailable')
projects=take_projects(root,state)
@@ -202,6 +204,7 @@ class SceneDataLoader(QThread):
contact_intervals=0
try:
if asset:self.model_cache=asset
+ static_assets={}
for ident,project in projects:
if cancelled():raise LoadCancelled()
manifest=json.loads((project/'project.json').read_text(encoding='utf-8'))
@@ -228,12 +231,21 @@ class SceneDataLoader(QThread):
from .paths import MODELS
asset_path=MODELS/'body_models/smplx'/asset_path.name
stat=asset_path.stat();key=(str(asset_path.resolve()),stat.st_size,stat.st_mtime_ns)
+ if manifest.get('pipeline',{}).get('model')=='mamma':
+ # The body filename includes the registered source,
+ # constant actor shape and adapter hash. Takes of one
+ # actor must not retain duplicate static skin arrays.
+ from .mamma_body import body_path
+ key=('mamma-body',body_path(project).name)
+ if key in static_assets:self.model_cache=static_assets[key]
if self.model_cache is None or self.model_cache['key']!=key:
with np.load(asset_path,allow_pickle=False) as data:
self.model_cache={name:data[name] for name in ('packed','faces','offsets','neighbors','vertex_count')}
self.model_cache['key']=key
- if scene.asset and scene.asset['key']!=key:raise ValueError('Scene body models differ')
- scene.asset=self.model_cache
+ static_assets[key]=self.model_cache
+ # Each take retains its actor's exact shape asset. Identical
+ # assets still share arrays and GPU buffers.
+ if scene.asset is None:scene.asset=self.model_cache
mesh=FrameArray(project/Path(info['frames_file']).name,max_blocks=1);arrays['mesh']=mesh
if mesh.shape!=(len(joints),FRAME_FLOATS) or mesh.dtype!=np.float32:raise ValueError('Invalid scene mesh')
manifest=json.loads((project/'project.json').read_text(encoding='utf-8'))
diff --git a/mocap/scene_floor.py b/mocap/scene_floor.py
index 6061f34..4a30b12 100644
--- a/mocap/scene_floor.py
+++ b/mocap/scene_floor.py
@@ -6,6 +6,7 @@ from pathlib import Path
import hashlib,json,math
from .people_store import load_people,read_people_json,root_for,safe_child,media_receipt
from .storage import atomic_json
+from .validation_snapshot import snapshot_value
VERSION=1
@@ -69,23 +70,28 @@ def inputs(root):
raise ValueError('Shared camera reference is out of date')
validate_transform(reference['world_to_camera'])
manifest=read_people_json(root/'project.json')
+ mamma=manifest.get('pipeline',{}).get('model')=='mamma'
flow=manifest.get('pipeline',{}).get('model')=='flowhmr'
model=MODELS/('body_models/smplh/neutral/model.npz' if flow else 'body_models/smplx/SMPLX_NEUTRAL.npz')
- model_stamp=stamp(model) if model.exists() else None
+ model_stamp=stamp(model) if model.exists() and not mamma else None
rows=[]
for ident,project in take_projects(root,state):
camera=read_people_json(project/'scene_camera.json')
source=stamp(project/'hmr4d_results.pt')
if camera['sources']['hmr4d_results.pt']!=source:raise ValueError('Actor camera is out of date')
- if model_stamp is not None and camera['model']!=model_stamp:raise ValueError('Scene body model changed')
+ if mamma:
+ from .mamma_body import body_path
+ if camera['model']!=stamp(body_path(project)):raise ValueError('MAMMA actor body changed')
+ elif model_stamp is not None and camera['model']!=model_stamp:raise ValueError('Scene body model changed')
validate_transform(camera['world_to_camera'])
rows.append(dict(person=ident,project=project.relative_to(root).as_posix(),source=source,
- world_to_camera=camera['world_to_camera']))
- if model_stamp is None:model_stamp=camera.get('model')
+ world_to_camera=camera['world_to_camera'],**({'body':camera['model']} if mamma else {})))
+ if model_stamp is None and not mamma:model_stamp=camera.get('model')
return dict(version=VERSION,input=media_receipt(root),model=model_stamp,
reference=reference['world_to_camera'],actors=rows)
+@snapshot_value
def current_resolution(root):
path=Path(root)/'scene_floor_resolved.json'
if not path.exists():return None
@@ -117,6 +123,7 @@ def resolve(root,body=None):
if read_people_json(root/'project.json').get('pipeline',{}).get('model')=='flowhmr':
from .flow_floor import resolve
return resolve(root,options)
+ mamma=read_people_json(root/'project.json').get('pipeline',{}).get('model')=='mamma'
context=inputs(root);height=options['floor'];samples=0;warning=''
if options['auto_floor']:
import numpy as np
@@ -124,7 +131,7 @@ def resolve(root,body=None):
from scipy.spatial.transform import Rotation
from .correction import SoleGeometry,prepare_contacts
from .paths import MODELS
- if body is None:
+ if body is None and not mamma:
import smplx
model=MODELS/'body_models/smplx/SMPLX_NEUTRAL.npz'
if not model.exists():raise FileNotFoundError('Import the body model to estimate the shared scene floor.')
@@ -136,7 +143,11 @@ def resolve(root,body=None):
project=safe_child(root,row['project'])
record=torch.load(project/'hmr4d_results.pt',map_location='cpu',weights_only=False,mmap=True)
params=record['smpl_params_global'];length=len(params['body_pose'])
- geometry=SoleGeometry(body,params['betas'][0].numpy())
+ if mamma:
+ from .mamma_body import model_for
+ actor_body=model_for(project)
+ else:actor_body=body
+ geometry=SoleGeometry(actor_body,params['betas'][0].numpy())
[email protected](row['world_to_camera']);rotation=transform[:3,:3]
probabilities=record['net_outputs']['static_conf_logits'][0,:,:4]
if len(probabilities)!=length:raise ValueError('Scene contact and motion frame counts differ')
@@ -154,7 +165,7 @@ def resolve(root,body=None):
if active.any():values.extend(h[active].tolist())
samples+=end-first
if values:estimates.setdefault(row['person'],[]).append(float(np.quantile(values,.05)))
- del record,params,geometry,probabilities
+ del record,params,geometry,probabilities,actor_body
# Equal actor weighting prevents a long/overlapping take dominating.
height=float(np.median([np.median(v) for v in estimates.values()])) if estimates else 0.
if not estimates:warning='No reliable ground samples. Shared reference floor 0 m is used; adjust it manually if needed.'
diff --git a/mocap/timeline_editor.py b/mocap/timeline_editor.py
index d5054ff..cae99d2 100644
--- a/mocap/timeline_editor.py
+++ b/mocap/timeline_editor.py
@@ -26,6 +26,7 @@ class TimelineSlider(FootLockEditor,QSlider):
self.fps = 30.0
self.has_motion = False
self.person_color = self.person_name = None
+ self.video_track_label = 'Source clip'
self.view_start = 0.0
self.view_span = None
self._cache = None
@@ -207,7 +208,7 @@ class TimelineSlider(FootLockEditor,QSlider):
def paintEvent(self, _):
key = (self.size(), self.devicePixelRatioF(), self.minimum(), self.maximum(), self.view_start,
self.span(), self.fps, self.has_motion, self.clip_in, self.clip_out,self.contact_revision,self.contact_edit_enabled,self.contact_track_enabled,
- self.person_color,self.person_name,
+ self.person_color,self.person_name,self.video_track_label,
(self._foot_drag['foot'],self._foot_drag['index']) if self._foot_drag else None,self._selected_contact)
if key != self._cache_key:
ratio = self.devicePixelRatioF()
@@ -258,7 +259,7 @@ class TimelineSlider(FootLockEditor,QSlider):
p.setPen(QColor("#aaaaaa"))
p.drawText(QRectF(8, y, 53, row_height), Qt.AlignVCenter, label)
p.setPen(QColor("#b1b9c1" if row == 0 else "#aebeb4"))
- text = "Source clip" if row == 0 else ((self.person_name or "Body animation") if self.has_motion else "No motion data")
+ text = self.video_track_label if row == 0 else ((self.person_name or "Body animation") if self.has_motion else "No motion data")
left, right = self.clip_edges() if row == 0 else (self.LEFT, self.width() - self.RIGHT)
left, right = max(self.LEFT, left), min(self.width() - self.RIGHT, right)
p.drawText(QRectF(left + 12, y, max(0, right - left - 24), row_height), Qt.AlignVCenter, text)
diff --git a/mocap/ui_refresh.py b/mocap/ui_refresh.py
new file mode 100644
index 0000000..b9bc53e
--- /dev/null
+++ b/mocap/ui_refresh.py
@@ -0,0 +1,21 @@
+"""Batch synchronous control changes without caching project validity."""
+from functools import wraps
+
+
+def batch_readiness(method):
+ """Validate controls once after a nested GUI operation has finished.
+
+ This scope never outlives the synchronous call. Async completions and
+ export actions still perform their own fresh checks against disk.
+ """
+ @wraps(method)
+ def batched(self, *args, **kwargs):
+ self._readiness_depth = getattr(self, '_readiness_depth', 0) + 1
+ try:
+ return method(self, *args, **kwargs)
+ finally:
+ self._readiness_depth -= 1
+ if not self._readiness_depth and getattr(self, '_readiness_pending', False):
+ self._readiness_pending = False
+ self.update_readiness()
+ return batched
diff --git a/mocap/validation_snapshot.py b/mocap/validation_snapshot.py
new file mode 100644
index 0000000..582b052
--- /dev/null
+++ b/mocap/validation_snapshot.py
@@ -0,0 +1,35 @@
+"""Share expensive read-only checks within one synchronous GUI update only."""
+from contextvars import ContextVar
+from functools import wraps
+
+_snapshot = ContextVar('preview_validation_snapshot', default=None)
+
+
+def read_only_checks(method):
+ """No Qt event processing, writes or retained cache inside this scope."""
+ @wraps(method)
+ def scoped(*args, **kwargs):
+ if _snapshot.get() is not None:
+ return method(*args, **kwargs)
+ token = _snapshot.set({})
+ try:
+ return method(*args, **kwargs)
+ finally:
+ _snapshot.reset(token)
+ return scoped
+
+
+def snapshot_value(check):
+ @wraps(check)
+ def checked(*args, **kwargs):
+ cache = _snapshot.get()
+ if cache is None:
+ return check(*args, **kwargs)
+ key = (check, args, tuple(sorted(kwargs.items())))
+ if key not in cache:
+ value = check(*args, **kwargs)
+ if len(cache) < 64:
+ cache[key] = value
+ return value
+ return cache[key]
+ return checked
diff --git a/mocap/video.py b/mocap/video.py
index 6bef644..39d3661 100644
--- a/mocap/video.py
+++ b/mocap/video.py
@@ -107,7 +107,9 @@ def ensure_preview(project: Path, cancelled=None) -> Path:
def prepare(source: Path, start: float = 0.0, end: float | None = None, motion_tool='gvhmr', project=None, cancelled=None) -> Path:
from .motion_tools import require_supported_tool
- require_supported_tool(motion_tool)
+ tool=require_supported_tool(motion_tool)
+ if tool.input_setup_only:
+ raise ValueError('MAMMA input setup is available, but multi-view reconstruction is not integrated yet.')
info = probe(source)
from . import project_workspace as workspace
if project is None:
diff --git a/mocap/viewer.py b/mocap/viewer.py
index 63c7e98..790111f 100644
--- a/mocap/viewer.py
+++ b/mocap/viewer.py
@@ -32,6 +32,10 @@ class VideoView(QWidget):
self.source_size = (1, 1)
self.generation = 0
self.logical_size = None
+ self.timeline_fps = None
+ self.native_fps = None
+ self._source_key = None
+ self.timeline_requested_index = 0
self.show_observations = True
self.actor_color = None
self.zoom = 1.0
@@ -112,9 +116,20 @@ class VideoView(QWidget):
self._end_pan()
super().hideEvent(event)
- def open(self, path: Path, source_size=None):
+ def open(self, path: Path, source_size=None, timeline_fps=None, timeline_start=0, *, reuse=False):
+ try:
+ stamp=Path(path).stat()
+ key=(str(Path(path).resolve()),stamp.st_size,stamp.st_mtime_ns,
+ tuple(source_size) if source_size is not None else None,timeline_fps,timeline_start)
+ except OSError:key=None
+ if reuse and key is not None and key==self._source_key and self.decoder is not None and self.native_fps and self.frame is not None:
+ return False
+ self._source_key=key
self.reset_view()
self.logical_size = source_size
+ self.timeline_fps = timeline_fps
+ self.timeline_start = timeline_start
+ self.native_fps = None
self.frame = None
self.boxes = self.observed = self.keypoints = self.confidence = None
if self.decoder is None:
@@ -125,18 +140,22 @@ class VideoView(QWidget):
self.decoder.start()
self.generation = self.decoder.change_source(path)
self.seek(0)
+ return True
def _opened(self, generation, metadata):
if self.decoder is not None and self.sender() is self.decoder and generation == self.generation:
self.source_size = self.logical_size or (metadata["width"], metadata["height"])
+ self.native_fps = metadata['fps']
self.metadata_ready.emit(metadata)
def _failed(self, generation, message):
if self.decoder is not None and self.sender() is self.decoder and generation == self.generation:
+ self._source_key = None
self.decode_error.emit(message)
def shutdown(self):
self._end_pan()
+ self._source_key = None
if self.decoder:
decoder = self.decoder
self.decoder = None
@@ -157,9 +176,9 @@ class VideoView(QWidget):
self._present(index, image)
def _present(self, index, image):
- self.index, self.frame = index, image
+ self.index, self.frame = (self.timeline_requested_index if self.timeline_fps else index), image
self.update()
- self.frame_presented.emit(index)
+ self.frame_presented.emit(self.index)
def set_observations(self, arrays):
self.boxes, self.observed = arrays.get("boxes"), arrays.get("observed")
@@ -171,6 +190,10 @@ class VideoView(QWidget):
def seek(self, index: int):
if self.decoder is None:
return
+ self.timeline_requested_index = index
+ if self.timeline_fps and self.native_fps:
+ index = max(0,round((index + self.timeline_start) * self.native_fps / self.timeline_fps))
+ if self.decoder.length:index=min(index,self.decoder.length-1)
self.requested_index = index
image = self.decoder.request(index)
if image is not None:
diff --git a/mocap/viewport.py b/mocap/viewport.py
index e55c54b..43f49c7 100644
--- a/mocap/viewport.py
+++ b/mocap/viewport.py
@@ -719,10 +719,10 @@ class MotionView(ViewportBase):
from .mesh_gl import MeshRenderer
renderer_type=MeshRenderer
self.ensure_mesh_renderer(renderer_type)
- if self.mesh_renderer.asset_key not in (None,self.people_scene.asset['key']):
+ if self.mesh_renderer.asset_key not in (None,actors[0][0].asset['key']):
for renderer in self.scene_renderers.values():renderer.close()
self.scene_renderers={}
- self.mesh_renderer.load(self.people_scene.asset)
+ self.mesh_renderer.load(actors[0][0].asset)
used=set()
for slot,(take,frame) in enumerate(actors):
if slot==0:renderer=self.mesh_renderer
diff --git a/mocap/worker.py b/mocap/worker.py
index 14e56c7..a3596f2 100644
--- a/mocap/worker.py
+++ b/mocap/worker.py
@@ -212,6 +212,19 @@ def main() -> int:
from .flow_backend import run_stage
run_stage(project,args.stage,args.result,emit,force=args.force)
return 0
+ if require_supported_project(project).key=='mamma':
+ if args.stage=='export':
+ from .export import export_project
+ output=export_project(project,args.result)
+ elif args.stage=='correct':
+ from .correction import run as correct_mamma
+ correct_mamma(project,emit,args.result);output=project/RESULTS[args.result][0]
+ elif args.stage in ('mesh','rig'):
+ from .export import export_project
+ output=export_project(project,args.result)
+ else:raise ValueError('Use the multi-view MAMMA pipeline for reconstruction; single-view stages cannot process this project.')
+ emit('complete',stage=args.stage,output=str(output),cached=False,elapsed=time.monotonic()-started)
+ return 0
if args.stage == 'rig':
from .mixamo_data import prepare
kind=resolve_motion_result(project,args.result)
diff --git a/mocap/worker_progress.py b/mocap/worker_progress.py
index 4086504..5cdb34d 100644
--- a/mocap/worker_progress.py
+++ b/mocap/worker_progress.py
@@ -12,6 +12,11 @@ def emit(kind,**value):
def main():
stage=sys.argv[1] if len(sys.argv)>1 else ''
+ if stage in ('mamma_prepare','mamma_publish'):
+ from .compute_policy import configure_worker_cpu
+ configure_worker_cpu(stage)
+ from .mamma_pipeline import main as mamma_main
+ return mamma_main(sys.argv[1:])
if stage=='character':
from .retarget.worker import main as character_main
return character_main(sys.argv[2:])
@@ -29,4 +34,4 @@ def main():
else:runpy.run_module('mocap.worker',run_name='__main__')
-if __name__=='__main__':main()
+if __name__=='__main__':raise SystemExit(main())
diff --git a/mocap/workspace_ui.py b/mocap/workspace_ui.py
index 0458c02..e4b3e66 100644
--- a/mocap/workspace_ui.py
+++ b/mocap/workspace_ui.py
@@ -375,6 +375,7 @@ def build_workspace(w):
exmr.addWidget(w.exmr_smoothing)
w.model_choice.setItemData(w.model_choice.findData('exmr'),tooltip_text('ExMR: body and finger tracking. Generally fast, with good motion quality in our subjective tests.'),Qt.ToolTipRole)
w.model_pages.addWidget(w.exmr_page)
+ w.build_mamma_settings()
shared_settings=QWidget()
settings = QVBoxLayout(shared_settings)
settings.setContentsMargins(8, 0, 8, 8)
diff --git a/tools/check_source.py b/tools/check_source.py
index 31d00cb..878be7b 100644
--- a/tools/check_source.py
+++ b/tools/check_source.py
@@ -4,7 +4,7 @@ import ast,hashlib,json,os,re,subprocess,sys
from runtime_support import cache_dependency_files
ROOT=Path(__file__).resolve().parents[1]
-SKIP={'.git','__pycache__','.bootstrap','.runtime','.cache','.setup','.venv','.venv-flow','.venv-hand','.venv-htd','.venv-exmr','build','dist','releases','models','projects','cache','character_scenes','.build-inputs','runtime','runtime_gui','runtime_flow','runtime_hand','runtime_htd','runtime_exmr','runtime_character'}
+SKIP={'.git','__pycache__','.bootstrap','.runtime','.cache','.setup','.venv','.venv-flow','.venv-hand','.venv-htd','.venv-exmr','build','dist','releases','models','projects','cache','character_scenes','.build-inputs','runtime','runtime_gui','runtime_flow','runtime_hand','runtime_htd','runtime_exmr','runtime_character','runtime_mamma'}
FORBIDDEN={'.exe','.dll','.pyd','.pyc','.whl','.pt','.pth','.ckpt','.safetensors','.onnx','.npz','.npy','.pkl','.fbx','.bvh','.blend','.mp4','.vrm','.pmx','.vmd','.pmd','.vpd','.pmm','.avi','.mov','.mkv','.webm','.zip','.7z'}
def main():
@@ -44,6 +44,9 @@ def main():
for name in ['README.md','LICENSE','THIRD_PARTY_NOTICES.md','docs/USER_GUIDE.md','docs/BUILD.md','installer/runtime-lock.json','installer/external-assets.json']:
if not (ROOT/name).is_file():errors.append('Missing '+name)
lock=json.loads((ROOT/'installer/runtime-lock.json').read_text())
+ registry=ROOT/'mocap/runtime_registry.py'
+ if not registry.is_file() or hashlib.sha256(registry.read_bytes()).hexdigest()!=lock.get('registry_sha256'):
+ errors.append('Runtime registry differs from installer/runtime-lock.json. Review the registry change and update its locked hash before distributing.')
if {g['key'] for g in lock['groups']}!={'shared','gui','flow','hand','htd','exmr'}:errors.append('Runtime profile set changed')
print(json.dumps(dict(files=count,errors=errors),indent=2))
return bool(errors)
diff --git a/tools/configure_mamma.py b/tools/configure_mamma.py
new file mode 100644
index 0000000..b85835e
--- /dev/null
+++ b/tools/configure_mamma.py
@@ -0,0 +1,14 @@
+"""Register an existing, separately validated Windows research environment."""
+import argparse
+from pathlib import Path
+import sys
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+from mocap.mamma_runtime import configure
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--python', required=True, type=Path)
+ parser.add_argument('--engine', required=True, type=Path)
+ parser.add_argument('--reviewed-mamma-license', action='store_true', required=True)
+ args = parser.parse_args()
+ print(configure(args.python, args.engine))
diff --git a/tools/setup_mamma.py b/tools/setup_mamma.py
new file mode 100644
index 0000000..37097fa
--- /dev/null
+++ b/tools/setup_mamma.py
@@ -0,0 +1,228 @@
+"""Install the optional, isolated MAMMA runtime from pinned upstream files.
+
+Restricted MAMMA/SDF sources are acquired on the user's machine, never bundled.
+An existing working generation is retained until installation and CUDA checks pass.
+"""
+from pathlib import Path
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import subprocess
+import sys
+from functools import lru_cache
+import urllib.parse
+import urllib.request
+import zipfile
+import posixpath
+import stat
+import time
+from pathlib import PurePosixPath
+
+ROOT=Path(__file__).resolve().parents[1]
+sys.path.insert(0,str(ROOT))
+from installer import engine
+from installer.mamma_adapters import adapt_engine,adapt_sdf
+from tools.session_lock import app_lock
+from tools.support_components import download,extract
+from mocap.storage import atomic_json
+
+
+def run_step(command,root,cancel,log):
+ """Keep opaque setup/build/hash phases visibly active, without fake percentages."""
+ started=time.monotonic();notice=started
+ with Path(log).open('w',encoding='utf-8') as output:
+ process=subprocess.Popen([str(v) for v in command],cwd=root,env=engine.clean_env(root),
+ stdout=output,stderr=subprocess.STDOUT,creationflags=0x08000000)
+ try:
+ while process.poll() is None:
+ engine.check_cancel(cancel);time.sleep(.2)
+ if time.monotonic()-notice>=15:
+ notice=time.monotonic()
+ print('MAMMA setup: '+Path(log).stem+' is working ('+str(round(notice-started))+' s).',flush=True)
+ except BaseException:
+ subprocess.run([str(Path(os.environ['SystemRoot'])/'System32/taskkill.exe'),'/PID',str(process.pid),'/T','/F'],
+ stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL,creationflags=0x08000000)
+ process.wait(timeout=30);raise
+ if process.returncode:
+ raise RuntimeError('A setup step failed. '+Path(log).read_text(encoding='utf-8',errors='replace')[-3500:])
+
+
+@lru_cache(maxsize=4)
+def identity(root=ROOT):
+ # Runtime content, not installer presentation, determines numerical identity.
+ names=['installer/mamma-runtime-lock.json','installer/mamma_adapters.py',
+ 'installer/mamma_helpers/speed_crop.py','installer/mamma_helpers/speed_landmarks.py']
+ return hashlib.sha256(json.dumps({n:engine.sha(Path(root)/n) for n in names},sort_keys=True).encode()).hexdigest()
+
+
+def compiler():
+ cuda=Path(os.environ.get('CUDA_PATH_V12_8',r'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8'))
+ if not (cuda/'bin/nvcc.exe').is_file():
+ raise RuntimeError('MAMMA native setup needs NVIDIA CUDA Toolkit 12.8 (including nvcc). See docs/MAMMA.md. The NVIDIA driver alone does not include this compiler.')
+ vswhere=Path(os.environ.get('ProgramFiles(x86)',r'C:\Program Files (x86)'))/'Microsoft Visual Studio/Installer/vswhere.exe'
+ if not vswhere.is_file():raise RuntimeError('Install Visual Studio 2022 Build Tools with Desktop development with C++ and the Windows SDK. See docs/MAMMA.md.')
+ found=subprocess.run([str(vswhere),'-utf8','-latest','-products','*','-version','[17.0,18.0)',
+ '-requires','Microsoft.VisualStudio.Component.VC.Tools.x86.x64','-property','installationPath'],
+ capture_output=True,text=True,encoding='utf-8',errors='replace',check=True)
+ vc=Path(found.stdout.strip())/'VC/Auxiliary/Build/vcvars64.bat'
+ if not vc.is_file():raise RuntimeError('Visual Studio 2022 C++ compiler was not found. See docs/MAMMA.md.')
+ return cuda,vc
+
+
+def fetch_package(row,cache):
+ url=urllib.parse.urlsplit(row['url'])
+ if url.scheme!='https' or url.hostname not in {'files.pythonhosted.org','download.pytorch.org','download-r2.pytorch.org'}:
+ raise ValueError('Unsupported MAMMA package host.')
+ if Path(row['filename']).name!=row['filename']:raise ValueError('Invalid package filename.')
+ folder=cache/row['sha256'];folder.mkdir(exist_ok=True)
+ path=folder/row['filename']
+ if path.is_file() and path.stat().st_size==row['bytes'] and engine.sha(path)==row['sha256']:return path
+ partial=path.with_name(path.name+'.partial')
+ print('Downloading '+row['name']+' '+row['version'],flush=True)
+ try:
+ with urllib.request.urlopen(row['url'],timeout=120) as response,partial.open('wb') as output:
+ shutil.copyfileobj(response,output,1024**2)
+ if partial.stat().st_size!=row['bytes'] or engine.sha(partial)!=row['sha256']:
+ raise ValueError('Package SHA-256/size mismatch: '+row['name'])
+ os.replace(partial,path)
+ finally:partial.unlink(missing_ok=True)
+ return path
+
+
+def quoted(value):
+ # This function is for a generated batch file, with delayed expansion off.
+ value=str(value)
+ if any(c in value for c in ('"','\n','\r')):raise ValueError('Unsupported setup path.')
+ return '"'+value.replace('%','%%')+'"'
+
+
+def extract_source(archive_path,spec,destination):
+ """Materialize pinned archive-internal aliases as files, never OS links."""
+ total=0
+ with zipfile.ZipFile(archive_path) as archive:
+ for entry in archive.infolist():
+ name=PurePosixPath(entry.filename)
+ if '\\' in entry.filename or ':' in entry.filename or name.is_absolute() or '..' in name.parts or name.parts[0]!=spec['archive_root']:
+ raise ValueError('Unsafe MAMMA source archive path.')
+ if entry.is_dir():continue
+ payload=entry
+ if stat.S_ISLNK(entry.external_attr>>16):
+ target=archive.read(entry).decode('utf-8')
+ if '\\' in target or ':' in target or target.startswith('/'):raise ValueError('Unsafe source alias.')
+ resolved=PurePosixPath(posixpath.normpath(str(name.parent/target)))
+ if resolved.parts[0]!=spec['archive_root'] or '..' in resolved.parts:raise ValueError('Source alias leaves its archive.')
+ payload=archive.getinfo(str(resolved))
+ if stat.S_ISLNK(payload.external_attr>>16) or payload.is_dir():raise ValueError('Unsupported source alias.')
+ total+=payload.file_size
+ if total>1024**3:raise ValueError('MAMMA source archive is too large.')
+ path=destination/Path(*name.parts[1:]);path.parent.mkdir(parents=True,exist_ok=True)
+ with archive.open(payload) as source,path.open('wb') as output:shutil.copyfileobj(source,output,1024**2)
+
+
+def setup(args):
+ lock=json.loads((ROOT/'installer/mamma-runtime-lock.json').read_text())
+ uv=ROOT/'.setup/bootstrap-git/uv.exe'
+ if not uv.is_file() or engine.sha(uv)!=lock['uv_sha256']:
+ raise RuntimeError('Run install.cmd first to prepare the verified setup helper.')
+ with app_lock(ROOT):
+ tag=identity();dest=ROOT/'runtime_mamma'/tag[:20]
+ configuration=ROOT/'.setup/mamma-runtime.json'
+ if configuration.is_file():
+ try:
+ previous=json.loads(configuration.read_text())
+ candidate=Path(previous['python']).parent
+ if previous.get('managed_id')==tag and candidate.is_relative_to(ROOT/'runtime_mamma'):
+ dest=candidate
+ except (OSError,ValueError,KeyError,TypeError):pass
+ if (dest/'ready.json').is_file():
+ try:
+ from mocap.mamma_runtime import configure
+ report=verify(dest,lock)
+ configure(dest/'python.exe',dest/'engine',managed_id=tag)
+ print('Verified MAMMA runtime retained. Models and projects were not changed.',flush=True)
+ return report
+ except Exception as error:print('Existing MAMMA generation needs repair: '+str(error),flush=True)
+ cuda,vc=compiler()
+ if shutil.disk_usage(ROOT).free<18*1024**3:
+ raise OSError('MAMMA setup requires approximately 18 GiB free for its runtime, downloads and native build, excluding models and compiler tools.')
+ setup=ROOT/'.setup';cache=setup/'mamma-downloads';cache.mkdir(exist_ok=True)
+ generation=tag[:20]+'-'+os.urandom(4).hex()
+ stage=setup/'mamma-staging'/generation;stage.mkdir(parents=True)
+ promoted=None;committed=False
+ try:
+ logs=setup/'logs';logs.mkdir(exist_ok=True)
+ print('MAMMA: separate Python 3.11 / CUDA 12.8 environment. Download estimate %.2f GiB; installed estimate 6-8 GiB, excluding models and compiler tools.' % (sum(p['bytes'] for p in lock['packages'])/1024**3),flush=True)
+ run_step([uv,'python','install',lock['python'],'--install-dir',setup/'python','--no-bin','--no-registry','--no-config'],ROOT,None,logs/'mamma-python.log')
+ shutil.copytree(engine.python_home(ROOT,lock['python']),stage,dirs_exist_ok=True,ignore=shutil.ignore_patterns('__pycache__','*.pyc'))
+ py=stage/'python.exe';target=stage/'Lib/site-packages'
+ local={p['name']:fetch_package(p,cache) for p in lock['packages']}
+ wheels=[p for p in lock['packages'] if p['kind']=='wheel']
+ req=stage/'locked-wheels.txt'
+ req.write_text('\n'.join(local[p['name']].as_uri()+' --hash=sha256:'+p['sha256'] for p in wheels)+'\n',encoding='utf-8')
+ print('MAMMA: installing hash-verified packages...',flush=True)
+ run_step([uv,'pip','install','--python',py,'--target',target,'--no-deps','--offline','--no-index',
+ '--require-hashes','--only-binary',':all:','--link-mode','copy','--no-cache','-r',req],ROOT,None,logs/'mamma-packages.log')
+ for p in lock['packages']:
+ if p['kind']!='source':continue
+ print('MAMMA: building pinned Python package '+p['name'],flush=True)
+ run_step([uv,'pip','install','--python',py,'--target',target,'--no-deps','--no-build-isolation','--no-index',
+ '--offline','--link-mode','copy',local[p['name']]],ROOT,None,logs/('mamma-'+p['name']+'.log'))
+ sources=stage/'sources';sources.mkdir()
+ for name,spec in lock['sources'].items():
+ archive=download(cache,name+'-'+spec['commit'],spec)
+ extract_source(archive,spec,sources/name)
+ adapt_engine(sources/'mamma',ROOT/'installer/mamma_helpers')
+ adapt_sdf(sources/'sdf')
+ os.replace(sources/'mamma',stage/'engine')
+ cap=subprocess.run([str(py),'-I','-c',"import torch;assert torch.cuda.is_available();print('.'.join(map(str,torch.cuda.get_device_capability())))"],
+ capture_output=True,text=True,check=True,creationflags=0x08000000).stdout.strip()
+ if not __import__('re').fullmatch(r'\d+\.\d+',cap):raise ValueError('Invalid CUDA architecture.')
+ build=stage/'build-native.cmd'
+ lines=['@echo off','setlocal DisableDelayedExpansion','chcp 65001 >nul','call '+quoted(vc),'if errorlevel 1 exit /b 1',
+ 'set "CUDA_HOME='+str(cuda).replace('%','%%')+'"','set "TORCH_CUDA_ARCH_LIST='+cap+'"',
+ 'set "MAX_JOBS=2"','set "DISTUTILS_USE_SDK=1"','set "MSSdk=1"','set "FORCE_CUDA=1"',
+ 'set "SAM2_BUILD_ALLOW_ERRORS=0"','set "SAM2_BUILD_CUDA=1"']
+ for name in ('sam2','sdf'):
+ lines+=[' '.join(quoted(x) for x in [uv,'pip','install','--python',py,'--target',target,'--no-deps','--no-build-isolation',
+ '--no-index','--offline','--no-cache','--link-mode','copy',sources/name]),'if errorlevel 1 exit /b 1']
+ lines+=['exit /b 0'];build.write_text('\n'.join(lines)+'\n',encoding='utf-8')
+ print('MAMMA: compiling native SAM 2 and SDF for this GPU (SM '+cap+'). See .setup/logs/mamma-native.log.',flush=True)
+ run_step([os.environ.get('COMSPEC','cmd.exe'),'/d','/c',str(build)],ROOT,None,logs/'mamma-native.log')
+ engine.prune_runtime(stage)
+ report=verify(stage,lock)
+ # Keep installations immutable. Publish the runtime pointer only after
+ # relocation and a second check; interrupted installs keep the old pointer.
+ dest=ROOT/'runtime_mamma'/generation;dest.parent.mkdir(exist_ok=True)
+ os.replace(stage,dest)
+ promoted=dest
+ report=verify(dest,lock)
+ from mocap.mamma_runtime import configure
+ report.update(runtime_id=tag,cuda_arch=cap,installed_bytes=sum(p.stat().st_size for p in dest.rglob('*') if p.is_file()))
+ atomic_json(dest/'ready.json',report)
+ configure(dest/'python.exe',dest/'engine',managed_id=tag)
+ committed=True
+ try:atomic_json(setup/'mamma-install-report.json',report)
+ except OSError:print('MAMMA is ready; the optional disk-size report could not be saved.',flush=True)
+ print('MAMMA ready: %.2f GiB installed. Open Model Manager to prepare the model files.' % (report['installed_bytes']/1024**3),flush=True)
+ return report
+ finally:
+ if stage.exists():engine.remove_owned(setup,stage)
+ if promoted is not None and not committed:engine.remove_owned(ROOT/'runtime_mamma',promoted)
+
+
+
+def verify(folder,lock):
+ report=folder/'verification.json'
+ run_step([folder/'python.exe','-I',ROOT/'installer/verify_mamma.py','--lock',ROOT/'installer/mamma-runtime-lock.json',
+ '--output',report],ROOT,None,ROOT/'.setup/logs/mamma-verify.log')
+ return json.loads(report.read_text())
+
+
+if __name__=='__main__':
+ parser=argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--accept-licenses',action='store_true',required=True,
+ help='I reviewed the MAMMA, pytorch_sdf, SAM 2 and dependency licenses; restricted software is installed locally for permitted use.')
+ try:setup(parser.parse_args())
+ except Exception as exc:print('MAMMA setup failed: '+str(exc),file=sys.stderr);raise SystemExit(1)