kaolin.io.render¶
API¶
- kaolin.io.render.import_synthetic_view(root_dir, idx, rgb=True, depth_linear=False, semantic=False, instance=False, normals=False, bbox_2d_tight=False, bbox_2d_loose=False)¶
Import views of synthetic data simulating sensors on 3D models, following the format output by the Data Generator extension in the Omniverse Kaolin App.
- Parameters
root_dir (str) – path to the root directory containin the views.
idx (int) – index of the view selected.
rgb (bool, optional) – if True, load RGB image. Default: True.
depth_linear (bool, optional) – if True, load depth map with linear scaling. Default: False.
semantic (bool, optional) – if True, load semantic segmentation map. Default: False.
instance (bool, optional) – if True, load instance segmentation map. Default: False.
normals (bool, optional) – if True, load normals map. Default: False.
bbox_2d_tight (bool, optional) – if True, load tight 2d bounding box. Default: False.
bbox_2d_loose (bool, optional) – if True, load loose 2d bounding box. Default: False.
- Returns
- All the sensors selected depending on the arguments:
’rgb’ (torch.FloatTensor): the RGB image, of shape \((B, H, W, 3)\).
’depth_linear’ (torch.FloatTensor): the depth map with linear scaling, of shape \((B, H, W)\).
’semantic’ (torch.IntTensor): the semantic segmentation map, of shape \((B, H, W)\).
’instance’ (torch.IntTensor): the instance segmentation map, of shape \((B, H, W)\).
’bbox_2d_tight’ (dict): the bounding box, as 4 floats (xmin, xmax, ymin, ymax).
’normals’ (torch.FloatTensor): the normals map, of shape \((B, H, W, 3)\).
- And ‘metadata’, a dictionary containing:
’assets_transform’: the transformation matrix of the combined assets transformations
’cam_transform’: the transformation matrix, of shape \((4, 3)\).
’cam_proj’: the projection matrix, of shape \((3, 1)\).
’clipping_range’: the range at which the object are seen, as a list of (min, max).
- Return type
(dict)