dtlpy 1.90.37__py3-none-any.whl → 1.90.39__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 +1 -1
- dtlpy/entities/base_entity.py +0 -1
- dtlpy/services/api_client.py +3 -3
- {dtlpy-1.90.37.dist-info → dtlpy-1.90.39.dist-info}/METADATA +1 -1
- {dtlpy-1.90.37.dist-info → dtlpy-1.90.39.dist-info}/RECORD +17 -12
- tests/assets/__init__.py +0 -0
- tests/assets/models_flow/__init__.py +0 -0
- tests/assets/models_flow/failedmain.py +52 -0
- tests/assets/models_flow/main.py +51 -0
- tests/assets/models_flow/main_model.py +54 -0
- {dtlpy-1.90.37.data → dtlpy-1.90.39.data}/scripts/dlp +0 -0
- {dtlpy-1.90.37.data → dtlpy-1.90.39.data}/scripts/dlp.bat +0 -0
- {dtlpy-1.90.37.data → dtlpy-1.90.39.data}/scripts/dlp.py +0 -0
- {dtlpy-1.90.37.dist-info → dtlpy-1.90.39.dist-info}/LICENSE +0 -0
- {dtlpy-1.90.37.dist-info → dtlpy-1.90.39.dist-info}/WHEEL +0 -0
- {dtlpy-1.90.37.dist-info → dtlpy-1.90.39.dist-info}/entry_points.txt +0 -0
- {dtlpy-1.90.37.dist-info → dtlpy-1.90.39.dist-info}/top_level.txt +0 -0
dtlpy/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = '1.90.
|
|
1
|
+
version = '1.90.39'
|
dtlpy/entities/base_entity.py
CHANGED
dtlpy/services/api_client.py
CHANGED
|
@@ -981,7 +981,7 @@ class ApiClient:
|
|
|
981
981
|
|
|
982
982
|
# prepare request
|
|
983
983
|
if is_dataloop:
|
|
984
|
-
full_url = self.
|
|
984
|
+
full_url = self.__base_gate_url + path
|
|
985
985
|
headers_req = self._build_request_headers(headers=headers)
|
|
986
986
|
else:
|
|
987
987
|
full_url = path
|
|
@@ -1018,7 +1018,7 @@ class ApiClient:
|
|
|
1018
1018
|
timeout=timeout) as session:
|
|
1019
1019
|
try:
|
|
1020
1020
|
async with session._request(request=session._client.request,
|
|
1021
|
-
url=self.
|
|
1021
|
+
url=self.__base_gate_url + path,
|
|
1022
1022
|
method=req_type,
|
|
1023
1023
|
json=json_req,
|
|
1024
1024
|
data=data,
|
|
@@ -1135,7 +1135,7 @@ class ApiClient:
|
|
|
1135
1135
|
form.add_field('file', AsyncUploadStream(buffer=to_upload,
|
|
1136
1136
|
callback=callback,
|
|
1137
1137
|
name=uploaded_filename))
|
|
1138
|
-
url = '{}?mode={}'.format(self.
|
|
1138
|
+
url = '{}?mode={}'.format(self.__base_gate_url + remote_url, mode)
|
|
1139
1139
|
|
|
1140
1140
|
# use SSL context
|
|
1141
1141
|
ssl_context = None
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
dtlpy/__init__.py,sha256=pJiyuUv6L9bWnW1vcknHAjYP-pouMCYzzexyDKxELoI,20127
|
|
2
|
-
dtlpy/__version__.py,sha256=
|
|
2
|
+
dtlpy/__version__.py,sha256=BcmejWGgARVAkaNKsamesQsOmoijL9t0WK_6O0DCjuU,20
|
|
3
3
|
dtlpy/exceptions.py,sha256=EQCKs3pwhwZhgMByQN3D3LpWpdxwcKPEEt-bIaDwURM,2871
|
|
4
4
|
dtlpy/new_instance.py,sha256=_-F1NTJgGCCHnW68eIexwq7leLGTCHcPxodbw9mfasI,5555
|
|
5
5
|
dtlpy/assets/__init__.py,sha256=D_hAa6NM8Zoy32sF_9b7m0b7I-BQEyBFg8-9Tg2WOeo,976
|
|
@@ -55,7 +55,7 @@ dtlpy/entities/app.py,sha256=7i7xDRnyN2PgJ_oUNfhkTh7CxRHaXf-uGS2eX_DjAAg,6295
|
|
|
55
55
|
dtlpy/entities/app_module.py,sha256=0UiAbBX1q8iEImi3nY7ySWZZHoRRwu0qUXmyXmgVAc4,3645
|
|
56
56
|
dtlpy/entities/artifact.py,sha256=wtLtBuidOPbnba0ok40JyunCCIBGbAl4bP_ebK39Kk4,5711
|
|
57
57
|
dtlpy/entities/assignment.py,sha256=LTUxE2ZB5iZSbSeoroHe5P7Kv6E_K2b5cdY-7TZ4HFE,14346
|
|
58
|
-
dtlpy/entities/base_entity.py,sha256=
|
|
58
|
+
dtlpy/entities/base_entity.py,sha256=II40doslcKJ97wtTIwhSYCNA9Lqvb5Y9LkiYNIdqDpM,7553
|
|
59
59
|
dtlpy/entities/bot.py,sha256=is3NUCnPg56HSjsHIvFcVkymValMqDV0uHRDC1Ib-ds,3819
|
|
60
60
|
dtlpy/entities/codebase.py,sha256=pwRkAq2GV0wvmzshg89IAmE-0I2Wsy_-QNOu8OV8uqc,8999
|
|
61
61
|
dtlpy/entities/command.py,sha256=dv7w0GfTqq4OeLUoAUElYCdOrvE2Lp9Cx-XdA9N4314,4976
|
|
@@ -194,7 +194,7 @@ dtlpy/repositories/uploader.py,sha256=PzEq4yHsxJT1lv_wYGS-gh7Wmu37TA-14ww_r-6HBr
|
|
|
194
194
|
dtlpy/repositories/webhooks.py,sha256=IIpxOJ-7KeQp1TY9aJZz-FuycSjAoYx0TDk8z86KAK8,9033
|
|
195
195
|
dtlpy/services/__init__.py,sha256=VfVJy2otIrDra6i7Sepjyez2ujiE6171ChQZp-YgxsM,904
|
|
196
196
|
dtlpy/services/aihttp_retry.py,sha256=tgntZsAY0dW9v08rkjX1T5BLNDdDd8svtgn7nH8DSGU,5022
|
|
197
|
-
dtlpy/services/api_client.py,sha256=
|
|
197
|
+
dtlpy/services/api_client.py,sha256=bMmLKQ0BbzLzEsEcZe-RSADjkRjTEoWJiQIQvo8h2L4,66127
|
|
198
198
|
dtlpy/services/api_reference.py,sha256=cW-B3eoi9Xs3AwI87_Kr6GV_E6HPoC73aETFaGz3A-0,1515
|
|
199
199
|
dtlpy/services/async_utils.py,sha256=lfpkTkRUvQoMTxaRZBHbPt5e43qdvpCGDe_-KcY2Jps,2810
|
|
200
200
|
dtlpy/services/calls_counter.py,sha256=gr0io5rIsO5-7Cgc8neA1vK8kUtYhgFPmDQ2jXtiZZs,1036
|
|
@@ -222,14 +222,19 @@ dtlpy/utilities/reports/report.py,sha256=3nEsNnIWmdPEsd21nN8vMMgaZVcPKn9iawKTTeO
|
|
|
222
222
|
dtlpy/utilities/videos/__init__.py,sha256=SV3w51vfPuGBxaMeNemx6qEMHw_C4lLpWNGXMvdsKSY,734
|
|
223
223
|
dtlpy/utilities/videos/video_player.py,sha256=LCxg0EZ_DeuwcT7U_r7MRC6Q19s0xdFb7x5Gk39PRms,24072
|
|
224
224
|
dtlpy/utilities/videos/videos.py,sha256=Dj916B4TQRIhI7HZVevl3foFrCsPp0eeWwvGbgX3-_A,21875
|
|
225
|
-
dtlpy-1.90.
|
|
226
|
-
dtlpy-1.90.
|
|
227
|
-
dtlpy-1.90.
|
|
225
|
+
dtlpy-1.90.39.data/scripts/dlp,sha256=-F0vSCWuSOOtgERAtsPMPyMmzitjhB7Yeftg_PDlDjw,10
|
|
226
|
+
dtlpy-1.90.39.data/scripts/dlp.bat,sha256=QOvx8Dlx5dUbCTMpwbhOcAIXL1IWmgVRSboQqDhIn3A,37
|
|
227
|
+
dtlpy-1.90.39.data/scripts/dlp.py,sha256=tEokRaDINISXnq8yNx_CBw1qM5uwjYiZoJOYGqWB3RU,4267
|
|
228
|
+
tests/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
|
+
tests/assets/models_flow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
230
|
+
tests/assets/models_flow/failedmain.py,sha256=n8F4eu_u7JPrJ1zedbJPvv9e3lHb3ihoErqrBIcseEc,1847
|
|
231
|
+
tests/assets/models_flow/main.py,sha256=87O3-JaWcC6m_kA39sqPhX70_VCBzzbLWmX2YQFilJw,1873
|
|
232
|
+
tests/assets/models_flow/main_model.py,sha256=Hl_tv7Q6KaRL3yLkpUoLMRqu5-ab1QsUYPL6RPEoamw,2042
|
|
228
233
|
tests/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
234
|
tests/features/environment.py,sha256=V0FuAjbwiN1ddlJrCjjGSgPrU9TEQWraZkp1E7QDzdQ,13849
|
|
230
|
-
dtlpy-1.90.
|
|
231
|
-
dtlpy-1.90.
|
|
232
|
-
dtlpy-1.90.
|
|
233
|
-
dtlpy-1.90.
|
|
234
|
-
dtlpy-1.90.
|
|
235
|
-
dtlpy-1.90.
|
|
235
|
+
dtlpy-1.90.39.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
236
|
+
dtlpy-1.90.39.dist-info/METADATA,sha256=Lbu5Y6VhyT-lUBvB0W3mhwE9MVt1DWrRu-sBbZMY2tI,2976
|
|
237
|
+
dtlpy-1.90.39.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
238
|
+
dtlpy-1.90.39.dist-info/entry_points.txt,sha256=C4PyKthCs_no88HU39eioO68oei64STYXC2ooGZTc4Y,43
|
|
239
|
+
dtlpy-1.90.39.dist-info/top_level.txt,sha256=ZWuLmQGUOtWAdgTf4Fbx884w1o0vBYq9dEc1zLv9Mig,12
|
|
240
|
+
dtlpy-1.90.39.dist-info/RECORD,,
|
tests/assets/__init__.py
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
import dtlpy as dl
|
|
4
|
+
import logging
|
|
5
|
+
import os
|
|
6
|
+
import random
|
|
7
|
+
|
|
8
|
+
logger = logging.getLogger('dummy-adapter')
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dl.Package.decorators.module(name='model-adapter',
|
|
12
|
+
description='Model Adapter for Dummy Model',
|
|
13
|
+
init_inputs={'model_entity': dl.Model})
|
|
14
|
+
class ModelAdapter(dl.BaseModelAdapter):
|
|
15
|
+
"""
|
|
16
|
+
Dummy Model adapter using pytorch.
|
|
17
|
+
The class bind Dataloop model and model entities with model code implementation
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, model_entity=None):
|
|
21
|
+
super(ModelAdapter, self).__init__(model_entity=model_entity)
|
|
22
|
+
|
|
23
|
+
def load(self, local_path, **kwargs):
|
|
24
|
+
logger.info("Loaded model")
|
|
25
|
+
|
|
26
|
+
def save(self, local_path, **kwargs):
|
|
27
|
+
logger.info("Saved model")
|
|
28
|
+
|
|
29
|
+
def train(self, data_path, output_path, **kwargs):
|
|
30
|
+
logger.info("training")
|
|
31
|
+
raise Exception("Failed to train")
|
|
32
|
+
|
|
33
|
+
def predict(self, batch, **kwargs):
|
|
34
|
+
batch_annotations = list()
|
|
35
|
+
|
|
36
|
+
for img in batch:
|
|
37
|
+
collection = dl.AnnotationCollection()
|
|
38
|
+
for index in range(5):
|
|
39
|
+
collection.add(
|
|
40
|
+
annotation_definition=dl.Box(label=self.model_entity.labels[index], top=index * 10, left=index * 10,
|
|
41
|
+
bottom=index * 10 + 10, right=index * 10 + 10),
|
|
42
|
+
model_info={'name': "test-model",
|
|
43
|
+
'confidence': 0.5,
|
|
44
|
+
'model_id': self.model_entity.id,
|
|
45
|
+
'dataset_id': self.model_entity.dataset_id})
|
|
46
|
+
logger.debug("Predicted {} ({})".format(str(index), index * 0.1))
|
|
47
|
+
batch_annotations.append(collection)
|
|
48
|
+
|
|
49
|
+
return batch_annotations
|
|
50
|
+
|
|
51
|
+
def convert_from_dtlpy(self, data_path, **kwargs):
|
|
52
|
+
logger.info("convert_from_dtlpy")
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import dtlpy as dl
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import random
|
|
5
|
+
|
|
6
|
+
logger = logging.getLogger('dummy-adapter')
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dl.Package.decorators.module(name='model-adapter',
|
|
10
|
+
description='Model Adapter for Dummy Model',
|
|
11
|
+
init_inputs={'model_entity': dl.Model})
|
|
12
|
+
class ModelAdapter(dl.BaseModelAdapter):
|
|
13
|
+
"""
|
|
14
|
+
Dummy Model adapter using pytorch.
|
|
15
|
+
The class bind Dataloop model and model entities with model code implementation
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(self, model_entity=None):
|
|
19
|
+
super(ModelAdapter, self).__init__(model_entity=model_entity)
|
|
20
|
+
|
|
21
|
+
def load(self, local_path, **kwargs):
|
|
22
|
+
logger.info("Loaded model")
|
|
23
|
+
|
|
24
|
+
def save(self, local_path, **kwargs):
|
|
25
|
+
logger.info("Saved model")
|
|
26
|
+
|
|
27
|
+
def train(self, data_path, output_path, **kwargs):
|
|
28
|
+
logger.info("model training")
|
|
29
|
+
print(self.model_entity.id)
|
|
30
|
+
|
|
31
|
+
def predict(self, batch, **kwargs):
|
|
32
|
+
logger.info("model prediction")
|
|
33
|
+
batch_annotations = list()
|
|
34
|
+
|
|
35
|
+
for img in batch:
|
|
36
|
+
collection = dl.AnnotationCollection()
|
|
37
|
+
for index in range(5):
|
|
38
|
+
collection.add(
|
|
39
|
+
annotation_definition=dl.Box(label=self.model_entity.labels[index], top=index * 10, left=index * 10,
|
|
40
|
+
bottom=index * 10 + 10, right=index * 10 + 10),
|
|
41
|
+
model_info={'name': "test-model",
|
|
42
|
+
'confidence': 0.5,
|
|
43
|
+
'model_id': self.model_entity.id,
|
|
44
|
+
'dataset_id': self.model_entity.dataset_id})
|
|
45
|
+
logger.debug("Predicted {} ({})".format(str(index), index * 0.1))
|
|
46
|
+
batch_annotations.append(collection)
|
|
47
|
+
|
|
48
|
+
return batch_annotations
|
|
49
|
+
|
|
50
|
+
def convert_from_dtlpy(self, data_path, **kwargs):
|
|
51
|
+
logger.info("convert_from_dtlpy")
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import dtlpy as dl
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import random
|
|
5
|
+
|
|
6
|
+
logger = logging.getLogger('dummy-adapter')
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dl.Package.decorators.module(name='model-adapter',
|
|
10
|
+
description='Model Adapter for Dummy Model',
|
|
11
|
+
init_inputs={'model_entity': dl.Model, "test": "String"})
|
|
12
|
+
class ModelAdapter(dl.BaseModelAdapter):
|
|
13
|
+
"""
|
|
14
|
+
Dummy Model adapter using pytorch.
|
|
15
|
+
The class bind Dataloop model and model entities with model code implementation
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(self, test, model_entity=None):
|
|
19
|
+
super(ModelAdapter, self).__init__(model_entity=model_entity)
|
|
20
|
+
self.test = test
|
|
21
|
+
|
|
22
|
+
def load(self, local_path, **kwargs):
|
|
23
|
+
logger.info("Loaded model")
|
|
24
|
+
|
|
25
|
+
def save(self, local_path, **kwargs):
|
|
26
|
+
logger.info("Saved model")
|
|
27
|
+
|
|
28
|
+
def train(self, data_path, output_path, **kwargs):
|
|
29
|
+
if self.test != 'default_value':
|
|
30
|
+
raise ValueError(f"test is not set to default_value: {self.test}")
|
|
31
|
+
logger.info("model training")
|
|
32
|
+
print(self.model_entity.id)
|
|
33
|
+
|
|
34
|
+
def predict(self, batch, **kwargs):
|
|
35
|
+
logger.info("model prediction")
|
|
36
|
+
batch_annotations = list()
|
|
37
|
+
|
|
38
|
+
for img in batch:
|
|
39
|
+
collection = dl.AnnotationCollection()
|
|
40
|
+
for index in range(5):
|
|
41
|
+
collection.add(
|
|
42
|
+
annotation_definition=dl.Box(label=self.model_entity.labels[index], top=index * 10, left=index * 10,
|
|
43
|
+
bottom=index * 10 + 10, right=index * 10 + 10),
|
|
44
|
+
model_info={'name': "test-model",
|
|
45
|
+
'confidence': 0.5,
|
|
46
|
+
'model_id': self.model_entity.id,
|
|
47
|
+
'dataset_id': self.model_entity.dataset_id})
|
|
48
|
+
logger.debug("Predicted {} ({})".format(str(index), index * 0.1))
|
|
49
|
+
batch_annotations.append(collection)
|
|
50
|
+
|
|
51
|
+
return batch_annotations
|
|
52
|
+
|
|
53
|
+
def convert_from_dtlpy(self, data_path, **kwargs):
|
|
54
|
+
logger.info("convert_from_dtlpy")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|