vis4d.data.transforms.affine¶
Affine transformation.
Modified from mmdetection (https://github.com/open-mmlab/mmdetection).
Functions
|
Generate rotation matrix. |
|
Generate scaling matrix. |
|
Generate shear matrix. |
|
Generate translation matrix. |
Classes
|
Apply Affine to a list of 2D bounding boxes. |
|
Affine Images. |
Parameters for Affine. |
|
|
Random affine transform data augmentation. |
- class AffineBoxes2D(*, in_keys=['boxes2d', 'boxes2d_classes', 'boxes2d_track_ids', 'transforms.affine.warp_matrix', 'transforms.affine.height', 'transforms.affine.width'], out_keys=['boxes2d', 'boxes2d_classes', 'boxes2d_track_ids'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Apply Affine to a list of 2D bounding boxes.
- class AffineImages(*, in_keys=['images', 'transforms.affine.warp_matrix', 'transforms.affine.height', 'transforms.affine.width'], out_keys=['images', 'input_hw'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Affine Images.
- class GenAffineParameters(*, in_keys=['input_hw'], out_keys=['transforms.affine'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Random affine transform data augmentation.
This operation randomly generates affine transform matrix which including rotation, translation, shear, and scaling transforms.
- __call__(input_hw)[source]¶
Compute the parameters and put them in the data dict.
- Return type:
list
[AffineParam
]
- get_rotation_matrix(rotate_degrees)[source]¶
Generate rotation matrix.
- Parameters:
rotate_degrees (float) – Rotation degrees.
- Return type:
ndarray
[Any
,dtype
[float32
]]
- get_scaling_matrix(scale_ratio)[source]¶
Generate scaling matrix.
- Parameters:
scale_ratio (float) – Scale ratio.
- Return type:
ndarray
[Any
,dtype
[float32
]]