-
Notifications
You must be signed in to change notification settings - Fork 32
Migrate MPPCA and finalize numpy migration with Python bindings #967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cdtwigg
wants to merge
5
commits into
main
Choose a base branch
from
export-D89891113
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
be29266 to
3f36740
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
3f36740 to
4c2f74f
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
4c2f74f to
1488582
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
1488582 to
06fa785
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
06fa785 to
f4f3d0e
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
f4f3d0e to
91e220a
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
91e220a to
81a525e
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
81a525e to
abff137
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 22, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
abff137 to
95055a3
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 23, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
95055a3 to
f5e55ed
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 24, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
41310f1 to
6e35955
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 24, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
cdtwigg
added a commit
that referenced
this pull request
Jan 24, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
6e35955 to
c8dc9e3
Compare
c8dc9e3 to
fe227d6
Compare
cdtwigg
added a commit
that referenced
this pull request
Jan 24, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
cdtwigg
added a commit
that referenced
this pull request
Jan 24, 2026
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
fe227d6 to
88e5bd6
Compare
Summary: Completed migration of parameter transform functions in the geometry module from torch.Tensor to numpy arrays. This maintains consistency with the geometry module's design principle of using numpy for fast forward operations while keeping torch tensors in diff_geometry for differentiable operations. Key changes: - Implemented arrayToParameterSet() to convert boolean numpy arrays to ParameterSet - Updated all parameter property bindings (scaling_parameters, rigid_parameters, etc.) to return numpy arrays - Converted simplify(), simplify_parameter_transform(), parameters_for_joints(), and joints_for_parameters() to use arrays - Updated reduce_to_selected_model_parameters() to use array-based parameter sets - Updated tests to work with numpy arrays instead of tensors - Updated .pyi type stubs to reflect numpy array usage Differential Revision: D89891109
Summary: Implemented numpy array version of apply_model_param_limits() for the geometry module. This function clamps model parameters to their specified min/max bounds using the character's parameter limits. The implementation uses ModelParametersAccessor for clean data access and supports arbitrary batch dimensions with parallel processing. It only applies MinMax type parameter limits. Key changes: - Added applyModelParameterLimits() in momentum_geometry.cpp/h - Uses ArrayChecker pattern for input validation - Supports both float32 and float64 dtypes - Parallel batch processing with dispenso - Bound as Character.apply_model_param_limits() - Added tests in test_geometry.py - Added consistency test in test_geometry_diff_geometry_consistency.py - Updated .pyi type stubs Differential Revision: D89891111
Summary: Converted Character.skin_skinned_locators() from torch.Tensor to numpy arrays to maintain consistency with the geometry module. This function applies linear blend skinning to compute world-space positions of skinned locators. The implementation follows the core skinning algorithm from momentum's skinned_locator_error_function: for each locator, transform the rest position using inverse bind pose and joint transforms weighted by bone influences. Key changes: - Added skinSkinnedLocatorsArray() in array_skinning.cpp/h - Uses SkeletonStateAccessor and VectorArrayAccessor for clean data access - Supports arbitrary batch dimensions with parallel processing - Handles optional rest positions (uses locator positions if not provided) - Returns empty [0, 3] array if character has no skinned locators - Updated Character.skin_skinned_locators() binding to use array version - Updated .pyi type stubs Differential Revision: D89891114
Summary: Migrated find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh from torch tensors to numpy arrays. This continues the broader migration of pymomentum geometry operations from PyTorch to numpy. The key technical challenge was ensuring correct memory layout for the SimdKdTree library. Eigen matrices use column-major storage by default, but SimdKdTree expects row-major data where each point's coordinates are contiguous. Added a conditional toMatrix() method to VectorArrayAccessor that uses RowMajor storage for multi-dimensional points (Dim > 1) while preserving ColMajor for column vectors (Dim == 1) as required by Eigen. Differential Revision: D89891110
Summary: Pull Request resolved: #967 Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features. Key changes: - Implemented array_mppca for converting MPPCA models to numpy arrays - Changed Mppca.to_tensors() to Mppca.to_arrays() returning numpy arrays instead of torch tensors - Added Python bindings for find_closest_points, find_closest_points_with_normals, and find_closest_points_on_mesh using numpy arrays - Removed dependency on ATen/PyTorch tensor headers from geometry module - Updated test_posePrior to use numpy array indexing instead of tensor.select() Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes). Reviewed By: jeongseok-meta Differential Revision: D89891113
88e5bd6 to
b6eda41
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Completed the migration from PyTorch tensors to numpy arrays for both MPPCA (Mixture of Probabilistic PCA) operations and kd-tree function bindings. This commit provides the Python bindings for both features.
Key changes:
Note: This commit includes bindings for both the kd-tree functions (from the previous commit) and MPPCA, as they share common infrastructure changes (removing tensor includes and adding array includes).
Reviewed By: jeongseok-meta
Differential Revision: D89891113