CRM icon indicating copy to clipboard operation
CRM copied to clipboard

How do you render an image from flexicube geometry?

Open nerf-mae opened this issue 1 year ago • 2 comments

Great work! Can you please share more details and ideally code of how do you render a render rgb image from the flexicubes geometry? I see the following code, but it only renders masks and depth. Thanks in advance!

    def render_mesh(self, mesh_v_nx3, mesh_f_fx3, camera_mv_bx4x4, resolution=256, hierarchical_mask=False):
        return_value = dict()
        if self.render_type == 'neural_render':
            tex_pos, mask, hard_mask, rast, v_pos_clip, mask_pyramid, depth = self.renderer.render_mesh(
                mesh_v_nx3.unsqueeze(dim=0),
                mesh_f_fx3.int(),
                camera_mv_bx4x4,
                mesh_v_nx3.unsqueeze(dim=0),
                resolution=resolution,
                device=self.device,
                hierarchical_mask=hierarchical_mask
            )

            return_value['tex_pos'] = tex_pos
            return_value['mask'] = mask
            return_value['hard_mask'] = hard_mask
            return_value['rast'] = rast
            return_value['v_pos_clip'] = v_pos_clip
            return_value['mask_pyramid'] = mask_pyramid
            return_value['depth'] = depth
        else:
            raise NotImplementedError

        return return_value

nerf-mae avatar Mar 26 '24 00:03 nerf-mae

Thank you for your interest. I will upload the code for texture rendering :)

thuwzy avatar Mar 26 '24 06:03 thuwzy

any update? @thuwzy

cwchenwang avatar Aug 12 '24 02:08 cwchenwang