supervisely 6.73.340__py3-none-any.whl → 6.73.342__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.
@@ -2245,7 +2245,7 @@ class ImageApi(RemoveableBulkModuleApi):
2245
2245
  if len(ids) == 0:
2246
2246
  return
2247
2247
 
2248
- existing_images = self.get_list(dst_dataset_id)
2248
+ existing_images = self.get_list(dst_dataset_id, force_metadata_for_links=False)
2249
2249
  existing_names = {image.name for image in existing_images}
2250
2250
 
2251
2251
  ids_info = self.get_info_by_id_batch(ids, force_metadata_for_links=False)
@@ -2271,7 +2271,8 @@ class ImageApi(RemoveableBulkModuleApi):
2271
2271
  "names intersection"
2272
2272
  )
2273
2273
 
2274
- new_images = self.upload_ids(dst_dataset_id, new_names, ids, progress_cb)
2274
+ img_metas = [info.meta or {} for info in ids_info]
2275
+ new_images = self.upload_ids(dst_dataset_id, new_names, ids, progress_cb, metas=img_metas)
2275
2276
  new_ids = [new_image.id for new_image in new_images]
2276
2277
 
2277
2278
  if with_annotations:
@@ -2356,12 +2357,14 @@ class ImageApi(RemoveableBulkModuleApi):
2356
2357
  raise RuntimeError("len(dst_names) != len(src_image_infos)")
2357
2358
  new_names = dst_names
2358
2359
 
2360
+ img_metas = [info.meta or {} for info in src_image_infos]
2359
2361
  src_ids = [info.id for info in src_image_infos]
