kitcar_ml.utils.data.data_loader.transforms package
Submodules
kitcar_ml.utils.data.data_loader.transforms.albumentations_transform module
Classes:
|
|
|
- class AlbumentationsComposer(transforms: Sequence[Union[BasicTransform, BaseCompose]], bbox_params: Optional[Union[dict, BboxParams]] = None, keypoint_params: Optional[Union[dict, KeypointParams]] = None, additional_targets: Optional[Dict[str, str]] = None, p: float = 1.0, is_check_shapes: bool = True)[source]
Bases:
ComposeAttributes:
- _abc_impl = <_abc_data object>
- processors: Dict[str, Union[BboxProcessor, KeypointsProcessor]]
- class AlbumentationsTransform(augmentations: List[BasicTransform], **compose_kwargs)[source]
Bases:
BBoxImageTransformAttributes:
- _abc_impl = <_abc_data object>
kitcar_ml.utils.data.data_loader.transforms.bbox_image_transform module
Classes:
Base transform for image/bbox augmentations. |
kitcar_ml.utils.data.data_loader.transforms.mosaic_transform module
Classes:
|
Transform multiple images into a grid/mosaic image. |
- class MosaicTransform(rows: int = 2, columns: int = 2)[source]
Bases:
BBoxImageTransformTransform multiple images into a grid/mosaic image.
All images before this transformation should have the same shape. A random cropping before this transformation adds variability.
Attributes:
Images needed to produce one mosaic image.
Methods:
calculate_mosaic_image(mosaic_batch)Calculate a mosaic image from a batch of images.
shift_box(box, index, height, width)Shift a bounding box dependent on the position in the grid and the height and width of the images.
create_grid_image(images)Concatenate the images to a new image.
- property imgs_per_output: int
Images needed to produce one mosaic image.
- calculate_mosaic_image(mosaic_batch: List[Tuple[ndarray, List[ndarray], List[str]]]) Tuple[ndarray, List[ndarray], List[str]][source]
Calculate a mosaic image from a batch of images.
- shift_box(box: ndarray, index: int, height: int, width: int) ndarray[source]
Shift a bounding box dependent on the position in the grid and the height and width of the images.
- Parameters
box – The bounding box that is shifted.
index – The index of the corresponding image.
height – The height of one image.
width – The width of one image.
- _abc_impl = <_abc_data object>