LabeledImage
Introduction
LabeledImage
widget in Supervisely is designed to display an image with annotations and provides additional features such as the ability to toggle the visibility of individual class annotations, change fill opacity, and includes a zoom function.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Figures opacity |
|
| Determines the presence of opacity slider on |
|
| Enable zoom on |
|
| Resize card to fit figure |
|
| Fill rectange |
|
| Border width (thickness) |
|
| If no images are given, this message will be displayed. |
|
| ID of the widget |
annotations_opacity
Figures opacity.
type: float
default value: 0.5
show_opacity_slider
Determines the presence of opacity slider on LabeledImage
.
type: bool
default value: true
enable_zoom
Enable zoom on LabeledImage
.
type: bool
default value: false
resize_on_zoom
Resize card to fit figure.
type: bool
default value: false
fill_rectangle
Resize card to fit figure.
type: bool
default value: true
border_width
Resize card to fit figure.
type: int
default value: 3
empty_message
If no images are given, this message will be displayed.
type: str
default value: No image was provided
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Get image id property. |
| Get or set |
| Set item in |
| Clean |
| Check |
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/media/002_labeled_image/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Get project ID and meta
Get image ID and annotations
Initialize LabeledImage
widget and fill it with image data
LabeledImage
widget and fill it with image dataCreate 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