MeshAnnotation¶
-
class MeshAnnotation(labels=
None, tags=None, description='', key=None)[source]¶ Bases:
objectAnnotation for a single mesh entity.
Initialize a mesh annotation as a flat list of labels and entity tags.
- Parameters:
Methods
Return a copy of the annotation with the given fields overridden.
Deserialize a mesh annotation from a JSON dict.
Return the unique identifier of the annotation.
Load and deserialize a mesh annotation from a JSON file.
Serialize the annotation to a JSON-serializable dict.
Attributes
Free-text description of the annotation.
Mesh labels of the annotation (returned as a shallow copy of the list).
Entity-level tags attached to the mesh (returned as a copy).
- classmethod from_json(data, project_meta)[source]¶
Deserialize a mesh annotation from a JSON dict.
- Parameters:
- Returns:
Deserialized mesh annotation.
- Return type:
- Raises:
RuntimeError – If the JSON uses the unsupported legacy
objects/figuresschema.
- classmethod load_json_file(path, project_meta)[source]¶
Load and deserialize a mesh annotation from a JSON file.
- Parameters:
- Returns:
Deserialized mesh annotation.
- Return type:
-
clone(labels=
None, tags=None, description=None)[source]¶ Return a copy of the annotation with the given fields overridden.
- Parameters:
- Returns:
New mesh annotation with the same key and the overridden fields.
- Return type:
- key()[source]¶
Return the unique identifier of the annotation.
- Returns:
Annotation key.
- Return type:
- to_json()[source]¶
Serialize the annotation to a JSON-serializable dict.
- Returns:
Dict with description, key, tags and labels of the annotation.
- Return type:
- property labels : list[supervisely.mesh_annotation.mesh_label.MeshLabel]¶
Mesh labels of the annotation (returned as a shallow copy of the list).
- Return type:
List[
MeshLabel]
- property tags : supervisely.mesh_annotation.mesh_tag_collection.MeshTagCollection¶
Entity-level tags attached to the mesh (returned as a copy).
- Return type: