# tasks

Python API: `luxonis_train.tasks`

The tasks a head can solve, and the labels each one requires.

A task connects a head to the losses, metrics, and visualizers that attach to it. It gives the key of the main prediction of the
head and the labels that the loader must supply.
[Tasks](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks)
gives an instance of each built-in task.

## Classes

| Name | Description |
| --- | --- |
| [`AnomalyDetection`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-AnomalyDetection) | The anomaly detection task. |
| [`BoundingBox`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-BoundingBox) | The bounding box detection task. |
| [`Classification`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Classification) | The classification task. |
| [`Embeddings`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Embeddings) | The embedding task. |
| [`Fomo`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Fomo) | The FOMO detection task. |
| [`InstanceBaseTask`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceBaseTask) | Base class for the tasks that detect object instances. |
| [`InstanceKeypoints`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceKeypoints) | The keypoint detection task for object instances. |
| [`InstanceSegmentation`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceSegmentation) | The instance segmentation task. |
| [`InstanceSegmentationKeypoints`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceSegmentationKeypoints) | The instance segmentation and keypoint detection task. |
| [`Keypoints`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Keypoints) | The keypoint task without bounding boxes. |
| [`Metadata`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata) | A metadata label that a task requires. |
| [`Ocr`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Ocr) | The optical character recognition task. |
| [`Segmentation`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Segmentation) | The semantic segmentation task. |
| [`staticproperty`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-staticproperty) | Descriptor that calls a function on each attribute access. |
| [`Task`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Task) | Base class for all tasks. |
| [`Tasks`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks) | The namespace that gives an instance of each built-in task. |

### class `AnomalyDetection`

```python
class AnomalyDetection(Task)
```

The anomaly detection task.

Its name is `"anomaly_detection"`.
[LuxonisLoaderPerlinNoise](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/loaders/luxonis_perlin_loader_torch.md#luxonis_perlin_loader_torch-Classes-LuxonisLoaderPerlinNoise)
supplies both of its labels. The `"segmentation"` label is the one-hot anomaly mask, of shape `[2, H, W]`. The
`"original_segmentation"` label is the input image without the added anomaly.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`main_output`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-AnomalyDetection-main_output) | `str` | The key of the main prediction of a head with this task. |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-AnomalyDetection-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-AnomalyDetection-__init__) |  |

#### property `main_output`

```python
main_output: str
```

The key of the main prediction of a head with this task.

It is `name` unless a subclass overrides it. When `forward` returns a tensor or a list of tensors,
[BaseNode.run](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/nodes/base_node.md#base_node-Classes-BaseNode-run)
puts the result under this key. An attached module fills some arguments from this key. The name of such an argument starts with
`pred` and has no underscore, for example `predictions`.

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `BoundingBox`

```python
class BoundingBox(InstanceBaseTask)
```

The bounding box detection task.

Its name is `"boundingbox"`. It requires only the `"boundingbox"` label.

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-BoundingBox-__init__) |  |

#### method `__init__`

```python
def __init__()
```

### class `Classification`

```python
class Classification(Task)
```

The classification task.

Its name and required label are both `"classification"`.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Classification-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Classification-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `Embeddings`

```python
class Embeddings(Task)
```

The embedding task.

Its name is `"embeddings"`. It requires integer or categorical `"metadata/id"` labels.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Embeddings-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Embeddings-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `Fomo`

```python
class Fomo(InstanceBaseTask)
```

The FOMO detection task.

Its name is `"fomo"`. A FOMO head predicts a heatmap of object centers. The task requires the `"boundingbox"` label, and its main
prediction is `"heatmap"`.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`main_output`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Fomo-main_output) | `str` | The key of the main prediction of a head with this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Fomo-__init__) |  |

#### property `main_output`

```python
main_output: str
```

The key of the main prediction of a head with this task.

