> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Orm.label row

## LabelRow Objects

```python theme={"dark"}
class LabelRow(base_orm.BaseORM)
```

A label row contains a data unit or a collection of data units and associated
labels, and is specific to a data asset with type `video` or `img_group`:

* A label row with a data asset of type video contains a single data unit.
* A label row with a data asset of type img\_group contains any number of data units.

The label row ORM is as follows:

* `label_hash` (uid) is the unique identifier of the label row
* `dataset_hash` (uid) is the unique identifier of the dataset which contains the
  particular video or image group
* `dataset_title` is the title of the dataset which contains the particular video
  or image group
* `data_title` is the title of the video or image group
* `data_type` either `video` or `img_group` depending on data type
* `data_units` a dictionary with (key: data hash, value: data unit) pairs.
* `object_answers` is a dictionary with (key: object hash, value: object answer)
  pairs.
* `classification_answers` is a dictionary with (key: classification hash, value:
  classification answer) pairs.
* `object_actions` is a dictionary with (key: `<object_hash>`, value: object
  action) pairs.
* `label_status` is a string indicating label status. It can take the values
  enumerated in [LabelStatus](/sdk-documentation/sdk-references/orm.label_row#labelstatus). *Note* that this does
  *not* reflect the status shown in the Projects->Labels section on the web-app.

A data unit, mentioned for the dictionary entry `data_units` above, has in the
form::

```
    label_row = {  # The label row
        # ...
        "data_units": {
            "<data_hash>": {
                "data_hash": "<data_hash>",  # A data_hash (uid) string
                "data_title": "A data title",
                "data_link": "<data_link>",  # Signed URL that expiring after 7 days
                "data_type": "<data_type>",  # (video/mp4, image/jpeg, etc.)
                "data_fps": 24.95,           # For video, the frame rate
                "data_sequence": "0",        # Defines order of data units
                "width": 640,                # The width of the content
                "height": 610,               # The height of the content
                "labels": {
                    # ...
                }
            },
            # ...,
        }
    }
```

A data unit can have any number of vector labels (e.g. bounding box, polygon, keypoint) and classifications.

**Objects and classifications**

A data unit can have any number of vector labels (e.g., bounding boxes, polygons,
polylines, keypoints) and classifications.
Each frame-level object and classification has unique identifiers 'objectHash' and
'classificationHash'. Each frame-level entity has a unique feature identifier
'featureHash', defined in the editor ontology.

The object and classification answers are contained separately from the individual
data units to preserve space for video, sequential images, DICOM, etc.

The objects and classifications answer dictionaries contain classification 'answers'
(i.e. attributes that describe the object or classification). This is to avoid
storing the information at every frame in the blurb, of particular importance for
videos.

A labels dictionary for video is in the form::

```
    label_row["data_units"]["<data_hash>"]["labels"] = {
        "<frame_number>": {
            "objects": [
                # { object 1 },
                # { object 2 },
                # ...
            ],
            "classifications": [
                # { classification 1 },
                # { classification 2 },
                # ...
            ],
        }
    }
```

A labels dictionary for an img\_group data unit is in the form::

```
    label_row["data_units"]["<data_hash>"]["labels"] = {
        "objects": [
            # { object 1 },
            # { object 2 },
            # ...
        ],
        "classifications": [
            # { classification 1 },
            # { classification 2 },
            # ...
        ],
    }
```

The object answers dictionary is in the form::

```
    label_row["object_answers"] = {
        "<object_hash>": {
            "objectHash": "<object_hash>",
            "classifications": [
                # {answer 1},
                # {answer 2},
                # ...
            ]
        },
        # ...
    }
```

The classification answers dictionary is in the form::

```
    label_row["classification_answers"] = {
        "<classification_hash>": {
            "classificationHash": "<classification_hash>",
            "classifications": [
                # {answer 1},
                # {answer 2},
                # ...
            ],
        },
        # ...
    }
```

The object actions dictionary is in the form::

```
    label_row["object_actions"] = {
        "<object_hash>": {
            "objectHash": "<object_hash>",
            "actions": [
                # {answer 1},
                # {answer 2},
                # ...
            ],
        },
        # ...
    }
```

## AnnotationTaskStatus Objects

```python theme={"dark"}
class AnnotationTaskStatus(Enum)
```

Status of an annotation task in a project workflow.

**Values:**

* **QUEUED:** The task has been created and is waiting to be assigned.
* **ASSIGNED:** The task has been assigned to an annotator but work has not
  necessarily started yet.
* **IN\_REVIEW:** The task has been completed by the annotator and is currently
  in review.
* **RETURNED:** The reviewer has returned the task to the annotator for changes.
* **COMPLETED:** The task has been completed and no further action is
  required.

## ShadowDataState Objects

```python theme={"dark"}
class ShadowDataState(Enum)
```

Specifies the kind of data to fetch when working with a BenchmarkQa project

#### ALL\_DATA

Fetch all the label rows

#### SHADOW\_DATA

Only fetch the label rows that were submitted against "shadow data": the annotator's view of the benchmark

#### NOT\_SHADOW\_DATA

Only fetch the label rows for "production" data

## LabelStatus Objects

```python theme={"dark"}
class LabelStatus(Enum)
```

#### MISSING\_LABEL\_STATUS

This value will be displayed if the Encord platform has a new label status and your SDK version does not understand
it yet. Please update your SDK to the latest version.

## WorkflowGraphNode Objects

```python theme={"dark"}
@dataclass(frozen=True)
class WorkflowGraphNode()
```

Lightweight representation of a workflow graph node.

**Arguments**:

* `uuid` - UUID of the workflow stage as a string.
* `title` - Human-readable title of the workflow stage.

## LabelRowMetadata Objects

```python theme={"dark"}
@dataclass(frozen=True)
class LabelRowMetadata(Formatter)
```

Contains helpful information about a label row.

#### label\_hash

Only present if the label row is initiated

#### created\_at

Only present if the label row is initiated

#### last\_edited\_at

Only present if the label row is initiated

#### branch\_name

Only present if the label row is initiated or branch\_name is set specifically

#### data\_hash

Only present if the label row is for a child element of a group

#### data\_link

Can be `None` for label rows of image groups or DICOM series.

#### label\_status

Can be `None` for TMS2 projects

#### annotation\_task\_status

Only available for TMS2 project

#### is\_shadow\_data

Only available for the VIDEO and AUDIO data\_type

#### duration

Only available for the VIDEO data\_type

#### width

Only available for the AUDIO data\_type

#### audio\_num\_channels

Information about spaces on this label row.

#### spaces

no labels information here, just the space information

#### priority

Only available for not complete tasks

#### file\_type

Only available for certain read requests

#### to\_dict

```python theme={"dark"}
def to_dict() -> Dict
```

**Returns**:

The dict equivalent of LabelRowMetadata.

## LabelRowMetadataWithClientMetadataSignedUrl Objects

```python theme={"dark"}
@dataclass(frozen=True)
class LabelRowMetadataWithClientMetadataSignedUrl(LabelRowMetadata)
```

`LabelRowMetadata` plus the signed URL the backend returns when `client_metadata_as_signed_url` is requested.

When that flag is set, the server delivers `client_metadata` as a signed URL pointing at the
bucket-stored blob (and leaves `client_metadata` itself empty) instead of in-lining it. This
subclass is an internal carrier for that one extra field: the SDK fetches the URL and in-lines
the result, so callers only ever see resolved `client_metadata`. It is never exposed on a
public return type.

## LabelValidationState Objects

```python theme={"dark"}
class LabelValidationState(BaseDTO)
```

Result of validating a label row.

**Arguments**:

* `label_hash` - Identifier of the label row that was validated.
* `branch_name` - Name of the branch on which the label row resides.
* `version` - Version number of the label row that was validated.
* `is_valid` - `True` if the label row is considered valid, otherwise
  `False`.
* `errors` - List of validation error messages, if any.

## WorkflowGraphNodeDTO Objects

```python theme={"dark"}
class WorkflowGraphNodeDTO(BaseDTO)
```

Data transfer object representing a workflow graph node.

**Arguments**:

* `uuid` - UUID of the workflow stage as a string.
* `title` - Human-readable title of the workflow stage.

## LabelRowMetadataDTO Objects

```python theme={"dark"}
class LabelRowMetadataDTO(BaseDTO)
```

Contains helpful information about a label row.

#### label\_hash

Only present if the label row is initiated

#### created\_at

Only present if the label row is initiated

#### last\_edited\_at

Only present if the label row is initiated

#### branch\_name

Only present if the label row is initiated or branch\_name is set specifically

#### data\_link

Can be `None` for label rows of image groups or DICOM series.

#### label\_status

Can be `None` for TMS2 projects

#### annotation\_task\_status

Only available for TMS2 project

#### is\_shadow\_data

Only available for the VIDEO and AUDIO data\_type

#### duration

Only available for the VIDEO data\_type

#### width

Only available for the AUDIO data\_type

#### priority

Only available for not complete tasks

#### file\_type

Only available for certain read requests

#### label\_row\_metadata\_dto\_to\_label\_row\_metadata

```python theme={"dark"}
def label_row_metadata_dto_to_label_row_metadata(
        label_row_metadata_dto: LabelRowMetadataDTO) -> LabelRowMetadata
```

Convert a [LabelRowMetadataDTO](/sdk-documentation/sdk-references/orm.label_row#labelrowmetadatadto) instance to a
[LabelRowMetadata](/sdk-documentation/sdk-references/orm.label_row#labelrowmetadata) dataclass.

This helper is useful when working with DTOs returned by the API
but you prefer the richer, formatter-enabled
[LabelRowMetadata](/sdk-documentation/sdk-references/orm.label_row#labelrowmetadata) representation in your application code.

**Arguments**:

* `label_row_metadata_dto` - Metadata DTO returned from the API.

**Returns**:

* `LabelRowMetadata` - Equivalent dataclass instance with the same fields populated.
