ObjectClassesList
Introduction
ObjectClassesList
is a widget that allows users to view a list of all given object classes. The widget provides a flexible display option with a choice of single-column or multiple-column layouts. It also allows users to select or deselect one or more classes, making it easy to manage and organize object classes. This widget is a useful tool for visualizing and selecting classes in Supervisely.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Supervisely object class collection or list of object classes |
|
| Enable classes selection |
|
| Number of columns |
|
| ID of the widget |
object_classes
Supervisely object class collection (ObjClassCollection
) or list of ObjClass
.
type: Union[ObjClassCollection, List[ObjClass]]
selectable
Enable classes selection.
type: bool
default False
columns
Number of columns.
type: int
default 1
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Return list of selected classes. |
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/media/010_object_classes_list/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 Dataset ID
we will use
Project ID
and Dataset ID
we will useGet Project info and meta
Initialize ObjectClassesList
widget
ObjectClassesList
widgetCreate 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.
Add functions to control widgets from python code
Last updated