dtlpy 1.109.19__py3-none-any.whl → 1.110.3__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.
dtlpy/__version__.py CHANGED
@@ -1 +1 @@
1
- version = '1.109.19'
1
+ version = '1.110.3'
@@ -125,6 +125,13 @@ class Segmentation(BaseAnnotationDefinition):
125
125
  return image
126
126
 
127
127
  def to_coordinates(self, color=None):
128
+ """
129
+ Convert segmentation to coordinates
130
+ `self._color` is ignored if `color` is provided
131
+
132
+ :param color: color
133
+ :return: coordinates
134
+ """
128
135
  need_encode = False
129
136
  if color is not None and self._color is not None:
130
137
  # if input color is not the same as the annotation's color - need to re-encode
@@ -132,10 +139,11 @@ class Segmentation(BaseAnnotationDefinition):
132
139
  need_encode = True
133
140
 
134
141
  if need_encode or self._coordinates is None:
135
- if self._color is not None:
136
- color = self._color
137
- else:
138
- color = (255, 255, 255)
142
+ if color is None:
143
+ if self._color is not None:
144
+ color = self._color
145
+ else:
146
+ color = (255, 255, 255)
139
147
  max_val = np.max(self.geo)
140
148
  if max_val > 1:
141
149
  self.geo = self.geo / max_val
@@ -5,6 +5,7 @@ import enum
5
5
  import json
6
6
  import io
7
7
  import os
8
+ from typing import List, Optional
8
9
 
9
10
  from concurrent.futures import ThreadPoolExecutor
10
11
  from .. import entities, repositories
@@ -152,14 +153,17 @@ class PromptItem:
152
153
  self.assistant_prompts = list()
153
154
  # list of assistant (annotations) prompts in the prompt item
154
155
  # Dataloop Item
155
- self._messages = []
156
156
  self._item: entities.Item = item
157
+ self._messages = []
157
158
  self._annotations: entities.AnnotationCollection = None
158
159
  if item is not None:
160
+ if 'json' not in item.mimetype or item.system.get('shebang', dict()).get('dltype') != 'prompt':
161
+ raise ValueError('Expecting a json item with system.shebang.dltype = prompt')
159
162
  self._items = item.items
160
163
  self.fetch()
161
164
  else:
162
165
  self._items = repositories.Items(client_api=client_api)
166
+
163
167
  # to avoid broken stream of json files - DAT-75653
164
168
  self._items._client_api.default_headers['x-dl-sanitize'] = '0'
165
169
 
@@ -454,5 +458,43 @@ class PromptItem:
454
458
  """
455
459
  if self._item is not None:
456
460
  self._item._Item__update_item_binary(_json=self.to_json())
461
+ self._item = self._item.update()
457
462
  else:
458
463
  raise ValueError('Cannot update PromptItem without an item.')
464
+
465
+ # Properties
466
+ @property
467
+ def item(self) -> Optional['entities.Item']:
468
+ """
469
+ Get the underlying Item object.
470
+
471
+ :return: The Item object associated with this PromptItem, or None.
472
+ :rtype: Optional[dtlpy.entities.Item]
473
+ """
474
+ return self._item
475
+
476
+ @item.setter
477
+ def item(self, item: Optional['entities.Item']):
478
+ """
479
+ Set the underlying Item object.
480
+
481
+ :param item: The Item object to associate with this PromptItem, or None.
482
+ :type item: Optional[dtlpy.entities.Item]
483
+ """
484
+ if item is not None and not isinstance(item, entities.Item):
485
+ raise ValueError(f"Expected dtlpy.entities.Item or None, got {type(item)}")
486
+ self._item = item
487
+
488
+
489
+ @property
490
+ def metadata(self) -> dict:
491
+ """
492
+ Get the metadata from the underlying Item object.
493
+
494
+ :return: Metadata dictionary from the item, or empty dict if no item exists.
495
+ :rtype: dict
496
+ """
497
+ if self._item is not None:
498
+ return self._item.metadata
499
+ else:
500
+ raise ValueError('No item found, cannot get metadata, to set item use prompt_item.item = item')
@@ -762,7 +762,7 @@ class Models:
762
762
  """
763
763
  payload = dict()
764
764
  if service_config is not None:
765
- payload['serviceConfig'] = service_config
765
+ payload['serviceConfig'] = service_config if not service_config.get("serviceConfig") else service_config.get("serviceConfig")
766
766
  success, response = self._client_api.gen_request(req_type="post",
767
767
  path=f"/ml/models/{model_id}/deploy",
768
768
  json_req=payload)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dtlpy
3
- Version: 1.109.19
3
+ Version: 1.110.3
4
4
  Summary: SDK and CLI for Dataloop platform
5
5
  Home-page: https://github.com/dataloop-ai/dtlpy
6
6
  Author: Dataloop Team
@@ -1,5 +1,5 @@
1
1
  dtlpy/__init__.py,sha256=n86boFpXWXPLjSXZMmWCageGjBumPjWxRv3srysrplk,20338
