Label Version

Label version history.

Labelbox records a version of a label at each hand-off: when the label is submitted or saved from the editor, approved or rejected in a review step, submitted from a rework step, or moved into a rework step. Each version holds who made the hand-off, when, in which workflow step, and the label’s annotations at that moment. Autosaves and drafts record no versions, and versions are never changed or deleted.

The methods on labelbox.Client, labelbox.schema.project.Project and labelbox.schema.label.Label that return the classes below are thin wrappers over the functions at the bottom of this module.

class labelbox.schema.label_version.LabelVersion(*, id: str, labelId: str, dataRowId: str, projectId: str, action: LabelVersionAction | str, createdAt: datetime, createdById: str, stage: LabelVersionStage | None = None, annotationCount: int, label: str | None = None, labelJson: Dict[str, Any] | None = None)[source]

Bases: _CamelCaseMixin

One recorded version of a label.

id

The version’s ID. It never changes.

Type:

str

label_id
Type:

str

data_row_id
Type:

str

project_id
Type:

str

action

The hand-off (see LabelVersionAction). Unknown values are kept as strings.

Type:

str

created_at

When the version was recorded.

Type:

datetime

created_by_id

The user who made the hand-off: the labeler for a submit, the reviewer for a review save or decision.

Type:

str

stage

The workflow step the data row was in at the hand-off. None when it was in none (Done). For SENT_TO_REWORK this is the step the row was moved out of, so None means it was moved from Done; the rework step it entered is not recorded.

Type:

Optional[LabelVersionStage]

annotation_count

Number of annotations in the version, counted as the editor and exports count them: each object and each classification at the top of the label. A classification’s answers and an object’s nested classifications are part of it, and the segmentation group that holds masks is not counted.

Type:

int

label

The annotations at that moment, as stringified JSON in the same shape as labelbox.schema.label.Label.label. Feature schema names are the ones in effect then. None when read with include_annotations=False.

Type:

Optional[str]

label_json

label parsed.

Type:

Optional[dict]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'action': FieldInfo(annotation=Union[LabelVersionAction, str], required=True, alias='action', alias_priority=1), 'annotation_count': FieldInfo(annotation=int, required=True, alias='annotationCount', alias_priority=1), 'created_at': FieldInfo(annotation=datetime, required=True, alias='createdAt', alias_priority=1), 'created_by_id': FieldInfo(annotation=str, required=True, alias='createdById', alias_priority=1), 'data_row_id': FieldInfo(annotation=str, required=True, alias='dataRowId', alias_priority=1), 'id': FieldInfo(annotation=str, required=True, alias='id', alias_priority=1), 'label': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='label', alias_priority=1), 'label_id': FieldInfo(annotation=str, required=True, alias='labelId', alias_priority=1), 'label_json': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=False, default=None, alias='labelJson', alias_priority=1), 'project_id': FieldInfo(annotation=str, required=True, alias='projectId', alias_priority=1), 'stage': FieldInfo(annotation=Union[LabelVersionStage, NoneType], required=False, default=None, alias='stage', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.label_version.LabelVersionAction(value)[source]

Bases: str, Enum

The hand-off a label version records.

APPROVED = 'APPROVED'

A reviewer approved the label in a review step.

REJECTED = 'REJECTED'

A reviewer rejected the label in a review step.

REWORK_SUBMITTED = 'REWORK_SUBMITTED'

The data row was submitted from a rework step.

SAVED = 'SAVED'

a reviewer’s edit in a review step, a labeler’s edit in a rework step, or a later save.

Type:

An existing label was saved from the editor

SENT_TO_REWORK = 'SENT_TO_REWORK'

The data row was moved into a rework step by hand. stage is the step it was moved out of.

SUBMITTED = 'SUBMITTED'

a labeler’s submit.

Type:

The label was created from the editor

class labelbox.schema.label_version.LabelVersionStage(*, taskQueueId: str, name: str | None = None, type: str | None = None)[source]

Bases: _CamelCaseMixin

The workflow step the data row was in at the hand-off, as it was then.

task_queue_id

The step’s task queue ID.

Type:

str

name

The step’s name when the version was recorded.

Type:

Optional[str]

type

The step’s type, for example "MANUAL_REVIEW_QUEUE" or "MANUAL_REWORK_QUEUE".

Type:

Optional[str]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='name', alias_priority=1), 'task_queue_id': FieldInfo(annotation=str, required=True, alias='taskQueueId', alias_priority=1), 'type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='type', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.