class pytorch3d.implicitron.models.model_dbir.ModelDBIR(*args, **kwargs)[source]

Bases: ImplicitronModelBase

A simple depth-based image rendering model.

  • render_image_width – The width of the rendered rectangular images.

  • render_image_height – The height of the rendered rectangular images.

  • bg_color – The color of the background.

  • max_points – Maximum number of points in the point cloud formed by unprojecting all source view depths. If more points are present, they are randomly subsampled to this number of points without replacement.

render_image_width: int = 256
render_image_height: int = 256
bg_color: Tuple[float, float, float] = (0.0, 0.0, 0.0)
max_points: int = -1
forward(*, image_rgb: Tensor | None, camera: CamerasBase, fg_probability: Tensor | None, mask_crop: Tensor | None, depth_map: Tensor | None, sequence_name: List[str] | None, evaluation_mode: EvaluationMode = EvaluationMode.EVALUATION, frame_type: List[str], **kwargs) Dict[str, Any][source]

Given a set of input source cameras images and depth maps, unprojects all RGBD maps to a colored point cloud and renders into the target views.

  • camera – A batch of N PyTorch3D cameras.

  • image_rgb – A batch of N images of shape (N, 3, H, W).

  • depth_map – A batch of N depth maps of shape (N, 1, H, W).

  • fg_probability – A batch of N foreground probability maps of shape (N, 1, H, W).

  • frame_type – A list of N strings containing frame type indicators which specify target and source views.



A dict with the following fields:
implicitron_render: The rendered colors, depth and mask

of the target views.

point_cloud: The point cloud of the scene. It’s renders are

stored in implicitron_render.