2
- dtlpy/__version__.py,sha256=eIgLM-gZdxM-jhKIfBZi2m6DL_vSoUQ556FqCWu8aCs,21
2
+ dtlpy/__version__.py,sha256=CTldC486s3qtTiQLoG-At-M1MH8bU2fAGxa87T99cJU,20
3
3
  dtlpy/exceptions.py,sha256=EQCKs3pwhwZhgMByQN3D3LpWpdxwcKPEEt-bIaDwURM,2871
4
4
  dtlpy/new_instance.py,sha256=tUCzBGaSpm9GTjRuwOkFgo3A8vopUQ-baltdJss3XlI,9964
5
5
  dtlpy/assets/__init__.py,sha256=D_hAa6NM8Zoy32sF_9b7m0b7I-BQEyBFg8-9Tg2WOeo,976
@@ -84,7 +84,7 @@ dtlpy/entities/paged_entities.py,sha256=grNjt2FYg4gKBlVRDkztI1BPOI4JoGeyjvmOW3Bn
84
84
  dtlpy/entities/pipeline.py,sha256=JtWGoCUhVszOVkBNK43fbTt446fkND4wH-Y-fN_llww,20851
85
85
  dtlpy/entities/pipeline_execution.py,sha256=EQhW4W_G1bIPShYbJSAT--1WNQuvxVQbcQ_MCHIX0KI,9938
86
86
  dtlpy/entities/project.py,sha256=ZUx8zA3mr6N145M62R3UDPCCzO1vxfyWO6vjES-bO-g,14653
87
- dtlpy/entities/prompt_item.py,sha256=qXDK2IWVKszm7gpqcgCE51SSf4IUTNFirq40qszBYw8,19566
87
+ dtlpy/entities/prompt_item.py,sha256=xROCKogJqEgxodXF-mQAJHbNuyoXA0ul55CKDX5a-2Q,21023
88
88
  dtlpy/entities/recipe.py,sha256=SX0T7gw-_9Cs2FZyC_htIxQd7CwDwb2zA3SqB37vymM,11917
89
89
  dtlpy/entities/reflect_dict.py,sha256=2NaSAL-CO0T0FYRYFQlaSpbsoLT2Q18AqdHgQSLX5Y4,3273
90
90
  dtlpy/entities/resource_execution.py,sha256=1HuVV__U4jAUOtOkWlWImnM3Yts8qxMSAkMA9sBhArY,5033
@@ -113,7 +113,7 @@ dtlpy/entities/annotation_definitions/polygon.py,sha256=gI28yzvYgDj_js6bU9djAzsw
113
113
  dtlpy/entities/annotation_definitions/polyline.py,sha256=8Rid2MxwImHM3-fM-0QjzZZE41-dIpdF45ut8KwNxtA,3237
114
114
  dtlpy/entities/annotation_definitions/pose.py,sha256=Ah4vtcYTEieDHgaZXQGy4KPEZbvTID0CuWHmRiLz3hw,2527
115
115
  dtlpy/entities/annotation_definitions/ref_image.py,sha256=uDXjZPRSU9rjnzkjklUp7P7Bx9ODeBz87vzjz_LHGqA,2826
116
- dtlpy/entities/annotation_definitions/segmentation.py,sha256=CEHP9iz3Xc8Wu-A8Wy7C0Zcmwo_9OQYC9u4T-XDW5ww,7354
116
+ dtlpy/entities/annotation_definitions/segmentation.py,sha256=Fw0nVJsamcyag9ABzXo-gJgSpozB-sdylYMDfQOA770,7590
117
117
  dtlpy/entities/annotation_definitions/subtitle.py,sha256=cfNi-19KVYInmxsy5usvjDZdyGgH1Mgss_SiJhT9Bn0,1005
118
118
  dtlpy/entities/annotation_definitions/text.py,sha256=r-7laetbKvXL7hSG7AsRl9B5ZVYopUm5vB7rxgkmrCo,2559
119
119
  dtlpy/entities/annotation_definitions/undefined_annotation.py,sha256=XUocNEnmWst4D0erlf8GBAjedgFLy0K6K4fr2p_dNas,1882
@@ -176,7 +176,7 @@ dtlpy/repositories/features.py,sha256=A_RqTJxzjTh-Wbm0uXaoTNyHSfCLbeiH38iB11p2if
176
176
  dtlpy/repositories/integrations.py,sha256=gSgaVp4MkcdrJMnXVr_fl4xrzhfJba8BFbBJTuJPwXc,18159
177
177
  dtlpy/repositories/items.py,sha256=S1OWZ6s8AbVXMiLtCfBBiYPMG8OLqdUhKMHuZWE3bnU,40029
178
178
  dtlpy/repositories/messages.py,sha256=QU0Psckg6CA_Tlw9AVxqa-Ay1fRM4n269sSIJkH9o7E,3066
