facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.7k stars 1.3k forks source link

How could I ensure object is centered in rendered images (while changing viewpoints)? #1710

Open The-Nerd-AI opened 9 months ago

The-Nerd-AI commented 9 months ago

For a single 3D object mesh, I want to get its multiple views using PyTorch3D renderer. I set R, T = look_at_view_transform(dist=1, elev=0, azim=[0/360, 30/360, ..., 360/360],). Using R and T during the rendering process, I could obtain multiple views of the 3D object mesh.

However, I want to obtain "object-centered" images. In the above rendered images, objects are not located at the center of images. How could I obtain (1) multiple views (360 degrees in azimuth) and (2) object-centered images at the same time? ** I want to ensure that the center of the bounding box surrounding the object is equal to the center of image.

Please guide me with a specific code example :D

Thank you for this amazing project!

bottler commented 8 months ago

You can find the center yourself and then pass it as the at in look_at_view_transform.