kaolin.render.camera.ExtrinsicsRep

API

class kaolin.render.camera.ExtrinsicsRep(params, dtype=None, device=None, requires_grad=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.

Parameters
abstract classmethod backend_name()
Return type

str

abstract classmethod convert_from_mat(mat)

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

Parameters

mat (Tensor) –

Return type

Tensor

abstract convert_to_mat()

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

Return type

Tensor

property device: device

return the torch device of parameters tensor

property dtype: dtype
classmethod from_mat(mat, dtype=None, device=None, requires_grad=False)

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

Parameters
abstract classmethod param_idx(param)

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.

Parameters

param (ExtrinsicsParamsDefEnum) –

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

Cast to a different device / dtype

update(mat)

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

Parameters

mat (Tensor) –