supervisely 6.73.405__py3-none-any.whl → 6.73.407__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.
supervisely/__init__.py CHANGED
@@ -315,4 +315,4 @@ except Exception as e:
315
315
  # If new changes in Supervisely Python SDK require upgrade of the Supervisely instance
316
316
  # set a new value for the environment variable MINIMUM_INSTANCE_VERSION_FOR_SDK, otherwise
317
317
  # users can face compatibility issues, if the instance version is lower than the SDK version.
318
- os.environ["MINIMUM_INSTANCE_VERSION_FOR_SDK"] = "6.13.00"
318
+ os.environ["MINIMUM_INSTANCE_VERSION_FOR_SDK"] = "6.14.00"
@@ -11,7 +11,7 @@ from typing_extensions import Literal
11
11
 
12
12
  from supervisely._utils import is_community, is_development, take_with_default
13
13
  from supervisely.api.module_api import ApiField
14
- from supervisely.api.task_api import TaskApi
14
+ from supervisely.api.task_api import KubernetesSettings, TaskApi
15
15
 
16
16
  # from supervisely.app.constants import DATA, STATE, CONTEXT, TEMPLATE
17
17
  STATE = "state"
@@ -1682,6 +1682,7 @@ class AppApi(TaskApi):
1682
1682
  proxy_keep_url: bool = False,
1683
1683
  module_id: Optional[int] = None,
1684
1684
  redirect_requests: Dict[str, int] = {},
1685
+ kubernetes_settings: Optional[Union[KubernetesSettings, Dict[str, Any]]] = None,
1685
1686
  ) -> SessionInfo:
1686
1687
  """Start a new application session (task).
1687
1688
 
@@ -1713,6 +1714,8 @@ class AppApi(TaskApi):
1713
1714
  :type module_id: Optional[int]
1714
1715
  :param redirect_requests: For internal usage only in Develop and Debug mode.
1715
1716
  :type redirect_requests: dict
1717
+ :param kubernetes_settings: Kubernetes settings for the task. If not specified, default settings will be used.
1718
+ :type kubernetes_settings: Optional[Union[KubernetesSettings, Dict[str, Any]]]
1716
1719
  :return: SessionInfo object with information about the started task.
1717
1720
  :rtype: SessionInfo
1718
1721
  :raises ValueError: If both app_id and module_id are not provided.
@@ -1747,6 +1750,7 @@ class AppApi(TaskApi):
1747
1750
  proxy_keep_url=proxy_keep_url,
1748
1751
  module_id=module_id,
1749
1752
  redirect_requests=redirect_requests,
1753
+ kubernetes_settings=kubernetes_settings,
1750
1754
  )
1751
1755
  if type(result) is not list:
1752
1756
  result = [result]
@@ -691,6 +691,10 @@ class ApiField:
691
691
  """"""
692
692
  UPDATE_STRATEGY = "updateStrategy"
693
693
  """"""
694
+ LOCAL_ENTITIES_COUNT = "localEntitiesCount"
695
+ """"""
696
+ REMOTE_ENTITIES_COUNT = "remoteEntitiesCount"
697
+ """"""
694
698
 
695
699
 
696
700
  def _get_single_item(items):
@@ -100,6 +100,8 @@ class ProjectInfo(NamedTuple):
100
100
  embeddings_enabled: Optional[bool] = None
101
101
  embeddings_updated_at: Optional[str] = None
102
102
  embeddings_in_progress: Optional[bool] = None
103
+ local_entities_count: Optional[int] = None
104
+ remote_entities_count: Optional[int] = None
103
105
 
104
106
  @property
105
107
  def image_preview_url(self):
@@ -177,6 +179,12 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
177
179
  team_id=2,
178
180
  import_settings={}
179
181
  version={'id': 260, 'version': 3}
182
+ created_by_id=7,
183
+ embeddings_enabled=False,
184
+ embeddings_updated_at=None,
185
+ embeddings_in_progress=False,
186
+ local_entities_count=10,
187
+ remote_entities_count=0
180
188
  )
181
189
  """
182
190
  return [
@@ -203,6 +211,8 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
203
211
  ApiField.EMBEDDINGS_ENABLED,
204
212
  ApiField.EMBEDDINGS_UPDATED_AT,
205
213
  ApiField.EMBEDDINGS_IN_PROGRESS,
214
+ ApiField.LOCAL_ENTITIES_COUNT,
215
+ ApiField.REMOTE_ENTITIES_COUNT,
206
216
  ]
