supervisely 6.73.275__py3-none-any.whl → 6.73.276__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.

@@ -25,6 +25,7 @@ from supervisely.app.widgets import (
25
25
  )
26
26
  from supervisely.io.fs import get_file_name_with_ext
27
27
  from supervisely.nn.artifacts.artifacts import TrainInfo
28
+ import supervisely.io.env as sly_env
28
29
 
29
30
  WEIGHTS_DIR = "weights"
30
31
 
@@ -69,18 +70,34 @@ class CustomModelsSelector(Widget):
69
70
  # col 1 task
70
71
  self._task_id = task_id
71
72
  self._task_path = train_info.artifacts_folder
72
- task_info = self._api.task.get_info_by_id(task_id)
73
- self._task_date_iso = task_info["startedAt"]
74
- self._task_date = self._normalize_date()
75
- self._task_link = self._create_task_link()
73
+ try:
74
+ self._task_info = self._api.task.get_info_by_id(task_id)
75
+ except:
76
+ self._task_info = None
77
+
78
+ if self._task_info is not None:
79
+ self._task_date_iso = self._task_info["startedAt"]
80
+ self._task_date = self._normalize_date()
81
+ self._task_link = self._create_task_link()
82
+ else:
83
+ self._task_date_iso = None
84
+ self._task_date = None
85
+ self._task_link = None
76
86
  self._config_path = train_info.config_path
77
87
 
78
88
  # col 2 project
79
89
  self._training_project_name = train_info.project_name
80
- project_info = self._api.project.get_info_by_name(
81
- task_info["workspaceId"], self._training_project_name
90
+
91
+ workspace_id = (
92
+ self._task_info["workspaceId"]
93
+ if self._task_info
94
+ else sly_env.workspace_id(raise_not_found=False)
95
+ )
96
+ self._training_project_info = (
97
+ self._api.project.get_info_by_name(workspace_id, self._training_project_name)
98
+ if workspace_id
99
+ else None
82
100
  )
83
- self._training_project_info = project_info
84
101
 
85
102
  # col 3 checkpoints
86
103
  self._checkpoints = train_info.checkpoints
@@ -175,30 +192,36 @@ class CustomModelsSelector(Widget):
175
192
  return ""
176
193
 
177
194
  def _create_task_widget(self) -> Flexbox:
178
- task_widget = Container(
179
- [
180
- Text(
181
- f"<i class='zmdi zmdi-folder' style='color: #7f858e'></i> <a href='{self._task_link}'>{self._task_id}</a>",
182
- "text",
183
- ),
184
- Text(
185
- f"<span class='field-description text-muted' style='color: #7f858e'>{self._task_date}</span>",
186
- "text",
187
- font_size=13,
188
- ),
189
- ],
190
- gap=0,
191
- )
195
+ if self._task_info is not None:
196
+ task_widget = Container(
197
+ [
198
+ Text(
199
+ f"<i class='zmdi zmdi-folder' style='color: #7f858e'></i> <a href='{self._task_link}'>{self._task_id}</a>",
200
+ "text",
201
+ ),
202
+ Text(
203
+ f"<span class='field-description text-muted' style='color: #7f858e'>{self._task_date}</span>",
204
+ "text",
205
+ font_size=13,
206
+ ),
207
+ ],
208
+ gap=0,
209
+ )
210
+ else:
211
+ task_widget = Text(
212
+ f"<span class='field-description text-muted' style='color: #7f858e'>Task was archived (ID: '{self._task_id}')</span>",
213
+ "text",
214
+ )
192
215
  return task_widget
193
216
 
194
217
  def _create_training_project_widget(self) -> Union[ProjectThumbnail, Text]:
195
- if self.training_project_info is not None:
218
+ if self._training_project_info is not None:
196
219
  training_project_widget = ProjectThumbnail(
197
220
  self._training_project_info, remove_margins=True
198
221
  )
199
222
  else:
200
223
  training_project_widget = Text(
201
- f"<span class='field-description text-muted' style='color: #7f858e'>Project was deleted</span>",
224
+ f"<span class='field-description text-muted' style='color: #7f858e'>Project was archived</span>",
202
225
  "text",
203
226
  font_size=13,
204
227
  )
@@ -209,15 +232,11 @@ class CustomModelsSelector(Widget):
209
232
  for checkpoint_info in self._checkpoints:
210
233
  if isinstance(checkpoint_info, dict):
211
234
  checkpoint_selector_items.append(
212
- Select.Item(
213
- value=checkpoint_info["path"], label=checkpoint_info["name"]
214
- )
235
+ Select.Item(value=checkpoint_info["path"], label=checkpoint_info["name"])
215
236
  )
216
237
  elif isinstance(checkpoint_info, FileInfo):
217
238
  checkpoint_selector_items.append(
218
- Select.Item(
219
- value=checkpoint_info.path, label=checkpoint_info.name
220
- )
239
+ Select.Item(value=checkpoint_info.path, label=checkpoint_info.name)
221
240
  )
222
241
 
223
242
  checkpoint_selector = Select(items=checkpoint_selector_items)
@@ -282,9 +301,7 @@ class CustomModelsSelector(Widget):
282
301
  )
283
302
 
284
303
  file_api = FileApi(self._api)
