PointcloudEpisodeTagCollection

class PointcloudEpisodeTagCollection(items=None)[source]

Bases: PointcloudTagCollection

Collection with PointcloudEpisodeTag instances. PointcloudEpisodeTagCollection object is immutable.

Usage Example:
import supervisely as sly

# Create TagMetas (see class TagMeta for additional information about creating TagMetas)
colors = ["brown", "white", "black", "red", "chocolate", "gold", "grey"]
meta_car_color = sly.TagMeta('car color', sly.TagValueType.ONEOF_STRING, possible_values=colors)

# Create tags
tag_car_color_white = sly.PointcloudEpisodeTag(meta_car_color, value="white", frame_range=(15, 20))
tag_car_color_red = sly.PointcloudEpisodeTag(meta_car_color, value="red", frame_range=(11, 22))
tags_arr = [tag_car_color_white, tag_car_color_red]

# Create PointcloudEpisodeTagCollection from point cloud episodes Tags
tags = sly.PointcloudEpisodeTagCollection(tags_arr)

# Add item to PointcloudEpisodeTagCollection
meta_bus = sly.TagMeta('bus', sly.TagValueType.NONE)
tag_bus = sly.PointcloudEpisodeTag(meta_bus, frame_range=(11, 14))

# Remember that PointcloudEpisodeTagCollection is immutable, and we need to assign new instance of PointcloudEpisodeTagCollection to a new variable
tags = tags.add(tag_bus)

# You can also add multiple items to collection
meta_truck = sly.TagMeta('truck', sly.TagValueType.NONE)
meta_moto = sly.TagMeta('moto', sly.TagValueType.NONE)

tag_truck = sly.PointcloudEpisodeTag(meta_truck, frame_range=(6, 10))
tag_moto = sly.PointcloudEpisodeTag(meta_moto, frame_range=(11, 15))

additional_tags = [tag_truck, tag_moto]

tags = tags.add_items(additional_tags)

# Has key, checks if given key exist in collection
tags.has_key(meta_moto.key())
# Output: True

# Find intersection of given list of instances with collection items
meta_bus = sly.TagMeta('bus', sly.TagValueType.NONE)
tag_bus = sly.PointcloudEpisodeTag(meta_bus, frame_range=(0, 5))

meta_truck = sly.TagMeta('truck', sly.TagValueType.NONE, frame_range=(6, 11))
tag_truck = sly.PointcloudEpisodeTag(meta_truck)

tags_vehicles = sly.PointcloudEpisodeTagCollection([tag_bus, tag_truck])

tags_intersections = tags.intersection(tags_vehicles)
print(tags_intersections.to_json())
# Output: []

# Let's add the moto Tag from another collection and compare them again
tags_vehicles = tags_vehicles.add(tag_moto)

tags_intersections = tags.intersection(tags_vehicles)
print(tags_intersections.to_json())
# Output: [
#     {
#         "name": "moto",
#         "frameRange": [11, 15],
#         "key": "3f37e10a658e440db3ab9f5c0be7fb67"
#     }
# ]

# Find difference between collection and given list of Tags or PointcloudEpisodeTagCollection
meta_car = sly.TagMeta('car', sly.TagValueType.NONE)
tag_car = sly.PointcloudEpisodeTag(meta_car, frame_range=(6, 11))

meta_bicycle = sly.TagMeta('bicycle', sly.TagValueType.NONE)
tag_bicycle = sly.PointcloudEpisodeTag(meta_bicycle, frame_range=(6, 11))

tags_vehicles = sly.PointcloudEpisodeTagCollection([tag_car, tag_bicycle])

meta_pedestrian = sly.TagMeta('pedestrian', sly.TagValueType.NONE)
tag_pedestrian = sly.PointcloudEpisodeTag(meta_pedestrian, frame_range=(14, 20))

meta_road = sly.TagMeta('road', sly.TagValueType.NONE)
tag_road = sly.PointcloudEpisodeTag(meta_road, frame_range=(13, 22))

difference = tags_vehicles.difference([tag_pedestrian, tag_road])
print(difference.to_json())
# Output: [
#     {
#         "name": "car",
#         "frameRange": [6, 11],
#         "key": "eba949cb996e44ac8aebec72a0875b13"
#     },
#     {
#         "name": "bicycle",
#         "frameRange": [6, 11],
#         "key": "f9f03baec21e428ba04525d8df003e22"
#     }
# ]

