InputTag
Introduction
InputTag
widget in Supervisely is a user interface element that allows users to add or remove tag labels to items (images, videos, volumes, and point clouds). It uses TagMeta
of the current project and allow to use them easily in Supervisely apps. InputTag
widget is a valuable tool for improving the organization and efficiency of Supervisely apps.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
|
|
|
| Max tag field width |
|
| ID of the widget |
tag_meta
Determine TagMeta
from which Tags
will be selected. Possible Tag
types: any_number
, any_string
, one_of_string
, none
.
type: TagMeta
max_width
Determine max tag field width.
type: int
default value: 300
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Get input widget value property. |
| Set input widget value property. |
| Return current |
| set |
| Activate |
| Deactivate |
| Check |
| Check |
| Set given value in |
| Get current |
| Decorator function is handled when |
| Decorator function is handled when |
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/input/003_input_tag/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 and TagMeta
we will use
Project
ID and TagMeta
we will useInitialize list of InputTag
widgets for each TagMeta
in project
InputTag
widgets for each TagMeta
in projectInitialize Button
and Text
widgets we will use
Button
and Text
widgets we will useCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Handle button clicks
Use the decorators to handle button click and tag values changing. We have button to change tags switch status and text field to show tags values changing.
Last updated