It is `name` unless a subclass overrides it. When `forward` returns a tensor or a list of tensors,
[BaseNode.run](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/nodes/base_node.md#base_node-Classes-BaseNode-run)
puts the result under this key. An attached module fills some arguments from this key. The name of such an argument starts with
`pred` and has no underscore, for example `predictions`.

#### method `__init__`

```python
def __init__()
```

### class `InstanceBaseTask`

```python
class InstanceBaseTask(Task)
```

Base class for the tasks that detect object instances.

The subclasses require the `"boundingbox"` label. Some subclasses add more labels.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceBaseTask-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

### class `InstanceKeypoints`

```python
class InstanceKeypoints(InstanceBaseTask)
```

The keypoint detection task for object instances.

Its name is `"keypoints"`. It requires bounding boxes and keypoints.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceKeypoints-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceKeypoints-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `InstanceSegmentation`

```python
class InstanceSegmentation(InstanceBaseTask)
```

The instance segmentation task.

Its name is `"instance_segmentation"`. It requires bounding boxes and instance masks.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceSegmentation-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceSegmentation-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `InstanceSegmentationKeypoints`

```python
class InstanceSegmentationKeypoints(InstanceBaseTask)
```

The instance segmentation and keypoint detection task.

Its name is `"instance_segmentation_keypoints"`. It requires bounding boxes, instance masks, and keypoints.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceSegmentationKeypoints-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceSegmentationKeypoints-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `Keypoints`

```python
class Keypoints(Task)
```

The keypoint task without bounding boxes.

Its name is `"pointcloud"`. Unlike
[InstanceKeypoints](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-InstanceKeypoints),
it does not require the `"boundingbox"` label.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Keypoints-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Keypoints-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `Metadata`

```python
class Metadata
```

A metadata label that a task requires.

The string form of the label is `"metadata/<name>"`. The key of the label in the loader output is `"<task_name>/metadata/<name>"`,
where `<task_name>` is the dataset task of the node. Two labels are equal when `name` and `typ` are equal. The hash depends only
on `name`.

> **Example**
> ```pycon
>>> from luxonis_train.tasks import Metadata
>>> label = Metadata("text", str)
>>> str(label)
'metadata/text'
```

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `name` | `str` | The name of the metadata label, for example `"id"`. The `metadata_task_override` field of a node config can rename it. |
| `typ` | `UnionType | type` | The type that the label values must have, or a union of the accepted types. |

Methods

| Name | Description |
| --- | --- |
| [`check_type`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata-check_type) | Check if the label accepts values of a type. |

#### method `check_type`

```python
def check_type(typ: UnionType | type) -> bool
```

Check if the label accepts values of a type.

When the `typ` attribute is a union, the method checks that the `typ` argument is one of the members of the union. Otherwise, it checks that the two types are equal. A subclass of an accepted type does not match.

> **Example**
> ```pycon
>>> from luxonis_train.tasks import Metadata
>>> label = Metadata("id", int | str)
>>> label.check_type(str), label.check_type(float)
(True, False)
>>> Metadata("flag", int).check_type(bool)
False
```

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `typ` | `UnionType | type` | The type to check, for example the type of the label in the dataset metadata. | required |

Returns

| Type | Description |
| --- | --- |
| `bool` | `True` when the label accepts `typ`. |

### class `Ocr`

```python
class Ocr(Task)
```

The optical character recognition task.

Its name is `"ocr"`. It requires string `"metadata/text"` labels.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Ocr-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Ocr-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `Segmentation`

```python
class Segmentation(Task)
```

The semantic segmentation task.

Its name and required label are both `"segmentation"`.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Segmentation-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Segmentation-__init__) |  |

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

#### method `__init__`

```python
def __init__()
```

### class `staticproperty`

```python
class staticproperty
```

Descriptor that calls a function on each attribute access.

[Tasks](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks)
uses it so that every attribute access returns a fresh task.

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-staticproperty-__init__) |  |

#### method `__init__`

```python
def __init__(func: Callable)
```

### class `Task`

```python
class Task(ABC)
```

Base class for all tasks.

A head sets its task in the `task` class attribute. A loss, a metric, or a visualizer lists the tasks it supports in
`supported_tasks`. Two tasks are equal when they have the same class and the same `name`.

