SelectItem

Introduction

SelectItem widget can show selector for project items (depending on project type:image, video, volume, point_cloud or point_cloud_episode), clicking on it can be processed from python code. In this tutorial you will learn how to use SelectItem widget in Supervisely app.

Function signature

SelectItem(dataset_id=None, show_label=True, size=None, widget_id=None)

Parameters

Parameters
Type
Description

dataset_id

int

Dataset ID

compact

bool

Show only dataset select

show_label

bool

Show label

size

Literal["large", "small", "mini", None]

Selector size

widget_id

str

ID of the widget

dataset_id

Determine Supervisely dataset from which items will be selected.

type: int

default value: None

compact

Show only Dataset select.

type: bool

default value: true

show_label

Determine show text Item on widget or not.

type: bool

default value: True

size

Size of input.

type: Literal["large", "small", "mini", None]

default value: None

widget_id

ID of the widget.

type: str

default value: None

Methods and attributes

Attributes and Methods
Description

get_selected_id()

Return selected item id.

refresh_items(dataset_id: int = None, limit: int = 50)

Update items by given dataset id.

Mini App Example

You can find this example in our Github repository:

ui-widgets-demos/selection/006_select_item/src/main.py

Import libraries

Init API client

First, we load environment variables with credentials and init API for communicating with Supervisely Instance:

Prepare Dataset ID

Initialize SelectItem widget

Create 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.

Last updated

Was this helpful?