RegressionImageDataset#
- class RegressionImageDataset[source]#
Bases:
ImageDataset
- __init__(data_dir: str, class_names: Iterable[str], *args, **kwargs)[source]#
Constructor.
- Parameters
orig_dataset – An object with a __getitem__ and __len__.
transform – Albumentations transform to apply to the windows. Defaults to
None
. Each transform in Albumentations takes images of type uint8, and sometimes other data types. The data type requirements can be seen at https://albumentations.ai/docs/api_reference/augmentations/transforms/ # noqa If there is a mismatch between the data type of imagery and the transform requirements, a RasterTransformer should be set on the RasterSource that converts to uint8, such asMinMaxTransformer
orStatsTransformer
.transform_type – The type of transform so that its inputs and outputs can be handled correctly. Defaults to
TransformType.noop
.normalize – If
True
, the sampled chips are normalized to [0, 1] based on their data type. Defaults toTrue
.to_pytorch – If
True
, the sampled chips and labels are converted to pytorch tensors. Defaults toTrue
.data_dir (str) –
Methods
__init__
(data_dir, class_names, *args, **kwargs)Constructor.
- __add__(other: Dataset[_T_co]) ConcatDataset[_T_co] #
- Parameters
other (Dataset[_T_co]) –
- Return type
ConcatDataset[_T_co]
- __getitem__(key) tuple[torch.Tensor, torch.Tensor] #
- Return type
- __init__(data_dir: str, class_names: Iterable[str], *args, **kwargs)[source]#
Constructor.
- Parameters
orig_dataset – An object with a __getitem__ and __len__.
transform – Albumentations transform to apply to the windows. Defaults to
None
. Each transform in Albumentations takes images of type uint8, and sometimes other data types. The data type requirements can be seen at https://albumentations.ai/docs/api_reference/augmentations/transforms/ # noqa If there is a mismatch between the data type of imagery and the transform requirements, a RasterTransformer should be set on the RasterSource that converts to uint8, such asMinMaxTransformer
orStatsTransformer
.transform_type – The type of transform so that its inputs and outputs can be handled correctly. Defaults to
TransformType.noop
.normalize – If
True
, the sampled chips are normalized to [0, 1] based on their data type. Defaults toTrue
.to_pytorch – If
True
, the sampled chips and labels are converted to pytorch tensors. Defaults toTrue
.data_dir (str) –