# Merge collection and given list of collections
tags_vehicles = sly.PointcloudEpisodeTagCollection([tag_car, tag_bicycle])
tags_merge = sly.PointcloudEpisodeTagCollection([tag_pedestrian, tag_road])

merged_collections = tags_vehicles.merge(tags_merge)
print(merged_collections.to_json())
# Output: [
#     {
#         "frameRange": [6, 11],
#         "key": "a6527453a3d34e68865bc0ad4b66f673",
#         "name": "car"
#     },
#     {
#         "frameRange": [6, 11],
#         "key": "e9a9a306fd9c4ea180d1edf2a6fb1cf0",
#         "name": "bicycle"
#     },
#     {
#         "frameRange": [14, 20],
#         "key": "8480532ff4db4600839ab403b1d0ab85",
#         "name": "pedestrian"
#     },
#     {
#         "frameRange": [13, 22],
#         "key": "828f58c0c5174dbba40f7374dcc8016a",
#         "name": "road"
#     }
# ]
Parameters:
items : list, optional

List of Tag instances.

:raises DuplicateKeyError: if instance with given name already exist

Usage Example:
import supervisely as sly

# Create TagMetas (see class TagMeta for additional information about creating TagMetas)
meta_weather = sly.TagMeta('Weather', sly.TagValueType.ANY_STRING)

seasons = ["Winter", "Spring", "Summer", "Autumn"]
meta_season = sly.TagMeta('Season', sly.TagValueType.ONEOF_STRING, possible_values=seasons)

# Create Tags
tag_weather = sly.Tag(meta_weather, value="Sunny")
tag_season = sly.Tag(meta_season, value="Spring")
tags_arr = [tag_weather, tag_season]

# Create TagCollection from Tags
tags = sly.TagCollection(tags_arr)

# Add item to TagCollection
meta_potato = sly.TagMeta('potato', sly.TagValueType.NONE)
tag_potato =sly.Tag(meta_potato)

# Remember that TagCollection is immutable, and we need to assign new instance of TagCollection to a new variable
tags = tags.add(tag_potato)

# You can also add multiple items to collection
meta_cabbage = sly.TagMeta('cabbage', sly.TagValueType.NONE)
meta_carrot = sly.TagMeta('carrot', sly.TagValueType.NONE)
meta_turnip = sly.TagMeta('turnip', sly.TagValueType.NONE)

tag_cabbage = sly.Tag(meta_cabbage)
tag_carrot = sly.Tag(meta_carrot)
tag_turnip = sly.Tag(meta_turnip)

additional_veggies = [tag_cabbage, tag_carrot, tag_turnip]

tags = tags.add_items(additional_veggies)

# Has key, checks if given key exist in collection
tags.has_key("cabbage")
# Output: True

# Find intersection of given list of instances with collection items
meta_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
tag_dog = sly.Tag(meta_dog)

meta_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
tag_cat = sly.Tag(meta_cat)

meta_turtle = sly.TagMeta('turtle', sly.TagValueType.NONE)
tag_turtle = sly.Tag(meta_turtle)


tags_animals = sly.TagCollection([tag_dog, tag_cat, tag_turtle])

tags_intersections = tags.intersection(tags_animals)
print(tags_intersections.to_json())
# Output: []

# Let's add the potato Tag from another collection and compare them again
tags_animals = tags_animals.add(tag_potato)

tags_intersections = tags.intersection(tags_animals)
print(tags_intersections.to_json())
# Output: [
#     {
#         "name":"potato"
#     }
# ]

# Find difference between collection and given list of Tags or TagCollection
meta_car = sly.TagMeta('car', sly.TagValueType.NONE)
tag_car = sly.Tag(meta_car)

meta_bicycle = sly.TagMeta('bicycle', sly.TagValueType.NONE)
tag_bicycle = sly.Tag(meta_bicycle)

tags_vehicles = sly.TagCollection([tag_car, tag_bicycle])

meta_pedestrian = sly.TagMeta('pedestrian', sly.TagValueType.NONE)
tag_pedestrian = sly.Tag(meta_pedestrian)

meta_road = sly.TagMeta('road', sly.TagValueType.NONE)
tag_road = sly.Tag(meta_road)

difference = tags_vehicles.difference([tag_pedestrian, tag_road])
print(difference.to_json())
# Output: [
#     {
#         "name":"car"
#     },
#     {
#         "name":"bicycle"
#     }
# ]

