kaolin.render.camera.ExtrinsicsRep

API

class kaolin.render.camera.ExtrinsicsRep(params: Tensor, dtype: Optional[dtype] = None, device: Optional[Union[device, str]] = None, requires_grad: bool = False)

Bases: ABC

An abstract class for representing CameraExtrinsics representation backends. This class keeps the separation between the parameter representation space and the associated rigid transformation (usually represented as a view matrix) separate.

Different representations are tuned to varied use cases: speed, differentiability w.r.t rigid transformations space, and so forth.

abstract classmethod backend_name() str
abstract classmethod convert_from_mat(mat: Tensor) Tensor

Converts a view-matrix to the underlying representation form of shape (C, K) where K is the number of representation parameters.

abstract convert_to_mat() Tensor

Converts the underlying representation to view-matrix form of shape (C, 4, 4)

property device: device

return the torch device of parameters tensor

property dtype: dtype
classmethod from_mat(mat: Tensor, dtype: Optional[dtype] = None, device: Optional[Union[device, str]] = None, requires_grad: bool = False)

Constructs backend from given (C, 4, 4) view matrix.

abstract classmethod param_idx(param: ExtrinsicsParamsDefEnum)

Returns the indices of elements in the ‘self.params’ field of instances of this class, which are belong under the ExtrinsicsParamsDefEnum param argument. i.e: For ExtrinsicsParamsDefEnum.R, a 4x4 matrix representation will return the 9 indices of the camera axes R component.

property requires_grad: bool
to(*args, **kwargs)

Cast to a different device / dtype

update(mat: Tensor)

Updates the underlying representation by mapping the 4x4 view matrix to representation space