supervisely 6.73.198__py3-none-any.whl → 6.73.199__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.
@@ -164,7 +164,7 @@ class DatasetApi(UpdateableModule, RemoveableModuleApi):
164
164
  :type project_id: int
165
165
  :param filters: List of params to sort output Datasets.
166
166
  :type filters: List[dict], optional
167
- :recursive: If True, returns all Datasets from the given Project including nested Datasets.
167
+ :param recursive: If True, returns all Datasets from the given Project including nested Datasets.
168
168
  :type recursive: bool, optional
169
169
  :param parent_id: Parent Dataset ID. If set to None, the search will be performed at the top level of the Project,
170
170
  otherwise the search will be performed in the specified Dataset.
@@ -3326,3 +3326,44 @@ class ImageApi(RemoveableBulkModuleApi):
3326
3326
 
3327
3327
  if project_id is not None and dataset_id is not None:
3328
3328
  raise ValueError("Only one of 'project_id' and 'dataset_id' should be provided.")
3329
+
3330
+ def set_remote(self, images: List[int], links: List[str]):
3331
+ """
3332
+ This method helps to change local source to remote for images without re-uploading them as new.
3333
+
3334
+ :param images: List of image ids.
3335
+ :type images: List[int]
3336
+ :param links: List of remote links.
3337
+ :type links: List[str]
3338
+ :return: json-encoded content of a response.
3339
+
3340
+ :Usage example:
3341
+
3342
+ .. code-block:: python
3343
+
3344
+ import supervisely as sly
3345
+
3346
+ api = sly.Api.from_env()
3347
+
3348
+ images = [123, 124, 125]
3349
+ links = [
3350
+ "s3://bucket/lemons/ds1/img/IMG_444.jpeg",
3351
+ "s3://bucket/lemons/ds1/img/IMG_445.jpeg",
3352
+ "s3://bucket/lemons/ds1/img/IMG_446.jpeg",
3353
+ ]
3354
+ result = api.image.set_remote(images, links)
3355
+ """
3356
+
3357
+ if len(images) == 0:
3358
+ raise ValueError("List of images can not be empty.")
3359
+
3360
+ if len(images) != len(links):
3361
+ raise ValueError("Length of 'images' and 'links' should be equal.")
3362
+
3363
+ images_list = []
3364
+ for img, lnk in zip(images, links):
3365
+ images_list.append({ApiField.ID: img, ApiField.LINK: lnk})
3366
+
3367
+ data = {ApiField.IMAGES: images_list, ApiField.CLEAR_LOCAL_DATA_SOURCE: True}
3368
+ r = self._api.post("images.update.links", data)
3369
+ return r.json()
@@ -592,6 +592,8 @@ class ApiField:
592
592
  """"""
593
593
  PRIORITY = "priority"
594
594
  """"""
595
+ CLEAR_LOCAL_DATA_SOURCE = "clearLocalDataSource"
596
+ """"""
595
597
 
596
598
 
597
599
  def _get_single_item(items):
@@ -1405,13 +1405,16 @@ class VideoApi(RemoveableBulkModuleApi):
1405
1405
  res = self.upload_hash(dataset_id, name, hash, stream_index)
1406
1406
  video_info_results.append(res)
1407
1407
  except Exception as e:
1408
- from supervisely.io.exception_handlers import ErrorHandler, handle_exception
1408
+ from supervisely.io.exception_handlers import (
1409
+ ErrorHandler,
1410
+ handle_exception,
1411
+ )
1409
1412
 
1410
1413
  msg = f"File skipped {name}: error occurred during processing: "
1411
1414
  handled_exc = handle_exception(e)
1412
1415
  if handled_exc is not None:
1413
1416
  if isinstance(handled_exc, ErrorHandler.API.PaymentRequired):
1414
- raise e # re-raise original exception (will be handled in the UI)
1417
+ raise e # re-raise original exception (will be handled in the UI)
1415
1418
  else:
1416
1419
  msg += handled_exc.get_message_for_exception()
1417
1420
  else:
@@ -2175,3 +2178,44 @@ class VideoApi(RemoveableBulkModuleApi):
2175
2178
  )
2176
2179
  )
2177
2180
  return video_infos
2181
+
2182
+ def set_remote(self, videos: List[int], links: List[str]):
2183
+ """
2184
+ This method helps to change local source to remote for videos without re-uploading them as new.
2185
+
2186
+ :param videos: List of video ids.
2187
+ :type videos: List[int]
2188
+ :param links: List of remote links.
2189
+ :type links: List[str]
2190
+ :return: json-encoded content of a response.
2191
+
2192
+ :Usage example:
2193
+
2194
+ .. code-block:: python
2195
+
2196
+ import supervisely as sly
2197
+
2198
+ api = sly.Api.from_env()
2199
+
2200
+ videos = [123, 124, 125]
2201
+ links = [
2202
+ "s3://bucket/f1champ/ds1/lap_1.mp4",
2203
+ "s3://bucket/f1champ/ds1/lap_2.mp4",
2204
+ "s3://bucket/f1champ/ds1/lap_3.mp4",
2205
+ ]
2206
+ result = api.video.set_remote(videos, links)
2207
+ """
2208
+
2209
+ if len(videos) == 0:
2210
+ raise ValueError("List of videos can not be empty.")
2211
+
2212
+ if len(videos) != len(links):
2213
+ raise ValueError("Length of 'videos' and 'links' should be equal.")
2214
+
2215
+ videos_list = []
2216
+ for vid, lnk in zip(videos, links):
2217
+ videos_list.append({ApiField.ID: vid, ApiField.LINK: lnk})
2218
+
2219
+ data = {ApiField.VIDEOS: videos_list, ApiField.CLEAR_LOCAL_DATA_SOURCE: True}
2220
+ r = self._api.post("videos.update.links", data)
2221
+ return r.json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.198
3
+ Version: 6.73.199
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -24,15 +24,15 @@ supervisely/api/agent_api.py,sha256=ShWAIlXcWXcyI9fqVuP5GZVCigCMJmjnvdGUfLspD6Y,
24
24
  supervisely/api/annotation_api.py,sha256=Eps-Jf10_SQFy7DjghUnyiM6DcVJBsamHDViRAXv2fg,51403
