otx.api.entities.scored_label#

This module define the scored label entity.

Classes

LabelSource([user_id, model_id, ...])

This dataclass contains information about the source of a scored label.

ScoredLabel(label[, probability, label_source])

This represents a label along with a probability.

class otx.api.entities.scored_label.LabelSource(user_id: str = '', model_id: ID = ID(), model_storage_id: ID = ID())[source]#

Bases: object

This dataclass contains information about the source of a scored label.

For annotations, the id of the user who created the label and for predictions, the id and model storage id of the model that created the prediction. When a user has accepted a predictions as is, both the user id of the user who accepted and the model/model storage id of the model that predicted should be filled in.

class otx.api.entities.scored_label.ScoredLabel(label: LabelEntity, probability: float = 0.0, label_source: LabelSource | None = None)[source]#

Bases: object

This represents a label along with a probability. This is used inside Annotation class.

Parameters:
  • label (LabelEntity) – Label entity to which probability and source are attached.

  • probability (float) – a float denoting the probability of the shape belonging to the label.

  • label_source (LabelSource) – a LabelSource dataclass containing the id of the user who created or the model that predicted this label.

get_label() LabelEntity[source]#

Gets the label that the ScoredLabel object was initialized with.

property color: Color#

Color of the label.

property creation_date: datetime#

Creation data of the label.

property domain: Domain#

Domain of the label.

property hotkey: str#

Hotkey of the label.

property id: ID#

DEPRECATED.

property id_: ID#

Returns the label id.

property is_empty: bool#

Check if the label is empty.

property name: str#

Name of the label.