207
217
 
208
218
  @staticmethod
@@ -337,6 +347,7 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
337
347
  id: int,
338
348
  expected_type: Optional[str] = None,
339
349
  raise_error: bool = False,
350
+ extra_fields: Optional[List[str]] = None
340
351
  ) -> ProjectInfo:
341
352
  """
342
353
  Get Project information by ID.
@@ -347,6 +358,8 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
347
358
  :type expected_type: ProjectType, optional
348
359
  :param raise_error: If True raise error if given name is missing in the Project, otherwise skips missing names.
349
360
  :type raise_error: bool, optional
361
+ :param extra_fields: List of extra fields to include in the response.
362
+ :type extra_fields: list[str], optional
350
363
  :raises: Error if type of project is not None and != expected type
351
364
  :return: Information about Project. See :class:`info_sequence<info_sequence>`
352
365
  :rtype: :class:`ProjectInfo`
@@ -384,7 +397,10 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
384
397
 
385
398
 
386
399
  """
387
- info = self._get_info_by_id(id, "projects.info")
400
+ fields = None
401
+ if extra_fields is not None:
402
+ fields = {ApiField.EXTRA_FIELDS: extra_fields}
403
+ info = self._get_info_by_id(id, "projects.info", fields=fields)
388
404
  self._check_project_info(info, id=id, expected_type=expected_type, raise_error=raise_error)
389
405
  return info
390
406
 
@@ -445,7 +461,14 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
445
461
  fields = [
446
462
  x
447
463
  for x in self.info_sequence()
448
- if x not in (ApiField.ITEMS_COUNT, ApiField.SETTINGS, ApiField.CREATED_BY_ID)
464
+ if x
465
+ not in (
466
+ ApiField.ITEMS_COUNT,
467
+ ApiField.SETTINGS,
468
+ ApiField.CREATED_BY_ID,
469
+ ApiField.LOCAL_ENTITIES_COUNT,
470
+ ApiField.REMOTE_ENTITIES_COUNT,
471
+ )
449
472
  ]
450
473
 
451
474
  info = super().get_info_by_name(parent_id, name, fields)
@@ -1231,7 +1254,7 @@ class ProjectApi(CloneableModuleApi, UpdateableModule, RemoveableModuleApi):
1231
1254
  incorrect_entities = api.project.validate_entities_schema(project_id)
1232
1255
 
1233
1256
  for entity in incorrect_entities:
1234
- print(entity.id, entity.name) # Output: 123456, 'image.jpg'
1257
+ print(entity["entity_id"], entity["entity_name"]) # Output: 123456, 'image.jpg'
1235
1258
  """
1236
1259
  validation_schema = self.get_validation_schema(id)
1237
1260
  if not validation_schema:
@@ -11,6 +11,7 @@ from pathlib import Path
11
11
  from typing import Any, Callable, Dict, List, Literal, NamedTuple, Optional, Union
12
12
 
13
13
  import requests
14
+ from pydantic import BaseModel, Field
14
15
  from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor
15
16
  from tqdm import tqdm
16
17
 
@@ -31,6 +32,28 @@ from supervisely.io.fs import (
31
32
  )
32
33
 
33
34
 
35
+ class KubernetesSettings(BaseModel):
36
+ """
37
+ KubernetesSettings for application resource limits and requests.
38
+ """
39
+
40
+ use_health_check: Optional[bool] = Field(None, alias="useHealthCheck")
41
+ request_cpus: Optional[int] = Field(None, alias="requestCpus")
42
+ limit_cpus: Optional[int] = Field(None, alias="limitCpus")
43
+ limit_memory_gb: Optional[int] = Field(None, alias="limitMemoryGb")
44
+ limit_shm_gb: Optional[int] = Field(None, alias="limitShmGb")
45
+ limit_storage_gb: Optional[int] = Field(None, alias="limitStorageGb")
46
+ limit_gpus: Optional[int] = Field(None, alias="limitGpus")
47
+ limit_gpu_memory_mb: Optional[int] = Field(None, alias="limitGpuMemoryMb")
48
+ limit_gpu_cores_perc: Optional[int] = Field(None, alias="limitGpuCoresPerc")
49
+
50
+ model_config = {"populate_by_name": True}
51
+
52
+ def to_dict(self) -> Dict[str, Any]:
53
+ """Convert to dict with only non-None values using aliases."""
54
+ return self.model_dump(exclude_none=True, by_alias=True)
55
+
56
+
34
57
  class TaskFinishedWithError(Exception):
35
58
  """TaskFinishedWithError"""
36
59
 
@@ -365,6 +388,7 @@ class TaskApi(ModuleApiBase, ModuleWithStatus):
365
388
  module_id: Optional[int] = None,
366
389
  redirect_requests: Optional[Dict[str, int]] = {},
367
390
  limit_by_workspace: bool = False,
391
+ kubernetes_settings: Optional[Union[KubernetesSettings, Dict[str, Any]]] = None,
368
392
  ) -> Dict[str, Any]:
369
393
  """Starts the application task on the agent.
