mml.core.data_loading.task_attributes

class DataSplit[source]

Bases: StrEnum

Represents parts of a dataset that are loaded together. May be selected joint by a fold number to determine the exact samples that are available for iteration over a TaskDataset.

FULL_TRAIN = 'FULL_TRAIN'
TEST = 'TEST'
TRAIN = 'TRAIN'
UNLABELLED = 'UNLABELLED'
VAL = 'VAL'
__new__(value)
class Keyword[source]

Bases: StrEnum

Keyword labels of a task. Refers e.g. to the shown entities within the images.

ANATOMICAL_STRUCTURES = 'anatomical structures'
ANIMALS = 'animals'
ARTIFICIAL = 'artificial'
BONE = 'bone'
BRAIN = 'brain'
BREAST = 'breast'
BUILDINGS = 'buildings'
CAPSULE_ENDOSCOPY = 'capsule endoscopy'
CATARACT_SURGERY = 'cataract_surgery'
CHARS_DIGITS = 'chars_or_digits'
CHEST = 'chest'
CLE = 'confocal laser endomicroscopy'
COLPOSCOPY = 'colposcopy'
CT_SCAN = 'ct_scan'
DERMATOSCOPY = 'dermatoscopy'
DRIVING = 'driving'
ENDOSCOPIC_INSTRUMENTS = 'endoscopic instruments'
ENDOSCOPY = 'endoscopy'
EYE = 'eye'
FACES = 'faces'
FUNDUS_PHOTOGRAPHY = 'fundus_photography'
GASTROSCOPY_COLONOSCOPY = 'gastroscopy_colonoscopy'
GYNECOLOGY = 'Gynecology'
HANDWRITINGS = 'handwritings'
IMAGE_ARTEFACTS = 'image_artefacts'
INSTRUMENT_COUNT = 'counting endoscopic instruments'
LAPAROSCOPY = 'laparoscopy'
LARYNGOSCOPY = 'laryngoscopy'
MEDICAL = 'medical'
MRI_SCAN = 'mri_scan'
NATURAL_OBJECTS = 'natural_objects'
NEPHRECTOMY = 'Nephrectomy'
SCENES = 'scenes'
TISSUE_PATHOLOGY = 'tissue_pathology'
ULTRASOUND = 'ultrasound'
X_RAY = 'x_ray'
__new__(value)
class License[source]

Bases: StrEnum

License for distribution of a task (data).

CC_0_1_0 = 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'
CC_BY_4_0 = 'Creative Commons Attribution 4.0 International'
CC_BY_NC_4_0 = 'Creative Commons Attribution-NonCommercial 4.0 International'
CC_BY_NC_SA_4_0 = 'Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International'
CUSTOM = 'License defined in TaskCreator description'
DATABASE_CONTENTS_LICENSE_1_0 = 'Open Data Commons DbCL v1.0'
MIT = 'Massachusetts Institute of Technology'
UNKNOWN = 'unknown'
__new__(value)
class Modality[source]

Bases: StrEnum

The modalities represent the possible keys of a loaded sample from a dataset. E.g. {‘image’: ‘some/path/file.png’, ‘class’: 3}. Note that while TaskDescription stores the Modality as enum in its samples, the loaded batch will contain the str representations!

BBOX = 'bbox'
CLASS = 'class'
CLASSES = 'classes'
IMAGE = 'image'
KEYPOINTS = 'keypoints'
MASK = 'mask'
SAMPLE_ID = 'sample_id'
SOFT_CLASSES = 'soft_classes'
TASK = 'task'
THREE_D_IMAGE = 'three_d_image'
VALUE = 'value'
VIDEO_CLIP = 'video_clip'
__new__(value)
class RGBInfo[source]

Bases: object

Small dataclass storing information about image channels (mostly mean and std).

__init__(r: float = 0.0, g: float = 0.0, b: float = 0.0) None
b: float = 0.0
g: float = 0.0
get_rgb() List[float][source]
r: float = 0.0
to_list() List[float][source]
class Sizes[source]

Bases: object

Small dataclass storing information about the dimensionality of a set of images.

__init__(min_height: int = 0, max_height: int = 0, min_width: int = 0, max_width: int = 0) None
max_height: int = 0
max_width: int = 0
min_height: int = 0
min_width: int = 0
to_list() List[int][source]
class TaskType[source]

Bases: StrEnum

Defines the type of task. Different task types usually require completely different architectures and/or training procedures. This is aligned with the torchvision.models split at https://pytorch.org/docs/stable/torchvision/models.html

CLASSIFICATION = 'classification'
DEFAULT = 'unknown'
DETECTION = 'detection'
MULTILABEL_CLASSIFICATION = 'multilabel_classification'
NO_TASK = 'no_task'
REGRESSION = 'regression'
SEMANTIC_SEGMENTATION = 'semantic_segmentation'
UNKNOWN = 'unknown'
VIDEO_CLASS = 'video_classification'
__new__(value)
requires() List[List[Modality]][source]

Returns the necessary modalitie(s) for this kind of task. First list level is OR and second level is AND. So if returns [[A, B], [C, D]] either [A and B] or [C and D] are required.