179
- dtlpy/repositories/models.py,sha256=IekNMcnuKVaAVTJf2AJv6YvX5qCd9kkSl4ETPMWP4Zc,38213
179
+ dtlpy/repositories/models.py,sha256=uYVw319dMgVoXReb9VKl0b3v0_kgetROQaf56cvgwqs,38297
180
180
  dtlpy/repositories/nodes.py,sha256=xXJm_YA0vDUn0dVvaGeq6ORM0vI3YXvfjuylvGRtkxo,3061
181
181
  dtlpy/repositories/ontologies.py,sha256=unnMhD2isR9DVE5S8Fg6fSDf1ZZ5Xemxxufx4LEUT3w,19577
182
182
  dtlpy/repositories/organizations.py,sha256=6ijUDFbsogfRul1g_vUB5AZOb41MRmV5NhNU7WLHt3A,22825
@@ -226,9 +226,9 @@ dtlpy/utilities/reports/report.py,sha256=3nEsNnIWmdPEsd21nN8vMMgaZVcPKn9iawKTTeO
226
226
  dtlpy/utilities/videos/__init__.py,sha256=SV3w51vfPuGBxaMeNemx6qEMHw_C4lLpWNGXMvdsKSY,734
227
227
  dtlpy/utilities/videos/video_player.py,sha256=LCxg0EZ_DeuwcT7U_r7MRC6Q19s0xdFb7x5Gk39PRms,24072
228
228
  dtlpy/utilities/videos/videos.py,sha256=Dj916B4TQRIhI7HZVevl3foFrCsPp0eeWwvGbgX3-_A,21875
229
- dtlpy-1.109.19.data/scripts/dlp,sha256=-F0vSCWuSOOtgERAtsPMPyMmzitjhB7Yeftg_PDlDjw,10
230
- dtlpy-1.109.19.data/scripts/dlp.bat,sha256=QOvx8Dlx5dUbCTMpwbhOcAIXL1IWmgVRSboQqDhIn3A,37
231
- dtlpy-1.109.19.data/scripts/dlp.py,sha256=tEokRaDINISXnq8yNx_CBw1qM5uwjYiZoJOYGqWB3RU,4267
229
+ dtlpy-1.110.3.data/scripts/dlp,sha256=-F0vSCWuSOOtgERAtsPMPyMmzitjhB7Yeftg_PDlDjw,10
230
+ dtlpy-1.110.3.data/scripts/dlp.bat,sha256=QOvx8Dlx5dUbCTMpwbhOcAIXL1IWmgVRSboQqDhIn3A,37
231
+ dtlpy-1.110.3.data/scripts/dlp.py,sha256=tEokRaDINISXnq8yNx_CBw1qM5uwjYiZoJOYGqWB3RU,4267
232
232
  tests/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
233
233
  tests/assets/models_flow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
234
234
  tests/assets/models_flow/failedmain.py,sha256=n8F4eu_u7JPrJ1zedbJPvv9e3lHb3ihoErqrBIcseEc,1847
@@ -236,9 +236,9 @@ tests/assets/models_flow/main.py,sha256=vnDKyVZaae2RFpvwS22Hzi6Dt2LJerH4yQrmKtaT
236
236
  tests/assets/models_flow/main_model.py,sha256=Hl_tv7Q6KaRL3yLkpUoLMRqu5-ab1QsUYPL6RPEoamw,2042
237
237
  tests/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
238
238
  tests/features/environment.py,sha256=JcM956BxLBRvDqy6Kr1Nxd1FY_gxbE6XztZBVBMCGYM,18897
239
- dtlpy-1.109.19.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
240
- dtlpy-1.109.19.dist-info/METADATA,sha256=S1lFH5dyjapOJM45lU0Xs_kPQJLzlbL5QPjxwQDLqss,5470
241
- dtlpy-1.109.19.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
242
- dtlpy-1.109.19.dist-info/entry_points.txt,sha256=C4PyKthCs_no88HU39eioO68oei64STYXC2ooGZTc4Y,43
243
- dtlpy-1.109.19.dist-info/top_level.txt,sha256=ZWuLmQGUOtWAdgTf4Fbx884w1o0vBYq9dEc1zLv9Mig,12
244
- dtlpy-1.109.19.dist-info/RECORD,,
239
+ dtlpy-1.110.3.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
240
+ dtlpy-1.110.3.dist-info/METADATA,sha256=fDBFNra1w6f_hs3IdqJy7T-ZfvcfFXvG72-7cjMNdK8,5469
241
+ dtlpy-1.110.3.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
242
+ dtlpy-1.110.3.dist-info/entry_points.txt,sha256=C4PyKthCs_no88HU39eioO68oei64STYXC2ooGZTc4Y,43
243
+ dtlpy-1.110.3.dist-info/top_level.txt,sha256=ZWuLmQGUOtWAdgTf4Fbx884w1o0vBYq9dEc1zLv9Mig,12
244
+ dtlpy-1.110.3.dist-info/RECORD,,
File without changes