25
25
  supervisely/api/api.py,sha256=u2T0yOQ-tUnP3iIzFu8zEQb4t_EDrXQSKnaXHCvFDyg,36514
26
26
  supervisely/api/app_api.py,sha256=zX3Iy16RuGwtcLZfMs3YfUFc93S9AVGb3W_eINeMjOs,66729
27
- supervisely/api/dataset_api.py,sha256=BADdxjVEfgZEixYcyt1veg6BIdiKvqIkMRtOUGp2xwA,37536
27
+ supervisely/api/dataset_api.py,sha256=5di6OiBti9AMTd2bfjkHnO4uocEzAUPDra-P6qG9aQc,37542
28
28
  supervisely/api/file_api.py,sha256=ouqhqlFbBjxbpuf1hvUAJPIfabnxIzHqL3JDu-lUmHI,53094
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=hGpUEOOPEBbXQOyhKj1nklL3nbSPuyMdmu5CimIXTJc,134355
31
+ supervisely/api/image_api.py,sha256=1AgY6Tk-0rJf1miR5kN1YSkQ7EVihgBnPWbP-Ic55NI,135790
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=odnzZjp29yM16Gq-FYkv-OA4WFMNJCLFo4qSikW2A7c,56280
35
- supervisely/api/module_api.py,sha256=Yad0J4x_l4igI83uaWg0uKd7n4PSRts-WxNiJF2E5D8,39346
35
+ supervisely/api/module_api.py,sha256=nFMvROP7XB6_BVSsP9W_eEKiTlcGYxezyMCV4pdqk8k,39410
36
36
  supervisely/api/neural_network_api.py,sha256=ktPVRO4Jeulougio8F0mioJJHwRJcX250Djp1wBoQ9c,7620
37
37
  supervisely/api/object_class_api.py,sha256=-rQcKwhBw3iL9KNH9c1ROgoimgWM1ls6Wi_tb1R-MzY,7683
38
38
  supervisely/api/plugin_api.py,sha256=TlfrosdRuYG4NUxk92QiQoVaOdztFspPpygyVa3M3zk,5283
@@ -64,7 +64,7 @@ supervisely/api/pointcloud/pointcloud_object_api.py,sha256=bO1USWb9HAywG_CW4CDu1
64
64
  supervisely/api/pointcloud/pointcloud_tag_api.py,sha256=iShtr052nOElxsyMyZEUT2vypEm6kP00gnP13ABX24A,4691
65
65
  supervisely/api/video/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  supervisely/api/video/video_annotation_api.py,sha256=6lG2Y7VvxEPNY9x18rg4M9InAoAHq0_9W8RHPaln86E,6361
67
- supervisely/api/video/video_api.py,sha256=mpYrVdBhDgMNM-pndsRLJzzUQsEk4Hgc9eImiN5B8zs,77311
67
+ supervisely/api/video/video_api.py,sha256=caqot3B1qBV5XGE_KnJ9Nluj1kF7SkiD9fRA9FxxJ2g,78790
68
68
  supervisely/api/video/video_figure_api.py,sha256=quksohjhgrK2l2-PtbbNE99fOW6uWXX59-_4xfc-I-k,6244
69
69
  supervisely/api/video/video_frame_api.py,sha256=4GwSI4xdCNYEUvTqzKc-Ewd44fw5zqkFoD24jrrN_aY,10214
70
70
  supervisely/api/video/video_object_api.py,sha256=IC0NP8EoIT_d3xxDRgz2cA3ixSiuJ5ymy64eS-RfmDM,2227
@@ -953,9 +953,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
953
953
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
954
954
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
955
955
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
956
- supervisely-6.73.198.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
957
- supervisely-6.73.198.dist-info/METADATA,sha256=jWsd66kKtOmaSqEFAkA_2R5QgWIFlOemlvSWgVQIaxs,33077
958
- supervisely-6.73.198.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
959
- supervisely-6.73.198.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
960
- supervisely-6.73.198.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
961
- supervisely-6.73.198.dist-info/RECORD,,
956
+ supervisely-6.73.199.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
957
+ supervisely-6.73.199.dist-info/METADATA,sha256=P_MB6rbtG8u9TNCV7jK84uRVaC4JRTPZWKkziTL8VdE,33077
958
+ supervisely-6.73.199.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
959
+ supervisely-6.73.199.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
960
+ supervisely-6.73.199.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
961
+ supervisely-6.73.199.dist-info/RECORD,,