TagMetaView
Introduction
TagMetaView is a widget in Supervisely that displays a single TagMeta and provides a convenient way to view the name, color, and tag value type.
Function signature
tag_meta_view = TagMetaView(
tag_meta=sly.TagMeta("Animal", sly.TagValueType.ANY_STRING, color=[255, 0, 0]),
show_type_text=True,
limit_long_names=False,
widget_id=None
)Parameters
tag_meta
TagMeta
Supervisely tag meta
show_type_text
bool
If True display tag value type
limit_long_names
bool
If False show the entire tag name if the name is quite lengthy
widget_id
str
ID of the widget
tag_meta
Supervisely tag meta
type: TagMeta
show_type_text
If True display tag value type next to tag name.
type: bool
default value: True
limit_long_names
If False show the entire tag name if the name is quite lengthy
type: bool
default value: False
widget_id
ID of the widget.
type: str
default value: None
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/media/013_tag_meta_view/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize Project ID we will use
Project ID we will useGet Project info and meta from server
Prepare TagMeta for each tag in project
TagMeta for each tag in projectGet TagMetas from project meta
Initialize TagMetaView widget
TagMetaView widgetIn this tutorial we will create list of TagMetaView objects for each tag in project.
Create app layout
Prepare a layout for app using Card, Field widgets with the content parameter and place widgets that we've just created in the Container widget.
Create app using layout
Create an app object with layout parameter.
Last updated
Was this helpful?