otx.algorithms.visual_prompting.adapters.pytorch_lightning.datasets.pipelines.transforms#

Collection of transfrom pipelines for visual prompting task.

Functions

collate_fn(batch)

Collate function for dataloader.

Classes

MultipleInputsCompose(transforms)

Composes several transforms have multiple inputs together.

Pad()

Pad images, gt_masks, bboxes, and points to the same size.

class otx.algorithms.visual_prompting.adapters.pytorch_lightning.datasets.pipelines.transforms.MultipleInputsCompose(transforms)[source]#

Bases: Compose

Composes several transforms have multiple inputs together.

__call__(item: Dict[str, int | Tensor]) Dict[str, int | Tensor][source]#

Composes several transforms have multiple inputs together.

Parameters:

item (Dict[str, Union[int, Tensor]]) – Input item.

Returns:

Transformed item.

Return type:

Dict[str, Union[int, Tensor]]

class otx.algorithms.visual_prompting.adapters.pytorch_lightning.datasets.pipelines.transforms.Pad[source]#

Bases: object

Pad images, gt_masks, bboxes, and points to the same size.

__call__(item: Dict[str, List[Any] | Tensor]) Dict[str, int | Tensor][source]#

Pad images, gt_masks, bboxes, and points to the same size.

Parameters:

item (Dict[str, Union[int, Tensor]]) – Input item.

Returns:

Padded item.

Return type:

Dict[str, Union[int, Tensor]]

otx.algorithms.visual_prompting.adapters.pytorch_lightning.datasets.pipelines.transforms.collate_fn(batch: List[Any]) Dict[source]#

Collate function for dataloader.

Parameters:

batch (List) – List of batch data.

Returns:

Collated batch data.

Return type:

Dict