kts707 / camm

CAMM: Building Category-Agnostic and Animatable 3D Models from Monocular Videos
https://camm3d.github.io/
Other
13 stars 2 forks source link

issue about extract and save the kinematic chain #3

Closed limaolin2017 closed 4 months ago

limaolin2017 commented 4 months ago

Hi! When I run the following command:

extract and save the kinematic chain

python extract_skel.py --mesh_path logdir/$extra_tag/$seqname-ft2-rendering/mesh-rest.obj --mesh_name iiwa --output_path iiwa_joints.pkl --symm

There is an issue:

(rignet) root@autodl-container-61ac49b43e-062c641c:~/autodl-tmp/camm/third_party/RigNet# python extract_skel.py --mesh_path /root/autodl-tmp/camm/logdir/iiwa-test1/iiwa-ft2-rendering/mesh-rest.obj --mesh_name iiwa --output_path iiwa_joints.pkl --symm

loading all networks...
     joint prediction network loaded.
     root prediction network loaded.
     connection prediction network loaded.
save remeshed object for model ID iiwa
creating data for model ID iiwa
mesh used: ./input_meshes/iiwa_remesh.obj
     gathering topological edges.
Traceback (most recent call last):
  File "extract_skel.py", line 473, in <module>
    data, vox, surface_geodesic, translation_normalize, scale_normalize = create_single_data(mesh_filename)
  File "extract_skel.py", line 72, in create_single_data
    tpl_e = get_tpl_edges(mesh_v, mesh_f).T
  File "/root/autodl-tmp/camm/third_party/RigNet/gen_dataset.py", line 31, in get_tpl_edges
    neighbor_ids = np.concatenate(neighbor_ids, axis=0)
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate
kts707 commented 4 months ago

Could you check if there is a mesh file at this path third_party/RigNet/iiwa_remesh.obj and visualize it to see if it's a valid mesh? Essentially what my script does is first simplifying the input mesh and saving it to this path, and then loading it back to extract the kinematic chain.

limaolin2017 commented 4 months ago

I found 'iiwa_remesh.obj' at this path third_party/RigNet/input_meshes/iiwa_remesh.obj

I think it is valid:

Screenshot 2024-06-14 at 22 53 11
kts707 commented 4 months ago

I just pushed a fix to the main branch. Also thank you so much for spotting an error in the documentation! I have also included the fix for the wrong path.

The problem is that the script reads an empty edge when it loads the processed mesh. I think it might be caused by some weird structure in the mesh.

Additionally, if you get an error saying "cannot find ./input_meshes/xxx_normalized.binvox", please refer to the last point in the Common Install Issues. For some machines, the .binvox file is not automatically generated by the script. You actually need to run the command yourself to generated the normalized mesh yourself. Then you can rerun extract_skel.py to generate the kinematic chain.

If you run extract_skel.py on a machine with graphical interface, a window will pop up to show interactive visualization the extracted kinematic chain in 3D.

limaolin2017 commented 4 months ago

It work! Thank you for your help!!!

I just pushed a fix to the main branch. Also thank you so much for spotting an error in the documentation! I have also included the fix for the wrong path.

The problem is that the script reads an empty edge when it loads the processed mesh. I think it might be caused by some weird structure in the mesh.

Additionally, if you get an error saying "cannot find ./input_meshes/xxx_normalized.binvox", please refer to the last point in the Common Install Issues. For some machines, the .binvox file is not automatically generated by the script. You actually need to run the command yourself to generated the normalized mesh yourself. Then you can rerun extract_skel.py to generate the kinematic chain.

If you run extract_skel.py on a machine with graphical interface, a window will pop up to show interactive visualization the extracted kinematic chain in 3D.