-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Incorrect rendering of object compared to Ground Truth image on LineMod Dataset #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think you need to pay close attention to camera conventions in PyTorch3D and the dataset. Issue #18 may be useful. |
HI @bottler and @nikhilaravi. Thanks for the quick response. I do understand that it is a camera convention issue. And I have the following observations regarding that:
Any input from your end would be greatly appreciated. |
The division by 1000 is for changing the scale. The vertices for the mesh are defined in meters while the translation vector is defined in millimeters. The weird rendering is due to overflow of max_faces_per_bin attribute in the rasterization settings. Setting it to the total number of faces in the mesh fixed it for me. |
Thanks a lot! It seems like we cannot perform a batched rendering because |
@sailor-z Maybe you can set the attribute to be the max faces across the whole batch which would allow it to render correctly. Were you able to figure out the conventions issue with the renderer? |
@manasburagohain When I set the attribute like this
it doesn't work. I have used the solution in #18 with pytorch3d 0.6.0, but the pose issue still exists. |
Hey @manasburagohain , I think you can just change one line:
This is simply because the rotation (and RT transformation) in pytorch3d is applied from right to left. So the rotation and transformation matrices in pytorch3d are transposed compared with those in opencv. Shown below is what I obtained after this change (I additionally changed the background color for rendering as black, my full code is available here https://github.com/wangg12/pytorch3d_render_linemod/blob/master/test.py): |
@wangg12 It works for me. Thanks a lot! |
@wangg12 Thanks for the help! |
🐛 Bugs / Unexpected behaviors
Given a ground truth image and a ground truth pose, I attempt to render the object with the same pose to align with GT image.
Initially setting the camera pose to GT pose results in following rendering:
However since Pytorch3D follows an altered axes convention, I attempt use the fix suggested #522 by negating f to -f, which results in the following render:
Additionally , I attempt to use the fix mentioned in #294 by rotating about z by 180 degrees which results in the following render:
As we can see neither fixes result in the rendered object exactly aligning with the GT pose. This has been over multiple GT poses and images.
Instructions To Reproduce the Issue:
Please include the following (depending on what the issue is):
git diff
) or code you wrotepython test.py
Files Used:
GT/Background image:
Mesh: https://drive.google.com/file/d/1kIw9dypvxsJ-xgI573RL6s-ncf7e5L2a/view?usp=sharing
The text was updated successfully, but these errors were encountered: