Skip to content

SMPL-(H/X) model loading crash #75

@Era-Dorta

Description

@Era-Dorta

I want to load a custom SMPL-X sequence, this is the code that I have so far:

   smplx_layer = SMPLLayer(model_type="smplx", device=C.device)

    smpl_seq = SMPLSequence.from_npz(
        file="data.npz",
        smpl_layer=smplx_layer,
        poses_left_hand=data["poses_body"][:, poses_left_start:poses_left_end],
        poses_right_hand=data["poses_body"][:, poses_right_start:],
    )

when I run it, I get an error

Traceback (most recent call last):
  File "aitviewer/examples/load_smplx.py", line 32, in <module>
    smpl_seq = SMPLSequence.from_npz(
  File "aitviewer/aitviewer/renderables/smpl.py", line 327, in from_npz
    return cls(
  File "aitviewer/aitviewer/renderables/smpl.py", line 161, in __init__
    global_oris = local_to_global(
  File "aitviewer/aitviewer/utils/utils.py", line 342, in local_to_global
    if parents[j] < 0:
  IndexError: index 22 is out of bounds for axis 0 with size 22

While debugging it I tried the example/missing_frames.py, this very simple t_pose

    smplx_male = SMPLSequence.t_pose(
        SMPLLayer(model_type="smpl", gender="male", device=C.device),
        name="SMPL",
        position=np.array((-1.5, 0, 0)),
    )

For either, I get a

  File "/home/era/code/aitviewer/aitviewer/renderables/smpl.py", line 162, in __init__
    torch.cat([self.poses_root, self.poses_body, self.poses_left_hand, self.poses_right_hand], dim=-1),
TypeError: expected Tensor as element 2 in argument 0, but got NoneType

because the poses_left and poses_right hands are None, which is why I had to add them in my example above.

I also tried load_AMASS example and I get the same index 22 is out of bounds for axis 0 with size 22 error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions