MeshTag

class MeshTag(meta, value=None, key=None, sly_id=None, labeler_login=None, updated_at=None, created_at=None, custom_data=None)[source]

Bases: PointcloudTag

Tag attached to a mesh annotation.

Tag on point cloud annotation.

Parameters:
meta

Tag metadata (name, value type).

value : str or int or float, optional

Tag value; type must match TagMeta.value_type.

key : uuid.UUID, optional

UUID key. Auto-generated if not provided.

sly_id : int, optional

Server-side tag ID.

labeler_login : str, optional

Login of user who created the tag.

updated_at : str, optional

Last modification timestamp (ISO format).

created_at : str, optional

Creation timestamp (ISO format).

Raises:

ValueError – If value is incompatible with TagMeta.value_type.

Usage Example:
import supervisely as sly

meta_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
tag_dog = sly.PointcloudTag(meta_dog)

meta_cat = sly.TagMeta('cat', sly.TagValueType.ANY_STRING)
tag_cat = sly.PointcloudTag(meta_cat, value="Fluffy")

Methods

clone

Return a copy of the tag with the given fields overridden.

from_json

Convert a json dict to VideoTag.

get_compact_str

Get string with information about PointcloudTag name and value.

get_header_ptable

Get header of the table with tags.

get_row_ptable

Get row with tag properties.

key

Get PointcloudTag key value.

to_json

Convert the PointcloudTag to a json dict.

Attributes

custom_data

Arbitrary user JSON attached to this tag assignment, independent of the tag definition and of the tag value.

meta

General information about Tag.

name

Name property.

value

Tag value.

classmethod from_json(data, tag_meta_collection, key_id_map=None)

Convert a json dict to VideoTag. Read more about Supervisely format.

Parameters:
data : dict

PointcloudTag in json format as a dict.

tag_meta_collection

Tag metadata collection.

key_id_map=None

Key ID map.

Returns:

Pointcloud tag.

Return type:

PointcloudTag

Usage Example:
import supervisely as sly

tag_cat_json = {"name": "cat", "value": "Fluffy"}
meta_cat = sly.TagMeta('cat', sly.TagValueType.ANY_STRING)
meta_collection = sly.TagMetaCollection([meta_cat])
tag_cat = sly.PointcloudTag.from_json(tag_cat_json, meta_collection)
classmethod get_header_ptable()

Get header of the table with tags.

Returns:

List of table header values.

Return type:

List[str]

Usage Example:
import supervisely as sly

header = sly.Tag.get_header_ptable()

print(header)
# Output: ['Name', 'Value type', 'Value']
clone(meta=None, value=None, key=None, sly_id=None, labeler_login=None, updated_at=None, created_at=None)[source]

Return a copy of the tag with the given fields overridden.

Any argument left as None keeps the current value of the tag.

Parameters:
meta=None

New tag meta.

value : Optional[Union[str, int, float]]

New tag value.

key : Optional[uuid.UUID]

New unique identifier.

sly_id : Optional[int]

New tag ID in Supervisely.

labeler_login : Optional[str]

New labeler login.

updated_at : Optional[str]

New update timestamp.

created_at : Optional[str]

New creation timestamp.

Returns:

New mesh tag with the overridden fields.

Return type:

MeshTag

get_compact_str()

Get string with information about PointcloudTag name and value.

Returns:

Information about PointcloudTag object

Return type:

str

Usage Example:
import supervisely as sly
meta_cat = sly.TagMeta('cat', sly.TagValueType.ANY_STRING)
tag_cat = sly.PointcloudTag(meta_cat, value="Fluffy")
compact_tag_cat = tag_cat.get_compact_str()

print(compact_tag_cat) # cat:Fluffy
get_row_ptable()

Get row with tag properties.

Returns:

List of tag properties.

Return type:

List[str]

Usage Example:
import supervisely as sly

weather_conditions = ["Sunny", "Cloudy", "Snowy", "Foggy", "Rainy"]
meta_weather = sly.TagMeta("weather", sly.TagValueType.ONEOF_STRING, possible_values=weather_conditions)
tag_weather = sly.Tag(meta_weather, value="Sunny")

row = tag_weather.get_row_ptable()

print(row)
# Output: ['weather', 'oneof_string', 'Sunny']
key()

Get PointcloudTag key value.

Returns:

PointcloudTag key value

Return type:

uuid.UUID

Usage Example:
import supervisely as sly

weather_conditions = ["Sunny", "Cloudy", "Snowy", "Foggy", "Rainy"]
meta_weather = sly.TagMeta("weather", sly.TagValueType.ONEOF_STRING, possible_values=weather_conditions)
tag_weather = sly.Tag(meta_weather, value="Sunny")
key = tag_weather.key()

print(key)
# Output: 5c7988e0-eee4-4eb1-972c-b1e3e879f78c
to_json(key_id_map=None)

Convert the PointcloudTag to a json dict. Read more about Supervisely format.

Parameters:
key_id_map=None

Key ID map.

Returns:

Json format as a dict

Return type:

dict

Usage Example:
import supervisely as sly
meta_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
tag_dog = sly.PointcloudTag(meta_dog)
tag_dog_json = tag_dog.to_json()

print(tag_dog_json)
# Output: {
#     "name": "dog",
#     "key": "058ad7993a534082b4d94cc52542a97d"
# }
property custom_data : dict

Arbitrary user JSON attached to this tag assignment, independent of the tag definition and of the tag value. Empty dict when the assignment carries none.

Returns:

Custom data of the Tag

Return type:

dict

Usage Example:
import supervisely as sly

meta_dog = sly.TagMeta('dog', sly.TagValueType.ANY_STRING)
tag_dog = sly.Tag(meta_dog, value="Husky", custom_data={"confidence": 0.92})

print(tag_dog.custom_data)
# Output: {'confidence': 0.92}
property meta : supervisely.annotation.tag_meta.TagMeta

General information about Tag. When creating a new Tag, it’s value is automatically cross-checked against TagValueType to make sure that value is valid.

Returns:

TagMeta object

Return type:

TagMeta

Usage Example:
meta_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
tag_dog = sly.Tag(meta_dog)

# Our TagMeta has value type 'NONE', if we try to add value to our Tag, "ValueError" error will be raised
tag_dog = sly.Tag(meta_dog, value="Husky")
# Output: ValueError: Tag dog can not have value Husky
property name : str

Name property.

Returns:

Name

Return type:

str

Usage Example:
meta_dog = sly.TagMeta('dog', sly.TagValueType.ANY_STRING)
tag_dog = sly.Tag(meta_dog, value="Husky")

print(tag_dog.name)
# Output: "dog"
property value : str

Tag value. Return type depends on TagValueType. Date tag values are returned as ISO datetime strings.

Returns:

Tag value

Return type:

str, int or float or None

Usage Example:
meta_dog = sly.TagMeta('dog', sly.TagValueType.ANY_STRING)
tag_dog = sly.Tag(meta_dog, value="Husky")

meta_age = sly.TagMeta('age', sly.TagValueType.ANY_NUMBER)
tag_age = sly.Tag(meta_age, value=9)

colors = ["Black", "White", "Golden", "Brown"]
meta_color = sly.TagMeta('coat color', sly.TagValueType.ONEOF_STRING, possible_values=colors)
tag_color = sly.Tag(meta_color, value="White")

meta_date = sly.TagMeta('reviewed_at', sly.TagValueType.DATE)
tag_date = sly.Tag(meta_date, value="2026-04-23T15:15:48")

type(tag_dog.value)   # 'str'
type(tag_age.value)   # 'int'
type(tag_color.value) # 'str'
type(tag_date.value)  # 'str'