MeshLabel¶
-
class MeshLabel(geometry, obj_class, tags=
None, description='', key=None, sly_id=None, class_id=None, labeler_login=None, updated_at=None, created_at=None, custom_data=None, priority=None, status=None)[source]¶ Bases:
objectSingle geometry-backed label in a mesh annotation.
Initialize a single geometry-backed annotation object.
- Parameters:
- geometry¶
Geometry of the label.
- obj_class¶
Object class the label belongs to.
Tags attached to the label.
- description : Optional[str]¶
Free-text description of the label.
- key : Optional[uuid.UUID]¶
Unique identifier of the label. Generated automatically if not provided.
- sly_id : Optional[int]¶
Label ID in Supervisely.
- class_id : Optional[int]¶
Object class ID in Supervisely.
- labeler_login : Optional[str]¶
Login of the user who created the label.
- updated_at : Optional[str]¶
Timestamp of the last update.
- created_at : Optional[str]¶
Timestamp of creation.
- custom_data : Optional[dict]¶
Arbitrary user data attached to the label.
- priority : Optional[int]¶
Drawing/processing priority of the label.
- status=
None¶ Labeling status (defaults to
LabelingStatus.MANUAL).
- Raises:
TypeError – If the geometry type does not match the object class geometry type.
Methods
Return a copy of the label with the given fields overridden.
Deserialize a mesh label from a JSON dict.
Return the unique identifier of the label.
Serialize the label to a JSON-serializable dict.
Attributes
Object class ID in Supervisely.
Arbitrary user data attached to the label (returned as a deep copy).
Free-text description of the label.
Geometry of the label.
Object class the label belongs to.
Drawing/processing priority of the label.
Label ID in Supervisely.
Labeling status of the label.
Tags attached to the label (returned as a copy).
- classmethod from_json(data, project_meta)[source]¶
Deserialize a mesh label from a JSON dict.
- Parameters:
- Returns:
Deserialized mesh label.
- Return type:
- Raises:
RuntimeError – If the object class is missing from the project meta or geometry is absent.
-
clone(geometry=
None, obj_class=None, tags=None, description=None, key=None, sly_id=None, class_id=None, labeler_login=None, updated_at=None, created_at=None, custom_data=None, priority=None, status=None)[source]¶ Return a copy of the label with the given fields overridden.
Any argument left as
Nonekeeps the current value of the label.- Parameters:
- geometry=
None¶ New geometry.
- obj_class=
None¶ New object class.
New tags.
- description : Optional[str]¶
New description.
- key : Optional[uuid.UUID]¶
New unique identifier.
- sly_id : Optional[int]¶
New label ID in Supervisely.
- class_id : Optional[int]¶
New object class ID in Supervisely.
- labeler_login : Optional[str]¶
New labeler login.
- updated_at : Optional[str]¶
New update timestamp.
- created_at : Optional[str]¶
New creation timestamp.
- custom_data : Optional[dict]¶
New custom data.
- priority : Optional[int]¶
New priority.
- status=
None¶ New labeling status.
- geometry=
- Returns:
New mesh label with the overridden fields.
- Return type:
- to_json()[source]¶
Serialize the label to a JSON-serializable dict.
- Returns:
Dict with key, object class name, description, tags, geometry and metadata.
- Return type:
- property custom_data : dict¶
Arbitrary user data attached to the label (returned as a deep copy).
- Return type:
- property geometry : supervisely.geometry.geometry.Geometry¶
Geometry of the label.
- Return type:
- property obj_class : supervisely.annotation.obj_class.ObjClass¶
Object class the label belongs to.
- Return type:
- property priority : int | None¶
Drawing/processing priority of the label.
- Return type:
Optional[int]
- property status : supervisely.annotation.label.LabelingStatus¶
Labeling status of the label.
- Return type:
LabelingStatus
- property tags : supervisely.mesh_annotation.mesh_tag_collection.MeshTagCollection¶
Tags attached to the label (returned as a copy).
- Return type: