• Georgia Gkioxari's avatar
    NDC/screen cameras API fix, compatibility with renderer · 0c32f094
    Georgia Gkioxari authored
    Summary:
    API fix for NDC/screen cameras and compatibility with PyTorch3D renderers.
    
    With this new fix:
    * Users can define cameras and `transform_points` under any coordinate system conventions. The transformation applies the camera K and RT to the input points, not regarding for PyTorch3D conventions. So this makes cameras completely independent from PyTorch3D renderer.
    
    * Cameras can be defined either in NDC space or screen space. For existing ones, FoV cameras are in NDC space. Perspective/Orthographic can be defined in NDC or screen space.
    
    * The interface with PyTorch3D renderers happens through `transform_points_ndc` which transforms points to the NDC space and assumes that input points are provided according to PyTorch3D conventions.
    
    * Similarly, `transform_points_screen` transforms points to screen space and again assumes that input points are under PyTorch3D conventions.
    
    * For Orthographic/Perspective cameras, if they are defined in screen space, the `get_ndc_camera_transform` allows points to be converted to NDC for use for the renderers.
    
    Reviewed By: nikhilaravi
    
    Differential Revision: D26932657
    
    fbshipit-source-id: 1a964e3e7caa54d10c792cf39c4d527ba2fb2e79
    0c32f094
test_render_meshes.py 45.5 KB