# Merge collection and given list of TagMetas
tags_vehicles = sly.TagMetaCollection([tag_car, tag_bicycle])
tags_merge = sly.TagMetaCollection([tag_pedestrian, tag_road])

merged_collections = tags_vehicles.merge(tags_merge)
print(merged_collections.to_json())
# Output: [
#     {
#         "name":"pedestrian"
#     },
#     {
#         "name":"road"
#     },
#     {
#         "name":"car"
#     },
#     {
#         "name":"bicycle"
#     }
# ]

Methods

add

Add given item to collection.

add_items

Add items from given list to collection.

clone

Makes a copy of KeyIndexedCollection with new fields, if fields are given, otherwise it will use fields of the original KeyIndexedCollection.

difference

Find difference between collection and given list of instances.

from_api_response

Create a PointcloudEpisodeTagCollection object from API response data.

from_json

Convert a list with dicts in json format to PointcloudEpisodeTagCollection.

get

Get item from collection with given key(name).

get_all

Get item from collection with given key(name).

has_key

Check if given key(item name exist in collection).

intersection

Find intersection of given list of instances with collection items.

items

Get list of all items in collection.

keys

Get list of all keys(item names) in collection.

merge

Merge collection with other MultiKeyIndexedCollection object.

merge_without_duplicates

Merge collection with other MultiKeyIndexedCollection object.

remove_items

Remove items from collection by given list of keys.

to_json

Convert the PointcloudTagCollection to a list of json dicts.

item_type

alias of PointcloudEpisodeTag

classmethod from_api_response(data, tag_meta_collection, id_to_tagmeta=None)[source]

Create a PointcloudEpisodeTagCollection object from API response data.

Parameters:
data : List[Dict]

API response data.

tag_meta_collection

Tag metadata collection.

id_to_tagmeta=None

Mapping of tag IDs to tag metadata.

Returns:

Pointcloud episode tags collection.

Return type:

PointcloudEpisodeTagCollection

Usage Example:
import os
from dotenv import load_dotenv

import supervisely as sly

# Load secrets and create API object from .env file (recommended)
# Learn more here: https://developer.supervisely.com/getting-started/basics-of-authentication
if sly.is_development():
    load_dotenv(os.path.expanduser("~/supervisely.env"))

api = sly.Api.from_env()

project_id = 18428
pcd_id = 19481209
project_meta_json = api.project.get_meta(project_id)
project_meta = sly.ProjectMeta.from_json(project_meta_json)
pcd_info = api.pointcloud_episode.get_info_by_id(pcd_id)

tag_collection = sly.PointcloudEpisodeTagCollection.from_api_response(
    pcd_info.tags, project_meta.tag_metas
)
print(tag_collection)

# Output:
# Tags:
# +-------+--------------+-------+
# |  Name |  Value type  | Value |
# +-------+--------------+-------+
# | color | oneof_string |  red  |
# |  car  |     none     |  None |
# +-------+--------------+-------+
classmethod from_json(data, tag_meta_collection, key_id_map=None)[source]

Convert a list with dicts in json format to PointcloudEpisodeTagCollection. Read more about Supervisely format.

Parameters:
data

List with dicts in json format.

tag_meta_collection

Tag metadata collection.

key_id_map=None

Key ID map.

Returns:

Pointcloud episode tags collection.

Return type:

PointcloudEpisodeTagCollection

Usage Example:
import supervisely as sly

# Initialize TagMetaCollection
meta_weather = sly.TagMeta('Weather', sly.TagValueType.ANY_STRING)

seasons = ["Winter", "Spring", "Summer", "Autumn"]
meta_season = sly.TagMeta('Season', sly.TagValueType.ONEOF_STRING, possible_values=seasons)

metas_arr = [meta_weather, meta_season]
tag_metas = sly.TagMetaCollection(metas_arr)

data = [
    {"name":"Weather", "value":"Sunny"},
    {"name":"Season", "value":"Spring"}
]

tags = sly.PointcloudEpisodeTagCollection.from_json(data, tag_metas)
add(item)

Add given item to collection.

Parameters:
item

ObjClassCollection, TagMetaCollection or TagCollection object.

Returns:

New instance of KeyIndexedCollection

Return type:

KeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
collection = sly.collection.key_indexed_collection.KeyIndexedCollection([item_cat, item_turtle])

# Remember that KeyIndexedCollection object is immutable, and we need to assign new instance of KeyIndexedCollection to a new variable
item_dog = sly.ObjClass('dog', sly.Rectangle)
new_collection = collection.add(item_dog)
add_items(items)