2360
2362
  new_images = self.upload_ids(
2361
2363
  dst_dataset_id,
2362
2364
  new_names,
2363
2365
  src_ids,
2364
2366
  progress_cb,
2367
+ metas=img_metas,
2365
2368
  batch_size=batch_size,
2366
2369
  force_metadata_for_links=False,
2367
2370
  infos=src_image_infos,
@@ -709,23 +709,24 @@ class Inference:
709
709
  self.load_model(**deploy_params)
710
710
  self._model_served = True
711
711
  self._deploy_params = deploy_params
712
- try:
713
- if self.autorestart is None:
714
- self.autorestart = AutoRestartInfo(self._deploy_params)
715
- self.api.task.set_fields(self._task_id, self.autorestart.generate_fields())
716
- logger.debug(
717
- "Created new autorestart info.",
718
- extra=self.autorestart.deploy_params,
719
- )
720
- elif self.autorestart.is_changed(self._deploy_params):
721
- self.autorestart.deploy_params.update(self._deploy_params)
722
- self.api.task.set_fields(self._task_id, self.autorestart.generate_fields())
723
- logger.debug(
724
- "Autorestart info is changed. Parameters have been updated.",
725
- extra=self.autorestart.deploy_params,
726
- )
727
- except Exception as e:
728
- logger.warning(f"Failed to update autorestart info: {repr(e)}")
712
+ if self._task_id is not None and is_production():
713
+ try:
714
+ if self.autorestart is None:
715
+ self.autorestart = AutoRestartInfo(self._deploy_params)
716
+ self.api.task.set_fields(self._task_id, self.autorestart.generate_fields())
717
+ logger.debug(
718
+ "Created new autorestart info.",
719
+ extra=self.autorestart.deploy_params,
720
+ )
721
+ elif self.autorestart.is_changed(self._deploy_params):
722
+ self.autorestart.deploy_params.update(self._deploy_params)
723
+ self.api.task.set_fields(self._task_id, self.autorestart.generate_fields())
724
+ logger.debug(
725
+ "Autorestart info is changed. Parameters have been updated.",
726
+ extra=self.autorestart.deploy_params,
727
+ )
728
+ except Exception as e:
729
+ logger.warning(f"Failed to update autorestart info: {repr(e)}")
729
730
  if self.gui is not None:
730
731
  self.update_gui(self._model_served)
731
732
  self.gui.show_deployed_model_info(self)
@@ -2535,8 +2536,8 @@ class Inference:
2535
2536
  else:
2536
2537
  self._app = Application(layout=self.get_ui())
2537
2538
 
2538
- try:
2539
- if self._task_id is not None:
2539
+ if self._task_id is not None and is_production():
2540
+ try:
2540
2541
  response = self.api.task.get_fields(
2541
2542
  self._task_id, [AutoRestartInfo.Fields.AUTO_RESTART_INFO]
2542
2543
  )
@@ -2546,8 +2547,8 @@ class Inference:
2546
2547
  self._deploy_on_autorestart()
2547
2548
  else:
2548
2549
  logger.debug("Autorestart info is not set.")
2549
- except Exception:
2550
- logger.error("Autorestart failed.", exc_info=True)
2550
+ except Exception:
2551
+ logger.error("Autorestart failed.", exc_info=True)
2551
2552
 
2552
2553
  server = self._app.get_server()
2553
2554
  self._app.set_ready_check_function(self.is_model_deployed)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.340
3
+ Version: 6.73.342
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -28,7 +28,7 @@ supervisely/api/dataset_api.py,sha256=GH7prDRJKyJlTv_7_Y-RkTwJN7ED4EkXNqqmi3iIdI
28
28
  supervisely/api/file_api.py,sha256=bVWv6kf3B5n6qlB14HmUa6iUr8ara5cr-pPK8QC7XWg,92932
29
29
  supervisely/api/github_api.py,sha256=NIexNjEer9H5rf5sw2LEZd7C1WR-tK4t6IZzsgeAAwQ,623
30
30
  supervisely/api/image_annotation_tool_api.py,sha256=YcUo78jRDBJYvIjrd-Y6FJAasLta54nnxhyaGyanovA,5237
31
- supervisely/api/image_api.py,sha256=WIML_6N1qgOWBm3acexmGSWz4hAaSxlYmUtbytROaP8,192375
31
+ supervisely/api/image_api.py,sha256=MIs4hVOy0J7o7KHF2aHt3V9noin5Lr2q4HGOIz5ONMw,192578
32
32
  supervisely/api/import_storage_api.py,sha256=BDCgmR0Hv6OoiRHLCVPKt3iDxSVlQp1WrnKhAK_Zl84,460
33
33
  supervisely/api/issues_api.py,sha256=BqDJXmNoTzwc3xe6_-mA7FDFC5QQ-ahGbXk_HmpkSeQ,17925
34
34
  supervisely/api/labeling_job_api.py,sha256=VM1pjM65cUTeer1hrI7cSmCUOHJb7fzK6gJ-abA07hg,55097
@@ -883,7 +883,7 @@ supervisely/nn/benchmark/visualization/widgets/table/__init__.py,sha256=47DEQpj8
883
883
  supervisely/nn/benchmark/visualization/widgets/table/table.py,sha256=atmDnF1Af6qLQBUjLhK18RMDKAYlxnsuVHMSEa5a-e8,4319
884
884
  supervisely/nn/inference/__init__.py,sha256=QFukX2ip-U7263aEPCF_UCFwj6EujbMnsgrXp5Bbt8I,1623
885
885
  supervisely/nn/inference/cache.py,sha256=LAirR5mFHCtK59EO1lefQ2qhpp0vBvRTH26EVrs13Y0,32073
886
- supervisely/nn/inference/inference.py,sha256=FUTlgyy676IsFhNH6PTRdnGz6aOXXH_5RtRKqxX8Pss,169801
886
+ supervisely/nn/inference/inference.py,sha256=qBAItRxn1wZoNxSZNY6bCcaUKwwowFlRaF_z4l-c7TY,169955
887
887
  supervisely/nn/inference/session.py,sha256=jmkkxbe2kH-lEgUU6Afh62jP68dxfhF5v6OGDfLU62E,35757
888
888
  supervisely/nn/inference/video_inference.py,sha256=8Bshjr6rDyLay5Za8IB8Dr6FURMO2R_v7aELasO8pR4,5746
889
889
  supervisely/nn/inference/gui/__init__.py,sha256=wCxd-lF5Zhcwsis-wScDA8n1Gk_1O00PKgDviUZ3F1U,221
@@ -1082,9 +1082,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1082
1082
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1083
1083
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1084
1084
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1085
- supervisely-6.73.340.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1086
- supervisely-6.73.340.dist-info/METADATA,sha256=MYPQWfGjiMVfYMHxrVyPYtnuYO1c9Hqa1l4PcmRU51k,33596
1087
- supervisely-6.73.340.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1088
- supervisely-6.73.340.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1089
- supervisely-6.73.340.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1090
- supervisely-6.73.340.dist-info/RECORD,,
1085
+ supervisely-6.73.342.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1086
+ supervisely-6.73.342.dist-info/METADATA,sha256=qcVJ34rq6NvqcXdhKypQoHzIq54FT_4tn3linZnivX4,33596
1087
+ supervisely-6.73.342.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1088
+ supervisely-6.73.342.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1089
+ supervisely-6.73.342.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1090
+ supervisely-6.73.342.dist-info/RECORD,,