Fix direct SMPL NPZ loading - #84
Open
jeongseok-meta wants to merge 1 commit into
Open
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why:
The SMPL conversion example serialized
.npzarrays to a temporary pickle without normalizing their layout. A standard component-firstposedirsarray shaped(207, 20670)was therefore interpreted incorrectly bysmplx, producingmat1 and mat2 shapes cannot be multiplied (1x207 and 20670x207). The alternative legacy SMPL pickle requires Chumpy, which is not compatible with the supported Python environments.What:
Load standard SMPL
.npzfiles directly in memory, accept Chumpy-free.pklfiles, and document the supported model files and Python setup. No generated pickle is needed.How:
mhr.smpl.load_smpl_model, normalize 3D and flattenedshapedirs/posedirslayouts, and validate the standard 6890-vertex SMPL schema before constructingsmplx.SMPL..npzmodel..npzdownload, testedsmplx==0.1.28setup, supported Python 3.12/3.13 environments, Windows limitations, and current package boundaries.(207, 20670)layout, and rejection of nonstandard topology.API changes:
Adds
mhr.smpl.load_smpl_model(path, **kwargs)as an optional-dependency API. Importingmhr.smpldoes not requiresmplx; loading a model does.Packaging scope:
No conda-forge recipe change is included. The feedstock installs the upstream wheel, while the full converter is not yet an installable package and
smplxis unavailable on conda-forge with an upstream license that restricts redistribution. Packaging the complete converter should be a separate upstream-first follow-up; this PR ensures the reusable loader is included in future MHR wheels and therefore future conda-forge builds.Evidence:
1x207/20670x207failure withsmplx==0.1.28on Python 3.12 and 3.13.(1, 6890, 3)on both versions, without generating a.pkl.mhr/smpl.pyand imports it withoutsmplxinstalled.Related to #54. The issue should remain open until the reporter confirms the documented path works in their environment.
Test plan
pixi run -e py312 testRun URL: local only (no run URL emitted) — 10 passed
pixi run -e py313 testRun URL: local only (no run URL emitted) — 10 passed
Run URL: local only (no run URL emitted) — both passed
Run URL: local only (no run URL emitted) — sdist and wheel built successfully