Add items from given list to collection.

Parameters:
items

List of ObjClassCollection, TagMetaCollection or TagCollection objects.

Returns:

New instance of KeyIndexedCollection

Return type:

KeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
collection = sly.collection.key_indexed_collection.KeyIndexedCollection([item_cat, item_turtle])

# Remember that KeyIndexedCollection object is immutable, and we need to assign new instance of KeyIndexedCollection to a new variable
item_dog = sly.ObjClass('dog', sly.Rectangle)
item_mouse = sly.ObjClass('mouse', sly.Bitmap)
new_collection = collection.add_items([item_dog, item_mouse])
clone(items=None)

Makes a copy of KeyIndexedCollection with new fields, if fields are given, otherwise it will use fields of the original KeyIndexedCollection.

Parameters:
items=None

List of ObjClassCollection, TagMetaCollection or TagCollection objects.

Returns:

New instance of KeyIndexedCollection

Return type:

KeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
collection = sly.collection.key_indexed_collection.KeyIndexedCollection([item_cat, item_turtle])

# Remember that KeyIndexedCollection object is immutable, and we need to assign new instance of KeyIndexedCollection to a new variable
new_collection = collection.clone()
difference(other)

Find difference between collection and given list of instances.

Parameters:
other

List of items to subtract from the collection.

Returns:

KeyIndexedCollection object

Return type:

KeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
collection = sly.collection.key_indexed_collection.KeyIndexedCollection([item_cat, item_turtle])

item_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
items = [item_dog, item_turtle]

diff = collection.difference(items)
print(diff.to_json())
# Output: [
#     {
#         "name": "cat",
#         "value_type": "none",
#         "color": "#8A150F",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     }
# ]
get(key, default=None)

Get item from collection with given key(name). If there are many values for the same key, the first value will be returned.

Parameters:
items : str

Name of KeyObject in collection.

default : optional

The value that is returned if there is no key in the collection.

Returns:

ObjClassCollection, TagMetaCollection or TagCollection object

Return type:

KeyObject

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_cat = sly.ObjClass('cat', sly.Rectangle)
collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_cat, item_turtle, other_cat])
item = collection.get('cat')
print(item)
# Output:
# Name:  cat                      Value type:none          Possible values:None       Hotkey                  Applicable toall        Applicable classes[]
get_all(key, default=[])

Get item from collection with given key(name). If there are many values for the same key,all values will be returned by list.

Parameters:
items : str

Name of KeyObject in collection.

default : List, optional

The value that is returned if there is no key in the collection.

Returns:

List of ObjClassCollection, TagMetaCollection or TagCollection objects or empty list

Return type:

List[KeyObject] or list

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_cat = sly.ObjClass('cat', sly.Rectangle)
collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_cat, item_turtle, other_cat])
items = collection.get('cat')
print(items)
# Output:
# [<supervisely.annotation.tag_meta.TagMeta object at 0x7f0278662340>, <supervisely.annotation.obj_class.ObjClass object at 0x7f02786623a0>]
has_key(key)

Check if given key(item name exist in collection).

Parameters:
key : str

The key to look for in the collection.

Returns:

Is the key in the collection or not

Return type:

bool

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
collection = sly.collection.key_indexed_collection.KeyIndexedCollection([item_cat, item_turtle])

collection.has_key('cat') # True
collection.has_key('hamster') # False
intersection(other)

Find intersection of given list of instances with collection items.

Parameters:
other

List of items to intersect with the collection.

Raises:

ValueError – if find items with same keys(item names)

Returns:

MultiKeyIndexedCollection object

Return type:

MultiKeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_cat = sly.ObjClass('cat', sly.Rectangle)
collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_cat, item_turtle, other_cat])

# Note, item_cat_2 have same key as item_cat, but another value
item_cat_2 = sly.TagMeta('cat', sly.TagValueType.ANY_STRING)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
items = [item_cat_2, item_turtle]

intersect = collection.intersection(items)
print(intersect.to_json())
# Output: [
#     {
#         "name": "turtle",
#         "value_type": "any_string",
#         "color": "#5B8A0F",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     }
# ]
items()

Get list of all items in collection.

Returns:

List of ObjClassCollection, TagMetaCollection or TagCollection objects

Return type:

List[KeyObject]

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_cat = sly.ObjClass('cat', sly.Rectangle)
collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_cat, item_turtle, other_cat])
print(collection.items())
# Output:
# [<supervisely.annotation.tag_meta.TagMeta object at 0x7fdbd28ce340>,
#  <supervisely.annotation.obj_class.ObjClass object at 0x7fdbd28ce3a0>,
#  <supervisely.annotation.tag_meta.TagMeta object at 0x7fdbd28ce370>]
keys()

Get list of all keys(item names) in collection.

Returns:

List of collection keys

Return type:

List[str]

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
collection = sly.collection.key_indexed_collection.KeyIndexedCollection([item_cat, item_turtle])
keys = collection.keys() # ['cat', 'turtle']
merge(other)

Merge collection with other MultiKeyIndexedCollection object.

Parameters:
other

Other multi key indexed collection object.

Returns:

Merged multi key indexed collection object

Return type:

MultiKeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_cat = sly.ObjClass('cat', sly.Rectangle)
collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_cat, item_turtle, other_cat])

item_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_dog, item_turtle])

merge = collection.merge(other_collection)
print(merge.to_json())
# Output: [
#     {
#         "name": "cat",
#         "value_type": "none",
#         "color": "#198A0F",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     },
#     {
#         "title": "cat",
#         "shape": "rectangle",
#         "color": "#898A0F",
#         "geometry_config": {},
#         "hotkey": ""
#     },
#     {
#         "name": "turtle",
#         "value_type": "any_string",
#         "color": "#650F8A",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     },
#     {
#         "name": "turtle",
#         "value_type": "any_string",
#         "color": "#0F8A83",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     },
#     {
#         "name": "dog",
#         "value_type": "none",
#         "color": "#1A8A0F",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     }
# ]
merge_without_duplicates(other)

Merge collection with other MultiKeyIndexedCollection object. Duplicates will be ignored.

Parameters:
other

Other multi key indexed collection object.

Raises:

ValueError – if item name from given MultiKeyIndexedCollection is in collection but items in both are different

Returns:

MultiKeyIndexedCollection object

Return type:

MultiKeyIndexedCollection

Usage Example:
import supervisely as sly

item_cat = sly.TagMeta('cat', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_cat = sly.ObjClass('cat', sly.Rectangle)
collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_cat, item_turtle, other_cat])

item_dog = sly.TagMeta('dog', sly.TagValueType.NONE)
item_turtle = sly.TagMeta('turtle', sly.TagValueType.ANY_STRING)
other_collection = sly.collection.key_indexed_collection.MultiKeyIndexedCollection([item_dog, item_turtle])

merge = collection.merge_without_duplicates(other_collection)
print(merge.to_json())
# Output: [
#     {
#         "name": "dog",
#         "value_type": "none",
#         "color": "#8A0F37",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     },
#     {
#         "name": "cat",
#         "value_type": "none",
#         "color": "#778A0F",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     },
#     {
#         "title": "cat",
#         "shape": "rectangle",
#         "color": "#8A0F76",
#         "geometry_config": {},
#         "hotkey": ""
#     },
#     {
#         "name": "turtle",
#         "value_type": "any_string",
#         "color": "#850F8A",
#         "hotkey": "",
#         "applicable_type": "all",
#         "classes": []
#     }
# ]
remove_items(keys)

Remove items from collection by given list of keys. Creates a new instance of KeyIndexedCollection.

Parameters:
keys : List[str]

List of keys(item names) in collection.

Returns:

New instance of KeyIndexedCollection

Return type:

KeyIndexedCollection

to_json(key_id_map=None)

Convert the PointcloudTagCollection to a list of json dicts. Read more about Supervisely format.

Parameters:
key_id_map=None

Key ID map.

Returns:

List of dictionaries in json format.

Return type:

List[Dict]

Usage Example:
import supervisely as sly

meta_weather = sly.TagMeta('Weather', sly.TagValueType.ANY_STRING)

seasons = ["Winter", "Spring", "Summer", "Autumn"]
meta_season = sly.TagMeta('Season', sly.TagValueType.ONEOF_STRING, possible_values=seasons)

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

tags_arr = [tag_weather, tag_season]
tags = sly.PointcloudTagCollection(tags_arr)

tags_json = tags.to_json()
# Output: [
#     {
#         "name":"Weather",
#         "value":"Sunny",
#         "key": "058ad7993a534082b4d94cc52542a97d"
#     },
#     {
#         "name":"Season",
#         "value":"Spring",
#         "key": "0c0033c5b4834d4cbabece4317295f07"
#     }
# ]