Skip to content

Unable to use inferred npy to generate mesh #20

@icedwater

Description

@icedwater

I'm trying to generate some animation-friendly data from the inferred .npy, such as .obj but preferably .bvh or .fbx.

After following the suggested command, I get the error below. Is there a problem with the way the data is stored in the numpy ndarray?

python -m visualize.render_mesh --input_path save/results/x/condsamples000100000__benchmark_sparse_T\=60_CI\=0_CRG\=0_KGP\=1.0_seed39_doing_push-ups/sample00_rep00.mp4
Traceback (most recent call last):
  File "/home/iced/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/iced/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/iced/projects/CondMDI/visualize/render_mesh.py", line 29, in <module>
    npy2obj = vis_utils.npy2obj(npy_path, sample_i, rep_i,
  File "/home/iced/projects/CondMDI/visualize/vis_utils.py", line 18, in __init__
    self.bs, self.njoints, self.nfeats, self.nframes = self.motions['motion'].shape
ValueError: too many values to unpack (expected 4)

I checked the shape of the output and it is 5 dimensions, but if I add a _ in front of line 18 to ignore the first variable, I run into a different error:

./body_models/
WARNING: You are using a SMPL model, with only 10 shape coefficients.
Running SMPLify For sample [0], repetition [0], it may take a few minutes.
Traceback (most recent call last):
  File "/home/iced/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/iced/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/iced/projects/CondMDI/visualize/render_mesh.py", line 29, in <module>
    npy2obj = vis_utils.npy2obj(npy_path, sample_i, rep_i,
  File "/home/iced/projects/CondMDI/visualize/vis_utils.py", line 29, in __init__
    motion_tensor, opt_dict = self.j2s.joint2smpl(self.motions['motion'][self.absl_idx].transpose(2, 0, 1))  # [nframes, njoints, 3]
ValueError: axes don't match array

Is there something I'm missing about the dimensions of the data?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions