NVlabs / FoundationPose

[CVPR 2024 Highlight] FoundationPose: Unified 6D Pose Estimation and Tracking of Novel Objects
https://nvlabs.github.io/FoundationPose/
Other
1.12k stars 130 forks source link

Random scaling of mesh is required #171

Closed shruthi-autodesk closed 1 day ago

shruthi-autodesk commented 1 week ago

As mentioned in this comment, I scaled my custom mesh such that it's in meters using trimesh.apply_scale(0.001). However, this scaling seems to make the mesh too small. It seems like, for each custom mesh I use, I have to apply an empirical scaling factor that converts my mesh to match the pointcloud from the scene. Here's an example:

Mesh scaled at 0.001 Picture of ground truth RGB image overlaid with the mesh in predicted pose composite

Picture of ground truth pointcloud overlaid with mesh pointcloud in predicted pose Screenshot from 2024-06-21 12-22-37

Mesh scaled at 0.014 Picture of ground truth RGB image overlaid with the mesh in predicted pose composite

Picture of ground truth pointcloud overlaid with mesh pointcloud in predicted pose Screenshot from 2024-06-21 12-20-14

Why does this happen? I'm attaching my data in the same format as the demo mustard example and my debug folders (for the 0.001 scale case and 0.014 scale case) as well. The code can be run by just providing the path to this data in run_demo.py, and adding a trimesh scaling factor using mesh.apply_scale(0.014) after line 29.

Is there a way to automatically determine this scaling factor? Please help me out with this, I've been trying to debug this for a long time.

shruthi-autodesk commented 4 days ago

@wenbowen123

wenbowen123 commented 4 days ago

can you share your debug_dir folder? One possibility is your point cloud is in the wrong scale. You can measure its dimension in meshlab.

shruthi-autodesk commented 3 days ago

Here's my debug folder when I used a scaling factor of 0.014: https://drive.google.com/file/d/1sOCSi3nX2Yu02nJ1ojE8vAVsGA3bpBUY/view?usp=drive_link

Debug folder when I used a scaling factor of 0.001: https://drive.google.com/file/d/1Zn1wRyQv_2YXNdhNTd3cHDYfRQyOp2o0/view?usp=drive_link

Link to data used: https://drive.google.com/file/d/1kkBJwaU9gqivWKxD8es0lMNoKmZ6Ti3o/view?usp=drive_link

wenbowen123 commented 3 days ago

@shruthi-autodesk your point cloud has the wrong scale. You can double check your depth saving format.

shruthi-autodesk commented 1 day ago

@wenbowen123 You were right, thanks for pointing this out. I was always assuming that something's wrong with my mesh. I was able to fix it by making sure my depth image is in mm.