irtk.connector.Connector

class irtk.connector.Connector
__init__()
classmethod register(class_name: str) Callable

Registers an extension function.

Parameters:

class_name – The name of the class.

Returns:

A wrapper function.

abstract renderC(scene: Scene, render_options: Dict[str, Any], sensor_ids: List[int] = [0], integrator_id: int = 0) torch.Tensor

Renders the scene with the given sensor IDs and integrator IDs.

Parameters:
  • scene – The scene to render.

  • render_options – The render options.

  • sensor_ids – The sensor IDs.

  • integrator_id – The integrator ID.

Returns:

A torch.Tensor containing the rendered images with shape (num_sensors, h, w, c).

abstract renderD(image_grads: torch.Tensor, scene: Scene, render_options: Dict[str, Any], sensor_ids: List[int] = [0], integrator_id: int = 0) List[torch.Tensor]

Given the gradients of the rendered images, compute the gradients of the scene parameters.

Parameters:
  • image_grads – The image gradients.

  • scene – The scene passed to renderC.

  • render_options – The render options.

  • sensor_ids – The sensor IDs.

  • integrator_id – The integrator ID.

Returns:

A list of torch.Tensors, where each tensor corresponds to the gradient of a parameter in scene.requiring_grad, in the same order.