vis4d.data.transforms.crop¶
Crop transformation.
Functions
|
Absolute crop. |
|
Absolute range crop. |
|
Relative crop. |
|
Relative range crop. |
Classes
|
Crop 2D bounding boxes. |
|
Crop depth maps. |
|
Crop Images. |
|
Crop instance segmentation masks. |
|
Crop Intrinsics. |
|
Crop optical flows. |
Parameters for Crop. |
|
|
Crop segmentation masks. |
|
Generate the parameters for a central crop operation. |
|
Generate the parameters for a crop operation. |
|
Generate the parameters for a random size crop operation. |
- class CropBoxes2D(*, in_keys=['boxes2d', 'boxes2d_classes', 'boxes2d_track_ids', 'transforms.crop.crop_box', 'transforms.crop.keep_mask'], out_keys=['boxes2d', 'boxes2d_classes', 'boxes2d_track_ids'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop 2D bounding boxes.
- __call__(boxes_list, classes_list, track_ids_list, crop_box_list, keep_mask_list)[source]¶
Crop 2D bounding boxes.
- Parameters:
boxes_list (list[NDArrayF32]) – The list of bounding boxes to be cropped.
classes_list (list[NDArrayI64]) – The list of the corresponding classes.
track_ids_list (list[NDArrayI64] | None, optional) – The list of corresponding tracking IDs. Defaults to None.
crop_box_list (list[NDArrayI32]) – The list of box to crop.
keep_mask_list (list[NDArrayBool]) – Which boxes to keep.
- Returns:
List of cropped bounding boxes according to parameters.
- Return type:
tuple[list[NDArrayF32], list[NDArrayI64], list[NDArrayI64]] | None
- class CropDepthMaps(*, in_keys=['depth_maps', 'transforms.crop.crop_box'], out_keys=['depth_maps'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop depth maps.
- class CropImages(*, in_keys=['images', 'transforms.crop.crop_box'], out_keys=['images', 'input_hw'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop Images.
- class CropInstanceMasks(*, in_keys=['instance_masks', 'transforms.crop.crop_box', 'transforms.crop.keep_mask'], out_keys=['instance_masks'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop instance segmentation masks.
- class CropIntrinsics(*, in_keys=['intrinsics', 'transforms.crop.crop_box'], out_keys=['intrinsics'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop Intrinsics.
- class CropOpticalFlows(*, in_keys=['optical_flows', 'transforms.crop.crop_box'], out_keys=['optical_flows'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop optical flows.
- class CropSegMasks(*, in_keys=['seg_masks', 'transforms.crop.crop_box'], out_keys=['seg_masks'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Crop segmentation masks.
- class GenCentralCropParameters(*, in_keys=['input_hw', 'boxes2d'], out_keys=['transforms.crop'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Generate the parameters for a central crop operation.
- class GenCropParameters(*, in_keys=['input_hw', 'boxes2d', 'seg_masks'], out_keys=['transforms.crop'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Generate the parameters for a crop operation.
- class GenRandomSizeCropParameters(*, in_keys=['input_hw', 'boxes2d'], out_keys=['transforms.crop'], sensors=None, same_on_batch=True, **kwargs)[source]¶
Generate the parameters for a random size crop operation.
A crop of the original image is made: the crop has a random area (H * W) and a random aspect ratio. Code adapted from torchvision.