PointcloudTag

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

Bases: Tag

Tag on point cloud annotation (meta, value). Immutable.

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

Clone makes a copy of pointcloud tag with new fields, if fields are given, otherwise it will use original tag fields.

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

meta

General information about Tag.

name

Name property.

value

Tag value.

classmethod from_json(data, tag_meta_collection, key_id_map=None)[source]

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]

Clone makes a copy of pointcloud tag with new fields, if fields are given, otherwise it will use original tag fields.

Parameters:
meta=None

General information about pointcloud tag.

value : str or int or float or None, optional

Pointcloud tag value. Depends on TagValueType of TagMeta.

key : uuid.UUID, optional

uuid.UUID object.

sly_id : int, optional

Pointcloud tag ID in Supervisely.

labeler_login : str, optional

Login of user who created pointcloud tag.

updated_at : str, optional

Date and Time when Pointcloud Tag was modified last. Date Format: Year:Month:Day:Hour:Minute:Seconds. Example: ‘2021-01-22T19:37:50.158Z’.

created_at : str, optional

Date and Time when Pointcloud Tag was created. Date Format is the same as in “updated_at” parameter.

Returns:

New instance of pointcloud tag.

Return type:

PointcloudTag

Raises:

ValueError – If pointcloud tag value is incompatible to TagMeta value type.

Usage Example:
import supervisely as sly

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

tag_weather = sly.PointcloudTag(meta_weather, value="Sunny")

# Let's create some more tags by cloning our original Pointcloud Tag
# Remember that PointcloudTag class object is immutable, and we need to assign new instance of PointcloudTag to a new variable
clone_weather_1 = tag_weather.clone(value="Snowy")
clone_weather_2 = tag_weather.clone(value="Cloudy")
clone_weather_3 = tag_weather.clone(value="Rainy")
get_compact_str()[source]

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()[source]

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)[source]

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 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'