otx.data#
Dataclasses and utils for data.
Classes
|
Torch data item batch implementation. |
|
Torch data item implementation. |
|
Torch prediction data item batch implementation. |
|
Torch prediction data item implementation. |
- class otx.data.TorchDataBatch(batch_size: int, images: torch.Tensor | list[torch.Tensor], labels: list[torch.Tensor] | None = None, masks: list[Mask] | None = None, bboxes: list[BoundingBoxes] | None = None, keypoints: list[torch.Tensor] | None = None, imgs_info: list[ImageInfo | None] | None = None)[source]#
Bases:
ValidateBatchMixin
Torch data item batch implementation.
- class otx.data.TorchDataItem(image: torch.Tensor, label: torch.Tensor | None = None, masks: Mask | None = None, bboxes: BoundingBoxes | None = None, keypoints: torch.Tensor | None = None, img_info: ImageInfo | None = None)[source]#
Bases:
ValidateItemMixin
,Mapping
Torch data item implementation.
- image#
The image tensor.
- Type:
torch.Tensor
- label#
The label tensor, optional.
- Type:
torch.Tensor | None
- masks#
The masks, optional.
- Type:
Mask | None
- bboxes#
The bounding boxes, optional.
- Type:
BoundingBoxes | None
- keypoints#
The keypoints, optional.
- Type:
torch.Tensor | None
- img_info#
Additional image information, optional.
- Type:
ImageInfo | None
- static collate_fn(items: list[TorchDataItem]) TorchDataBatch [source]#
Collate TorchDataItems into a batch.
- Parameters:
items – List of TorchDataItems to batch
- Returns:
Batched TorchDataItems with stacked tensors
- class otx.data.TorchPredBatch(batch_size: int, images: torch.Tensor | list[torch.Tensor], labels: list[torch.Tensor] | None = None, masks: list[Mask] | None = None, bboxes: list[BoundingBoxes] | None = None, keypoints: list[torch.Tensor] | None = None, imgs_info: list[ImageInfo | None] | None = None, scores: list[torch.Tensor] | None = None, feature_vector: list[torch.Tensor] | None = None, saliency_map: list[torch.Tensor] | None = None)[source]#
Bases:
TorchDataBatch
Torch prediction data item batch implementation.
- class otx.data.TorchPredItem(image: torch.Tensor, label: torch.Tensor | None = None, masks: Mask | None = None, bboxes: BoundingBoxes | None = None, keypoints: torch.Tensor | None = None, img_info: ImageInfo | None = None, scores: torch.Tensor | None = None, feature_vector: torch.Tensor | None = None, saliency_map: torch.Tensor | None = None)[source]#
Bases:
TorchDataItem
Torch prediction data item implementation.