SelectProject
Introduction
SelectProject
widget in Supervisely is a dropdown menu that allows users to select a project from a list of available projects in current workspace. Clicking on it can be processed from python code. This widget is particularly useful when working with multiple projects in Supervisely and allows to easily switch between projects in applications.
Function signature
Parameters
default_id
Determine Project
will be selected by default.
type: int
default value: None
workspace_id
Determine Workspace
will be selected by default.
type: int
default value: None
compact
Show only Project
select.
type: bool
default value: false
allowed_types
List of project types witch will be available to select. Set one of available sly.ProjectType
s: IMAGES
, VIDEOS
, VOLUMES
, POINT_CLOUDS
, POINT_CLOUD_EPISODES
.
type: List[ProjectType]
default value: []
show_label
Determine show text Project
on widget or not. This parameter only affects when parameter compact
is True
.
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
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/004_select_project/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare project_id
and workspace_id
project_id
and workspace_id
Initialize SelectProject
widget
SelectProject
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.
Last updated