Progress
Last updated
Last updated
This Supervisely widget allows you to display the progress of a task or operation. It is a useful widget for applications that involve long-running processes or tasks that take time to complete.
With the Progress Bar
widget, you can easily create a progress bar that updates in real-time or update the progress bar dynamically as a task progresses, giving users a clear indication of how much time is left until the task is complete.
The Progress Bar Widget can be customized to show progress as percents or values.
message
str
Progress bar message
show_percents
bool
Show progress in percents
hide_on_finish
bool
Hide progress bar on finish
widget_id
str
ID of the widget
Progress bar message.
type: str
default value: None
Show progress in percents.
type: bool
default value: False
Hide progress bar on finish
type: bool
default value: True
ID of the widget.
type: str
default value: None
You can find this example in our Github repository:
ui-widgets-demos/status elements/001_progress_bar/src/main.py
Init API for communicating with Supervisely Instance. First, we load environment variables with credentials:
Progress Bar
, Text
and Button
widgetsPrepare a layout for app using Card
widget with the content
parameter and place 3 widgets that we've just created in the Container
widget. Place order in the Container
is important, we want the finish message text to be displayed below the progress bar button.
Create an app object with layout parameter.
Our app layout is ready. Progress bar will appear after pressing the Start
button.
Use the decorator as shown below to handle button click. Progress Bar
will be updating itself (pbar.update(1)
) every half second by 1 point as specified in sleep
function until it reaches total
10.