370
394
 
@@ -401,6 +425,8 @@ class TaskApi(ModuleApiBase, ModuleWithStatus):
401
425
  :param limit_by_workspace: If set to True tasks will be only visible inside of the workspace
402
426
  with specified workspace_id.
403
427
  :type limit_by_workspace: bool, optional
428
+ :param kubernetes_settings: Kubernetes settings for the application.
429
+ :type kubernetes_settings: Union[KubernetesSettings, Dict[str, Any]], optional
404
430
  :return: Task information in JSON format.
405
431
  :rtype: Dict[str, Any]
406
432
 
@@ -439,6 +465,15 @@ class TaskApi(ModuleApiBase, ModuleWithStatus):
439
465
  ApiField.LIMIT_BY_WORKSPACE: limit_by_workspace,
440
466
  }
441
467
 
468
+ if kubernetes_settings is not None:
469
+ if isinstance(kubernetes_settings, KubernetesSettings):
470
+ kubernetes_settings = kubernetes_settings.to_dict()
471
+ if not isinstance(kubernetes_settings, dict):
472
+ raise TypeError(
473
+ f"kubernetes_settings must be a dict or an instance of KubernetesSettings, got {type(kubernetes_settings)}"
474
+ )
475
+ advanced_settings.update(kubernetes_settings)
476
+
442
477
  data = {
443
478
  ApiField.AGENT_ID: agent_id,
444
479
  # "nodeId": agent_id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.405
3
+ Version: 6.73.407
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -1,5 +1,5 @@
1
1
  supervisely/README.md,sha256=XM-DiMC6To3I9RjQZ0c61905EFRR_jnCUx2q3uNR-X8,3331
2
- supervisely/__init__.py,sha256=5wSN2Mq7CuqG9rnlbqXmRwTYUs3ARPN2LMbFZA5gAv8,11010
2
+ supervisely/__init__.py,sha256=lr0ZXE_WCeOpNo-zsynBKIhG3RaeKyXl549b6vk1nfU,11010
3
3
  supervisely/_utils.py,sha256=Wrnck4645QXRZdmMpqIRQ_t6QynEAkYaFfcialxQBIE,19157
4
4
  supervisely/function_wrapper.py,sha256=R5YajTQ0GnRp2vtjwfC9hINkzQc0JiyGsu8TER373xY,1912
5
5
  supervisely/sly_logger.py,sha256=z92Vu5hmC0GgTIJO1n6kPDayRW9__8ix8hL6poDZj-Y,6274
@@ -23,7 +23,7 @@ supervisely/api/advanced_api.py,sha256=Nd5cCnHFWc3PSUrCtENxTGtDjS37_lCHXsgXvUI3T
23
23
  supervisely/api/agent_api.py,sha256=8EQBwD6v7KLS0-xKcZ12B7mtzKwG7RRgq1fk1vaN144,8893
24
24
  supervisely/api/annotation_api.py,sha256=U6dHUIOt6Fe8XcbX1MA19z-fg91maOumJAawKG5ZJsk,82876
25
25
  supervisely/api/api.py,sha256=pEgRIWlVqDdtDjAeL_nx2Rwldm6ANwLLacm6kLnyvbE,67723
26
- supervisely/api/app_api.py,sha256=HaltkadXqel7hFBQdwsn5Qvmrx5eEqDXUu6X98nHerk,76226
26
+ supervisely/api/app_api.py,sha256=ghhBVaxca7xO9Bgy2zbexC89BJ9s0k7fVPd6-6F_Wvw,76594
27
27
  supervisely/api/constants.py,sha256=WfqIcEpRnU4Mcfb6q0njeRs2VVSoTAJaIyrqBkBjP8I,253
28
28
  supervisely/api/dataset_api.py,sha256=7idBMFL8jumWNw-wlBAbQWC09RskG-3GlidfPDukq3Q,47930
29
29
  supervisely/api/entities_collection_api.py,sha256=Be13HsfMFLmq9XpiOfQog0Y569kbUn52hXv6x5vX3Vg,22624
@@ -35,16 +35,16 @@ supervisely/api/import_storage_api.py,sha256=BDCgmR0Hv6OoiRHLCVPKt3iDxSVlQp1WrnK
35
35
  supervisely/api/issues_api.py,sha256=BqDJXmNoTzwc3xe6_-mA7FDFC5QQ-ahGbXk_HmpkSeQ,17925
36
36
  supervisely/api/labeling_job_api.py,sha256=G2_BV_WtA2lAhfw_nAQmWmv1P-pwimD0ba9GVKoGjiA,55537
37
37
  supervisely/api/labeling_queue_api.py,sha256=ilNjAL1d9NSa9yabQn6E-W26YdtooT3ZGXIFZtGnAvY,30158
38
- supervisely/api/module_api.py,sha256=Pqj_BxgHmfba0MGA5PPNU-dbSrwR4Fcyfaqnc-cKwGI,46006
38
+ supervisely/api/module_api.py,sha256=FF8fTRxdR7QbzxyntPDhmTTbnFobCq-Lcujs9DWWK98,46126
39
39
  supervisely/api/object_class_api.py,sha256=7-npNFMYjWNtSXYZg6syc6bX56_oCzDU2kFRPGQWCwA,10399
40
40
  supervisely/api/plugin_api.py,sha256=SFm0IlTTOjuHBLUMgG4d4k6U3cWJocE-SVb-f08fwMQ,5286
41
- supervisely/api/project_api.py,sha256=YMLBXbaZuuv0uzczaxwbIBGKTnXi276Cf-JPUGURb0g,88668
41
+ supervisely/api/project_api.py,sha256=UR9IQ2fMm7te50DtpFrCad1WSS6WQ_GUdXB7NA6NZ34,89642
42
42
  supervisely/api/project_class_api.py,sha256=5cyjdGPPb2tpttu5WmYoOxUNiDxqiojschkhZumF0KM,1426
43
43
  supervisely/api/remote_storage_api.py,sha256=1O4rTIwW8s9gxC00yvFuKbEMGNsa7YSRlZ8j494ARwY,17793
44
44
  supervisely/api/report_api.py,sha256=Om7CGulUbQ4BuJ16eDtz7luLe0JQNqab-LoLpUXu7YE,7123
45
45
  supervisely/api/role_api.py,sha256=c1XAU_wZg6zL4wG2R7iuS9EJOoaHHNGchxa1nYVL7yo,3047
46
46
  supervisely/api/storage_api.py,sha256=VxiflQt-SfyB1OuEOB66JsMkxCosUr4n0WHQ5if3Ltg,13039
47
- supervisely/api/task_api.py,sha256=eRDeUj9vexzJl_vQqW-DDYUkHaWfFqNg_EQI597RE0Y,36678
47
+ supervisely/api/task_api.py,sha256=5Ae3jKWgvvz_Mljk6V1UaIVqDbTvnSD6cpIJ3H3KqT0,38435
48
48
  supervisely/api/team_api.py,sha256=uPsBpDP_Ig9HDQ9Zm6Y-VboLbSYKIV9S_a1S7e4vqvo,19470
49
49
  supervisely/api/user_api.py,sha256=m29GP9tvem8P2fJZgg7DAZ9yhFdBX26ZBcWxCKdnhn4,24943
50
50
  supervisely/api/video_annotation_tool_api.py,sha256=3A9-U8WJzrTShP_n9T8U01M9FzGYdeS51CCBTzUnooo,6686
@@ -1114,9 +1114,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1114
1114
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1115
1115
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1116
1116
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1117
- supervisely-6.73.405.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1118
- supervisely-6.73.405.dist-info/METADATA,sha256=eoIZ9o5RCIOMK-EjAo_n6uRtoY4phdboCiZPjdSOPFg,35254
1119
- supervisely-6.73.405.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1120
- supervisely-6.73.405.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1121
- supervisely-6.73.405.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1122
- supervisely-6.73.405.dist-info/RECORD,,
1117
+ supervisely-6.73.407.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1118
+ supervisely-6.73.407.dist-info/METADATA,sha256=fIR2z5kCfeQzldtPPODSuq8z4QQhOoTVLgeZRZokLtU,35254
1119
+ supervisely-6.73.407.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1120
+ supervisely-6.73.407.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1121
+ supervisely-6.73.407.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1122
+ supervisely-6.73.407.dist-info/RECORD,,