A subclass must override
[required_labels](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Task-required_labels).
Python does not enforce this rule, because `functools.cached_property` hides the abstract method. An instance of a subclass
without the override returns `None` for
[required_labels](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Task-required_labels).

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `name` | `str` | The name of the task. It is the default value of [main_output](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Task-main_output). |

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`main_output`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Task-main_output) | `str` | The key of the main prediction of a head with this task. |
| [`required_labels`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Task-required_labels) | `set[str | Metadata]` | The labels that the loader must supply for this task. |

#### property `main_output`

```python
main_output: str
```

The key of the main prediction of a head with this task.

It is `name` unless a subclass overrides it. When `forward` returns a tensor or a list of tensors,
[BaseNode.run](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/nodes/base_node.md#base_node-Classes-BaseNode-run)
puts the result under this key. An attached module fills some arguments from this key. The name of such an argument starts with
`pred` and has no underscore, for example `predictions`.

#### property `required_labels`

```python
required_labels: set[str | Metadata]
```

The labels that the loader must supply for this task.

An implementation returns a set of label types, such as `"boundingbox"`, and
[Metadata](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Metadata)
labels. The key of a label in the loader output is `"<task_name>/<label>"`. `<task_name>` is the dataset task of the node, not the
`name` of the task. The property computes the value once for each task instance.

### class `Tasks`

```python
class Tasks
```

The namespace that gives an instance of each built-in task.

Each access to an attribute builds a new task instance. The new instances are equal to each other, so a test such as `node.task in
supported_tasks` works.

> **Example**
> ```pycon
>>> from luxonis_train.tasks import Tasks
>>> task = Tasks.INSTANCE_KEYPOINTS
>>> task.name, task.main_output
('keypoints', 'keypoints')
>>> sorted(task.required_labels)
['boundingbox', 'keypoints']
>>> Tasks.FOMO.main_output
'heatmap'
>>> Tasks.BOUNDINGBOX == Tasks.BOUNDINGBOX
True
```

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`ANOMALY_DETECTION`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-ANOMALY_DETECTION) | `AnomalyDetection` |  |
| [`BOUNDINGBOX`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-BOUNDINGBOX) | `BoundingBox` |  |
| [`CLASSIFICATION`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-CLASSIFICATION) | `Classification` |  |
| [`EMBEDDINGS`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-EMBEDDINGS) | `Embeddings` |  |
| [`FOMO`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-FOMO) | `Fomo` |  |
| [`INSTANCE_KEYPOINTS`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-INSTANCE_KEYPOINTS) | `InstanceKeypoints` |  |
| [`INSTANCE_SEGMENTATION`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-INSTANCE_SEGMENTATION) | `InstanceSegmentation` |  |
| [`INSTANCE_SEGMENTATION_KEYPOINTS`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-INSTANCE_SEGMENTATION_KEYPOINTS) | `InstanceSegmentationKeypoints` |  |
| [`KEYPOINTS`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-KEYPOINTS) | `Keypoints` |  |
| [`OCR`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-OCR) | `Ocr` |  |
| [`SEGMENTATION`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/luxonis-train-api-reference/tasks.md#tasks-Classes-Tasks-SEGMENTATION) | `Segmentation` |  |

#### property `ANOMALY_DETECTION`

```python
ANOMALY_DETECTION: AnomalyDetection
```

#### property `BOUNDINGBOX`

```python
BOUNDINGBOX: BoundingBox
```

#### property `CLASSIFICATION`

```python
CLASSIFICATION: Classification
```

#### property `EMBEDDINGS`

```python
EMBEDDINGS: Embeddings
```

#### property `FOMO`

```python
FOMO: Fomo
```

#### property `INSTANCE_KEYPOINTS`

```python
INSTANCE_KEYPOINTS: InstanceKeypoints
```

#### property `INSTANCE_SEGMENTATION`

```python
INSTANCE_SEGMENTATION: InstanceSegmentation
```

#### property `INSTANCE_SEGMENTATION_KEYPOINTS`

```python
INSTANCE_SEGMENTATION_KEYPOINTS: InstanceSegmentationKeypoints
```

#### property `KEYPOINTS`

```python
KEYPOINTS: Keypoints
```

#### property `OCR`

```python
OCR: Ocr
```

#### property `SEGMENTATION`

```python
SEGMENTATION: Segmentation
```
