supervisely 6.73.457__py3-none-any.whl → 6.73.459__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of supervisely might be problematic. Click here for more details.
- supervisely/__init__.py +24 -1
- supervisely/api/image_api.py +4 -0
- supervisely/api/video/video_annotation_api.py +4 -2
- supervisely/api/video/video_api.py +41 -1
- supervisely/app/v1/app_service.py +18 -2
- supervisely/app/v1/constants.py +7 -1
- supervisely/app/widgets/card/card.py +20 -0
- supervisely/app/widgets/deploy_model/deploy_model.py +56 -35
- supervisely/app/widgets/experiment_selector/experiment_selector.py +8 -0
- supervisely/app/widgets/fast_table/fast_table.py +45 -11
- supervisely/app/widgets/fast_table/template.html +1 -1
- supervisely/app/widgets/radio_tabs/radio_tabs.py +18 -2
- supervisely/app/widgets/radio_tabs/template.html +1 -0
- supervisely/app/widgets/select_dataset_tree/select_dataset_tree.py +57 -7
- supervisely/app/widgets/tree_select/tree_select.py +2 -0
- supervisely/nn/inference/inference.py +364 -73
- supervisely/nn/inference/inference_request.py +3 -2
- supervisely/nn/inference/predict_app/gui/classes_selector.py +81 -12
- supervisely/nn/inference/predict_app/gui/gui.py +676 -488
- supervisely/nn/inference/predict_app/gui/input_selector.py +178 -25
- supervisely/nn/inference/predict_app/gui/model_selector.py +2 -4
- supervisely/nn/inference/predict_app/gui/output_selector.py +46 -6
- supervisely/nn/inference/predict_app/gui/settings_selector.py +756 -59
- supervisely/nn/inference/predict_app/gui/tags_selector.py +1 -1
- supervisely/nn/inference/predict_app/gui/utils.py +236 -119
- supervisely/nn/inference/predict_app/predict_app.py +2 -2
- supervisely/nn/model/model_api.py +9 -0
- supervisely/nn/tracker/base_tracker.py +11 -1
- supervisely/nn/tracker/botsort/botsort_config.yaml +0 -1
- supervisely/nn/tracker/botsort_tracker.py +14 -7
- supervisely/nn/tracker/visualize.py +70 -72
- supervisely/video/video.py +15 -1
- supervisely/worker_api/agent_rpc.py +24 -1
- supervisely/worker_api/rpc_servicer.py +31 -7
- {supervisely-6.73.457.dist-info → supervisely-6.73.459.dist-info}/METADATA +3 -2
- {supervisely-6.73.457.dist-info → supervisely-6.73.459.dist-info}/RECORD +40 -40
- {supervisely-6.73.457.dist-info → supervisely-6.73.459.dist-info}/LICENSE +0 -0
- {supervisely-6.73.457.dist-info → supervisely-6.73.459.dist-info}/WHEEL +0 -0
- {supervisely-6.73.457.dist-info → supervisely-6.73.459.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.457.dist-info → supervisely-6.73.459.dist-info}/top_level.txt +0 -0
|
@@ -5,7 +5,9 @@ from supervisely.api.api import Api
|
|
|
5
5
|
from supervisely.app.widgets import Widget
|
|
6
6
|
from supervisely.app.widgets.checkbox.checkbox import Checkbox
|
|
7
7
|
from supervisely.app.widgets.container.container import Container
|
|
8
|
+
from supervisely.app.widgets.field.field import Field
|
|
8
9
|
from supervisely.app.widgets.select.select import Select
|
|
10
|
+
from supervisely.app.widgets.select_project.select_project import SelectProject
|
|
9
11
|
from supervisely.app.widgets.tree_select.tree_select import TreeSelect
|
|
10
12
|
from supervisely.project.project_type import ProjectType
|
|
11
13
|
|
|
@@ -97,6 +99,7 @@ class SelectDatasetTree(Widget):
|
|
|
97
99
|
widget_id: Union[str, None] = None,
|
|
98
100
|
show_select_all_datasets_checkbox: bool = True,
|
|
99
101
|
width: int = 193,
|
|
102
|
+
show_selectors_labels: bool = False,
|
|
100
103
|
):
|
|
101
104
|
self._api = Api.from_env()
|
|
102
105
|
|
|
@@ -114,11 +117,21 @@ class SelectDatasetTree(Widget):
|
|
|
114
117
|
# Using environment variables to set the default values if they are not provided.
|
|
115
118
|
self._project_id = project_id or env.project_id(raise_not_found=False)
|
|
116
119
|
self._dataset_id = default_id or env.dataset_id(raise_not_found=False)
|
|
120
|
+
if self._project_id:
|
|
121
|
+
project_info = self._api.project.get_info_by_id(self._project_id)
|
|
122
|
+
if allowed_project_types is not None:
|
|
123
|
+
if project_info.type not in [pt.value for pt in allowed_project_types]:
|
|
124
|
+
self._project_id = None
|
|
117
125
|
|
|
118
126
|
self._multiselect = multiselect
|
|
119
127
|
self._compact = compact
|
|
120
128
|
self._append_to_body = append_to_body
|
|
121
129
|
|
|
130
|
+
# User-defined callbacks
|
|
131
|
+
self._team_changed_callbacks = []
|
|
132
|
+
self._workspace_changed_callbacks = []
|
|
133
|
+
self._project_changed_callbacks = []
|
|
134
|
+
|
|
122
135
|
# Extract values from Enum to match the .type property of the ProjectInfo object.
|
|
123
136
|
self._project_types = None
|
|
124
137
|
if allowed_project_types is not None:
|
|
@@ -160,6 +173,7 @@ class SelectDatasetTree(Widget):
|
|
|
160
173
|
if show_select_all_datasets_checkbox:
|
|
161
174
|
self._create_select_all_datasets_checkbox(select_all_datasets)
|
|
162
175
|
|
|
176
|
+
self._show_selectors_labels = show_selectors_labels
|
|
163
177
|
# Group the selectors and the dataset selector into a container.
|
|
164
178
|
self._content = Container(self._widgets)
|
|
165
179
|
super().__init__(widget_id=widget_id, file_path=__file__)
|
|
@@ -310,6 +324,27 @@ class SelectDatasetTree(Widget):
|
|
|
310
324
|
raise ValueError("This method can only be called when multiselect is enabled.")
|
|
311
325
|
self._select_dataset.set_selected_by_id(dataset_ids)
|
|
312
326
|
|
|
327
|
+
def team_changed(self, func: Callable) -> Callable:
|
|
328
|
+
"""Decorator to set the callback function for the team changed event."""
|
|
329
|
+
if self._compact:
|
|
330
|
+
raise ValueError("callback 'team_changed' is not available in compact mode.")
|
|
331
|
+
self._team_changed_callbacks.append(func)
|
|
332
|
+
return func
|
|
333
|
+
|
|
334
|
+
def workspace_changed(self, func: Callable) -> Callable:
|
|
335
|
+
"""Decorator to set the callback function for the workspace changed event."""
|
|
336
|
+
if self._compact:
|
|
337
|
+
raise ValueError("callback 'workspace_changed' is not available in compact mode.")
|
|
338
|
+
self._workspace_changed_callbacks.append(func)
|
|
339
|
+
return func
|
|
340
|
+
|
|
341
|
+
def project_changed(self, func: Callable) -> Callable:
|
|
342
|
+
"""Decorator to set the callback function for the project changed event."""
|
|
343
|
+
if self._compact:
|
|
344
|
+
raise ValueError("callback 'project_changed' is not available in compact mode.")
|
|
345
|
+
self._project_changed_callbacks.append(func)
|
|
346
|
+
return func
|
|
347
|
+
|
|
313
348
|
def value_changed(self, func: Callable) -> Callable:
|
|
314
349
|
"""Decorator to set the callback function for the value changed event.
|
|
315
350
|
|
|
@@ -353,13 +388,13 @@ class SelectDatasetTree(Widget):
|
|
|
353
388
|
|
|
354
389
|
if checked:
|
|
355
390
|
self._select_dataset.select_all()
|
|
356
|
-
self.
|
|
391
|
+
self._select_dataset_field.hide()
|
|
357
392
|
else:
|
|
358
393
|
self._select_dataset.clear_selected()
|
|
359
|
-
self.
|
|
394
|
+
self._select_dataset_field.show()
|
|
360
395
|
|
|
361
396
|
if select_all_datasets:
|
|
362
|
-
self.
|
|
397
|
+
self._select_dataset_field.hide()
|
|
363
398
|
select_all_datasets_checkbox.check()
|
|
364
399
|
|
|
365
400
|
self._widgets.append(select_all_datasets_checkbox)
|
|
@@ -390,9 +425,10 @@ class SelectDatasetTree(Widget):
|
|
|
390
425
|
self._select_dataset.set_selected_by_id(self._dataset_id)
|
|
391
426
|
if select_all_datasets:
|
|
392
427
|
self._select_dataset.select_all()
|
|
428
|
+
self._select_dataset_field = Field(self._select_dataset, title="Dataset")
|
|
393
429
|
|
|
394
430
|
# Adding the dataset selector to the list of widgets to be added to the container.
|
|
395
|
-
self._widgets.append(self.
|
|
431
|
+
self._widgets.append(self._select_dataset_field)
|
|
396
432
|
|
|
397
433
|
def _create_selectors(self, team_is_selectable: bool, workspace_is_selectable: bool):
|
|
398
434
|
"""Create the team, workspace, and project selectors.
|
|
@@ -412,6 +448,9 @@ class SelectDatasetTree(Widget):
|
|
|
412
448
|
self._select_workspace.set(items=self._get_select_items(team_id=team_id))
|
|
413
449
|
self._team_id = team_id
|
|
414
450
|
|
|
451
|
+
for callback in self._team_changed_callbacks:
|
|
452
|
+
callback(team_id)
|
|
453
|
+
|
|
415
454
|
def workspace_selector_handler(workspace_id: int):
|
|
416
455
|
"""Handler function for the event when the workspace selector value changes.
|
|
417
456
|
|
|
@@ -421,6 +460,9 @@ class SelectDatasetTree(Widget):
|
|
|
421
460
|
self._select_project.set(items=self._get_select_items(workspace_id=workspace_id))
|
|
422
461
|
self._workspace_id = workspace_id
|
|
423
462
|
|
|
463
|
+
for callback in self._workspace_changed_callbacks:
|
|
464
|
+
callback(workspace_id)
|
|
465
|
+
|
|
424
466
|
def project_selector_handler(project_id: int):
|
|
425
467
|
"""Handler function for the event when the project selector value changes.
|
|
426
468
|
|
|
@@ -435,7 +477,10 @@ class SelectDatasetTree(Widget):
|
|
|
435
477
|
and self._select_all_datasets_checkbox.is_checked()
|
|
436
478
|
):
|
|
437
479
|
self._select_dataset.select_all()
|
|
438
|
-
self.
|
|
480
|
+
self._select_dataset_field.hide()
|
|
481
|
+
|
|
482
|
+
for callback in self._project_changed_callbacks:
|
|
483
|
+
callback(project_id)
|
|
439
484
|
|
|
440
485
|
self._select_team = Select(
|
|
441
486
|
items=self._get_select_items(),
|
|
@@ -446,6 +491,7 @@ class SelectDatasetTree(Widget):
|
|
|
446
491
|
self._select_team.set_value(self._team_id)
|
|
447
492
|
if not team_is_selectable:
|
|
448
493
|
self._select_team.disable()
|
|
494
|
+
self._select_team_field = Field(self._select_team, title="Team")
|
|
449
495
|
|
|
450
496
|
self._select_workspace = Select(
|
|
451
497
|
items=self._get_select_items(team_id=self._team_id),
|
|
@@ -456,6 +502,7 @@ class SelectDatasetTree(Widget):
|
|
|
456
502
|
self._select_workspace.set_value(self._workspace_id)
|
|
457
503
|
if not workspace_is_selectable:
|
|
458
504
|
self._select_workspace.disable()
|
|
505
|
+
self._select_workspace_field = Field(self._select_workspace, title="Workspace")
|
|
459
506
|
|
|
460
507
|
self._select_project = Select(
|
|
461
508
|
items=self._get_select_items(workspace_id=self._workspace_id),
|
|
@@ -464,14 +511,17 @@ class SelectDatasetTree(Widget):
|
|
|
464
511
|
width_px=self._width,
|
|
465
512
|
)
|
|
466
513
|
self._select_project.set_value(self._project_id)
|
|
514
|
+
self._select_project_field = Field(self._select_project, title="Project")
|
|
467
515
|
|
|
468
|
-
# Register the event handlers.
|
|
516
|
+
# Register the event handlers._select_project
|
|
469
517
|
self._select_team.value_changed(team_selector_handler)
|
|
470
518
|
self._select_workspace.value_changed(workspace_selector_handler)
|
|
471
519
|
self._select_project.value_changed(project_selector_handler)
|
|
472
520
|
|
|
473
521
|
# Adding widgets to the list, so they can be added to the container.
|
|
474
|
-
self._widgets.extend(
|
|
522
|
+
self._widgets.extend(
|
|
523
|
+
[self._select_team_field, self._select_workspace_field, self._select_project_field]
|
|
524
|
+
)
|
|
475
525
|
|
|
476
526
|
def _get_select_items(self, **kwargs) -> List[Select.Item]:
|
|
477
527
|
"""Get the list of items for the team, workspace, and project selectors.
|