285
- self._model_path_input = Input(
286
- placeholder="Path to model file in Team Files"
287
- )
304
+ self._model_path_input = Input(placeholder="Path to model file in Team Files")
288
305
 
289
306
  @self._model_path_input.value_changed
290
307
  def change_folder(value):
@@ -322,9 +339,7 @@ class CustomModelsSelector(Widget):
322
339
 
323
340
  self.custom_tab_widgets.hide()
324
341
 
325
- self.show_custom_checkpoint_path_checkbox = Checkbox(
326
- "Use custom checkpoint", False
327
- )
342
+ self.show_custom_checkpoint_path_checkbox = Checkbox("Use custom checkpoint", False)
328
343
 
329
344
  @self.show_custom_checkpoint_path_checkbox.value_changed
330
345
  def show_custom_checkpoint_path_checkbox_changed(is_checked):
@@ -399,9 +414,7 @@ class CustomModelsSelector(Widget):
399
414
  self.disable_table()
400
415
  super().disable()
401
416
 
402
- def _generate_table_rows(
403
- self, train_infos: List[TrainInfo]
404
- ) -> Dict[str, List[ModelRow]]:
417
+ def _generate_table_rows(self, train_infos: List[TrainInfo]) -> Dict[str, List[ModelRow]]:
405
418
  """Method to generate table rows from remote path to training app save directory"""
406
419
 
407
420
  def process_train_info(train_info):
@@ -414,7 +427,7 @@ class CustomModelsSelector(Widget):
414
427
  )
415
428
  return train_info.task_type, model_row
416
429
  except Exception as e:
417
- logger.warn(f"Failed to process train info: {train_info}")
430
+ logger.warning(f"Failed to process train info: {train_info}. Error: {repr(e)}")
418
431
  return None, None
419
432
 
420
433
  table_rows = defaultdict(list)
@@ -448,8 +461,7 @@ class CustomModelsSelector(Widget):
448
461
  if "pose estimation" in task_types:
449
462
  sorted_tt.append("pose estimation")
450
463
  other_tasks = sorted(
451
- set(task_types)
452
- - set(["object detection", "instance segmentation", "pose estimation"])
464
+ set(task_types) - set(["object detection", "instance segmentation", "pose estimation"])
453
465
  )
454
466
  sorted_tt.extend(other_tasks)
455
467
  return sorted_tt
@@ -536,9 +548,7 @@ class CustomModelsSelector(Widget):
536
548
 
537
549
  def set_custom_checkpoint_task_type(self, task_type: str) -> None:
538
550
  if self.use_custom_checkpoint_path():
539
- available_task_types = (
540
- self.custom_checkpoint_task_type_selector.get_labels()
541
- )
551
+ available_task_types = self.custom_checkpoint_task_type_selector.get_labels()
542
552
  if task_type not in available_task_types:
543
553
  raise ValueError(f'"{task_type}" is not available task type')
544
554
  self.custom_checkpoint_task_type_selector.set_value(task_type)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.275
3
+ Version: 6.73.276
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -205,7 +205,7 @@ supervisely/app/widgets/copy_to_clipboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-
205
205
  supervisely/app/widgets/copy_to_clipboard/copy_to_clipboard.py,sha256=UlBbXeCBS2_60wtJrMZj3jqPhQJR0wJ3T7vfK4WA588,3283
206
206
  supervisely/app/widgets/copy_to_clipboard/template.html,sha256=4gGPot40yVqFkpVVUZGz3DPogVFlZKQ98YM01EUfQDY,492
207
207
  supervisely/app/widgets/custom_models_selector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
208
- supervisely/app/widgets/custom_models_selector/custom_models_selector.py,sha256=yt9rmJR9cHcYorzb04g8yEu5yxrEsRxZVtmlb6-rsMU,20835
208
+ supervisely/app/widgets/custom_models_selector/custom_models_selector.py,sha256=L4FFkTLODWpzrJ09JsCjJA9hNi7ITz9qe1uuRGkf874,21495
209
209
  supervisely/app/widgets/custom_models_selector/style.css,sha256=-zPPXHnJvatYj_xVVAb7T8uoSsUTyhm5xCKWkkFQ78E,548
210
210
  supervisely/app/widgets/custom_models_selector/template.html,sha256=k7f_Xl6nDUXXwu6IY_RblYni5TbZRRxCBduY5O_SyFs,2908
211
211
  supervisely/app/widgets/dataset_thumbnail/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1067,9 +1067,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1067
1067
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1068
1068
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1069
1069
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1070
- supervisely-6.73.275.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1071
- supervisely-6.73.275.dist-info/METADATA,sha256=zkN67LRGghMe6rNZp9mRGpe8gal1OLLXh49AyenpU-I,33573
1072
- supervisely-6.73.275.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1073
- supervisely-6.73.275.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1074
- supervisely-6.73.275.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1075
- supervisely-6.73.275.dist-info/RECORD,,
1070
+ supervisely-6.73.276.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1071
+ supervisely-6.73.276.dist-info/METADATA,sha256=IEQlHjL5OYrRUVXISxSa5jZEaxfStqtTGbn40HHu810,33573
1072
+ supervisely-6.73.276.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1073
+ supervisely-6.73.276.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1074
+ supervisely-6.73.276.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1075
+ supervisely-6.73.276.dist-info/RECORD,,