supervisely 6.73.259__py3-none-any.whl → 6.73.261__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.
Potentially problematic release.
This version of supervisely might be problematic. Click here for more details.
- supervisely/annotation/tag_meta.py +63 -4
- supervisely/app/widgets/experiment_selector/experiment_selector.py +13 -0
- supervisely/app/widgets/pretrained_models_selector/pretrained_models_selector.py +62 -29
- supervisely/nn/artifacts/artifacts.py +55 -51
- supervisely/nn/inference/inference.py +24 -6
- {supervisely-6.73.259.dist-info → supervisely-6.73.261.dist-info}/METADATA +1 -1
- {supervisely-6.73.259.dist-info → supervisely-6.73.261.dist-info}/RECORD +11 -11
- {supervisely-6.73.259.dist-info → supervisely-6.73.261.dist-info}/LICENSE +0 -0
- {supervisely-6.73.259.dist-info → supervisely-6.73.261.dist-info}/WHEEL +0 -0
- {supervisely-6.73.259.dist-info → supervisely-6.73.261.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.259.dist-info → supervisely-6.73.261.dist-info}/top_level.txt +0 -0
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
"""General information about :class:`Tag<supervisely.annotation.tag.Tag>`"""
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
from copy import deepcopy
|
|
7
|
-
from
|
|
8
|
-
|
|
9
|
-
from supervisely.collection.key_indexed_collection import KeyObject
|
|
7
|
+
from typing import Dict, List, Optional
|
|
8
|
+
|
|
10
9
|
from supervisely._utils import take_with_default
|
|
10
|
+
from supervisely.collection.key_indexed_collection import KeyObject
|
|
11
|
+
from supervisely.imaging.color import _validate_color, hex2rgb, random_rgb, rgb2hex
|
|
12
|
+
from supervisely.io.json import JsonSerializable
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
class TagValueType:
|
|
@@ -47,6 +49,7 @@ class TagMetaJsonFields:
|
|
|
47
49
|
""""""
|
|
48
50
|
APPLICABLE_CLASSES = "classes"
|
|
49
51
|
""""""
|
|
52
|
+
TARGET_TYPE = "target_type" # "Scope"
|
|
50
53
|
|
|
51
54
|
|
|
52
55
|
class TagApplicableTo:
|
|
@@ -62,6 +65,19 @@ class TagApplicableTo:
|
|
|
62
65
|
""""""
|
|
63
66
|
|
|
64
67
|
|
|
68
|
+
class TagTargetType:
|
|
69
|
+
"""
|
|
70
|
+
Defines Tag target type (scope) - entities, frames or both.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
ALL = "all" # both entities and frames
|
|
74
|
+
""""""
|
|
75
|
+
FRAME_BASED = "framesOnly"
|
|
76
|
+
""""""
|
|
77
|
+
GLOBAL = "entitiesOnly"
|
|
78
|
+
""""""
|
|
79
|
+
|
|
80
|
+
|
|
65
81
|
SUPPORTED_TAG_VALUE_TYPES = [
|
|
66
82
|
TagValueType.NONE,
|
|
67
83
|
TagValueType.ANY_NUMBER,
|
|
@@ -74,6 +90,12 @@ SUPPORTED_APPLICABLE_TO = [
|
|
|
74
90
|
TagApplicableTo.OBJECTS_ONLY,
|
|
75
91
|
]
|
|
76
92
|
|
|
93
|
+
SUPPORTED_TARGET_TYPES = [
|
|
94
|
+
TagTargetType.ALL,
|
|
95
|
+
TagTargetType.FRAME_BASED,
|
|
96
|
+
TagTargetType.GLOBAL,
|
|
97
|
+
]
|
|
98
|
+
|
|
77
99
|
|
|
78
100
|
class TagMeta(KeyObject, JsonSerializable):
|
|
79
101
|
"""
|
|
@@ -95,6 +117,8 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
95
117
|
:type applicable_to: str, optional
|
|
96
118
|
:param applicable_classes: Defines applicability of Tag only to certain classes.
|
|
97
119
|
:type applicable_classes: List[str], optional
|
|
120
|
+
:param target_type: Defines Tag target type (scope) - entities, frames or both.
|
|
121
|
+
:type target_type: str, optional
|
|
98
122
|
:raises: :class:`ValueError`, if color is not list, or doesn't have exactly 3 values
|
|
99
123
|
:Usage example:
|
|
100
124
|
|
|
@@ -128,6 +152,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
128
152
|
hotkey: Optional[str] = None,
|
|
129
153
|
applicable_to: Optional[str] = None,
|
|
130
154
|
applicable_classes: Optional[List[str]] = None,
|
|
155
|
+
target_type: Optional[str] = None,
|
|
131
156
|
):
|
|
132
157
|
if value_type not in SUPPORTED_TAG_VALUE_TYPES:
|
|
133
158
|
raise ValueError(
|
|
@@ -144,12 +169,20 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
144
169
|
self._hotkey = take_with_default(hotkey, "")
|
|
145
170
|
self._applicable_to = take_with_default(applicable_to, TagApplicableTo.ALL)
|
|
146
171
|
self._applicable_classes = take_with_default(applicable_classes, [])
|
|
172
|
+
self._target_type = take_with_default(target_type, TagTargetType.ALL)
|
|
147
173
|
if self._applicable_to not in SUPPORTED_APPLICABLE_TO:
|
|
148
174
|
raise ValueError(
|
|
149
175
|
"applicable_to = {!r} is unknown, should be one of {}".format(
|
|
150
176
|
self._applicable_to, SUPPORTED_APPLICABLE_TO
|
|
151
177
|
)
|
|
152
178
|
)
|
|
179
|
+
|
|
180
|
+
if self._target_type not in SUPPORTED_TARGET_TYPES:
|
|
181
|
+
raise ValueError(
|
|
182
|
+
"target_type = {!r} is unknown, should be one of {}".format(
|
|
183
|
+
self._target_type, SUPPORTED_TARGET_TYPES
|
|
184
|
+
)
|
|
185
|
+
)
|
|
153
186
|
|
|
154
187
|
if self._value_type == TagValueType.ONEOF_STRING:
|
|
155
188
|
if self._possible_values is None:
|
|
@@ -329,6 +362,24 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
329
362
|
# Output: ['car', 'bicycle']
|
|
330
363
|
"""
|
|
331
364
|
return self._applicable_classes
|
|
365
|
+
|
|
366
|
+
@property
|
|
367
|
+
def target_type(self) -> str:
|
|
368
|
+
"""
|
|
369
|
+
Tag target type (scope) - entities, frames or both.
|
|
370
|
+
|
|
371
|
+
:return: Target type
|
|
372
|
+
:rtype: :class:`str`
|
|
373
|
+
:Usage example:
|
|
374
|
+
|
|
375
|
+
.. code-block:: python
|
|
376
|
+
|
|
377
|
+
meta_dog = sly.TagMeta('dog', sly.TagValueType.NONE, target_type=TagTargetType.FRAME_BASED)
|
|
378
|
+
|
|
379
|
+
print(meta_dog.target_type)
|
|
380
|
+
# Output: 'framesOnly'
|
|
381
|
+
"""
|
|
382
|
+
return self._target_type
|
|
332
383
|
|
|
333
384
|
def to_json(self) -> Dict:
|
|
334
385
|
"""
|
|
@@ -390,6 +441,8 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
390
441
|
jdict[TagMetaJsonFields.APPLICABLE_TYPE] = self.applicable_to
|
|
391
442
|
if self._applicable_classes is not None:
|
|
392
443
|
jdict[TagMetaJsonFields.APPLICABLE_CLASSES] = self.applicable_classes
|
|
444
|
+
if self._target_type is not None:
|
|
445
|
+
jdict[TagMetaJsonFields.TARGET_TYPE] = self.target_type
|
|
393
446
|
|
|
394
447
|
return jdict
|
|
395
448
|
|
|
@@ -445,6 +498,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
445
498
|
hotkey = data.get(TagMetaJsonFields.HOTKEY, "")
|
|
446
499
|
applicable_to = data.get(TagMetaJsonFields.APPLICABLE_TYPE, TagApplicableTo.ALL)
|
|
447
500
|
applicable_classes = data.get(TagMetaJsonFields.APPLICABLE_CLASSES, [])
|
|
501
|
+
target_type = data.get(TagMetaJsonFields.TARGET_TYPE, TagTargetType.ALL)
|
|
448
502
|
|
|
449
503
|
return cls(
|
|
450
504
|
name=name,
|
|
@@ -455,6 +509,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
455
509
|
hotkey=hotkey,
|
|
456
510
|
applicable_to=applicable_to,
|
|
457
511
|
applicable_classes=applicable_classes,
|
|
512
|
+
target_type=target_type,
|
|
458
513
|
)
|
|
459
514
|
else:
|
|
460
515
|
raise ValueError("Tags must be dict or str types.")
|
|
@@ -632,6 +687,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
632
687
|
hotkey: Optional[str] = None,
|
|
633
688
|
applicable_to: Optional[str] = None,
|
|
634
689
|
applicable_classes: Optional[List[str]] = None,
|
|
690
|
+
target_type: Optional[str] = None,
|
|
635
691
|
) -> TagMeta:
|
|
636
692
|
"""
|
|
637
693
|
Clone makes a copy of TagMeta with new fields, if fields are given, otherwise it will use original TagMeta fields.
|
|
@@ -683,6 +739,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
683
739
|
hotkey=take_with_default(hotkey, self.hotkey),
|
|
684
740
|
applicable_to=take_with_default(applicable_to, self.applicable_to),
|
|
685
741
|
applicable_classes=take_with_default(applicable_classes, self.applicable_classes),
|
|
742
|
+
target_type=take_with_default(target_type, self.target_type),
|
|
686
743
|
)
|
|
687
744
|
|
|
688
745
|
def __str__(self):
|
|
@@ -713,6 +770,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
713
770
|
"Hotkey",
|
|
714
771
|
"Applicable to",
|
|
715
772
|
"Applicable classes",
|
|
773
|
+
"Target type",
|
|
716
774
|
]
|
|
717
775
|
|
|
718
776
|
def get_row_ptable(self):
|
|
@@ -724,6 +782,7 @@ class TagMeta(KeyObject, JsonSerializable):
|
|
|
724
782
|
self.hotkey,
|
|
725
783
|
self.applicable_to,
|
|
726
784
|
self.applicable_classes,
|
|
785
|
+
self.target_type,
|
|
727
786
|
]
|
|
728
787
|
|
|
729
788
|
def _set_id(self, id: int):
|
|
@@ -19,6 +19,8 @@ from supervisely.app.widgets import (
|
|
|
19
19
|
)
|
|
20
20
|
from supervisely.io.fs import get_file_name_with_ext
|
|
21
21
|
from supervisely.nn.experiments import ExperimentInfo
|
|
22
|
+
from supervisely.nn.utils import ModelSource
|
|
23
|
+
|
|
22
24
|
|
|
23
25
|
WEIGHTS_DIR = "weights"
|
|
24
26
|
|
|
@@ -473,6 +475,17 @@ class ExperimentSelector(Widget):
|
|
|
473
475
|
full_model_files["checkpoint"] = self.get_selected_checkpoint_path()
|
|
474
476
|
return full_model_files
|
|
475
477
|
|
|
478
|
+
def get_deploy_params(self) -> Dict[str, Any]:
|
|
479
|
+
"""
|
|
480
|
+
Returns a dictionary with deploy parameters except runtime and device keys.
|
|
481
|
+
"""
|
|
482
|
+
deploy_params = {
|
|
483
|
+
"model_source": ModelSource.CUSTOM,
|
|
484
|
+
"model_files": self.get_model_files(),
|
|
485
|
+
"model_info": self.get_selected_experiment_info(),
|
|
486
|
+
}
|
|
487
|
+
return deploy_params
|
|
488
|
+
|
|
476
489
|
def set_active_row(self, row_index: int) -> None:
|
|
477
490
|
if row_index < 0 or row_index > len(self._rows) - 1:
|
|
478
491
|
raise ValueError(f'Row with index "{row_index}" does not exist')
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
from typing import Dict, List, Union
|
|
1
|
+
from typing import Dict, List, Literal, Union
|
|
2
2
|
|
|
3
3
|
from supervisely.api.api import Api
|
|
4
4
|
from supervisely.app.content import DataJson, StateJson
|
|
5
5
|
from supervisely.app.widgets import Widget
|
|
6
6
|
from supervisely.io.fs import get_file_ext
|
|
7
|
+
from supervisely.nn.utils import ModelSource
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class PretrainedModelsSelector(Widget):
|
|
@@ -134,39 +135,71 @@ class PretrainedModelsSelector(Widget):
|
|
|
134
135
|
selected_row_index = int(widget_actual_state["selectedRow"])
|
|
135
136
|
return models[selected_row_index]
|
|
136
137
|
|
|
137
|
-
def get_selected_model_params(
|
|
138
|
+
def get_selected_model_params(
|
|
139
|
+
self,
|
|
140
|
+
model_name_column: str = "Model",
|
|
141
|
+
train_version: Literal["v1", "v2"] = "v1",
|
|
142
|
+
) -> Union[Dict, None]:
|
|
138
143
|
selected_model = self.get_selected_row()
|
|
139
144
|
if selected_model is None:
|
|
140
145
|
return {}
|
|
141
146
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
147
|
+
if train_version == "v1":
|
|
148
|
+
model_name = selected_model.get(model_name_column)
|
|
149
|
+
if model_name is None:
|
|
150
|
+
raise ValueError(
|
|
151
|
+
"Could not find model name. Make sure you have column 'Model' in your models list."
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
model_meta = selected_model.get("meta")
|
|
155
|
+
if model_meta is None:
|
|
156
|
+
raise ValueError(
|
|
157
|
+
"Could not find model meta. Make sure you have key 'meta' in your models configuration list."
|
|
158
|
+
)
|
|
159
|
+
checkpoint_url = model_meta.get("weights_url")
|
|
160
|
+
if checkpoint_url is None:
|
|
161
|
+
model_files = model_meta.get("model_files")
|
|
162
|
+
if model_files is None:
|
|
163
|
+
raise ValueError(
|
|
164
|
+
"Could not find model files. Make sure you have key 'model_files' or 'weights_url' in 'meta' in your models configuration list."
|
|
165
|
+
)
|
|
166
|
+
checkpoint_url = model_files.get("checkpoint")
|
|
167
|
+
if checkpoint_url is None:
|
|
168
|
+
raise ValueError(
|
|
169
|
+
"Could not find checkpoint url. Make sure you have key 'checkpoint' in 'model_files' in 'meta' in your models configuration list."
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
checkpoint_ext = get_file_ext(checkpoint_url)
|
|
173
|
+
checkpoint_name = f"{model_name.lower()}{checkpoint_ext}"
|
|
174
|
+
|
|
175
|
+
task_type = self.get_selected_task_type()
|
|
176
|
+
model_params = {
|
|
177
|
+
"model_source": "Pretrained models",
|
|
178
|
+
"task_type": task_type,
|
|
179
|
+
"checkpoint_name": checkpoint_name,
|
|
180
|
+
"checkpoint_url": checkpoint_url,
|
|
181
|
+
}
|
|
169
182
|
|
|
183
|
+
if len(self._arch_types) > 1:
|
|
184
|
+
arch_type = self.get_selected_arch_type()
|
|
185
|
+
model_params["arch_type"] = arch_type
|
|
186
|
+
|
|
187
|
+
config_url = selected_model.get("meta", {}).get("config_url")
|
|
188
|
+
if config_url is not None:
|
|
189
|
+
model_params["config_url"] = config_url
|
|
190
|
+
elif train_version == "v2":
|
|
191
|
+
model_info = self.get_selected_row()
|
|
192
|
+
meta = model_info.get("meta")
|
|
193
|
+
if meta is None:
|
|
194
|
+
raise ValueError("key 'meta' not found in model configuration")
|
|
195
|
+
model_files = meta.get("model_files")
|
|
196
|
+
if model_files is None:
|
|
197
|
+
raise ValueError("key 'model_files' not found in key 'meta' in model configuration")
|
|
198
|
+
model_params = {
|
|
199
|
+
"model_source": ModelSource.PRETRAINED,
|
|
200
|
+
"model_info": model_info,
|
|
201
|
+
"model_files": model_files,
|
|
202
|
+
}
|
|
170
203
|
return model_params
|
|
171
204
|
|
|
172
205
|
def get_selected_row_index(self, state=StateJson()) -> Union[int, None]:
|
|
@@ -536,58 +536,62 @@ class BaseTrainArtifacts:
|
|
|
536
536
|
api: Api, train_info: TrainInfo
|
|
537
537
|
) -> ExperimentInfo:
|
|
538
538
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
if not best_checkpoint and checkpoints:
|
|
550
|
-
best_checkpoint = get_file_name_with_ext(checkpoints[-1])
|
|
551
|
-
|
|
552
|
-
task_info = api.task.get_info_by_id(train_info.task_id)
|
|
553
|
-
workspace_id = task_info["workspaceId"]
|
|
554
|
-
|
|
555
|
-
project = api.project.get_info_by_name(workspace_id, train_info.project_name)
|
|
556
|
-
project_id = project.id if project else None
|
|
557
|
-
|
|
558
|
-
model_files = {}
|
|
559
|
-
if train_info.config_path:
|
|
560
|
-
model_files["config"] = self.get_config_path(train_info.artifacts_folder).replace(
|
|
561
|
-
train_info.artifacts_folder, ""
|
|
539
|
+
try:
|
|
540
|
+
checkpoints = []
|
|
541
|
+
for chk in train_info.checkpoints:
|
|
542
|
+
if self.weights_folder:
|
|
543
|
+
checkpoints.append(join(self.weights_folder, chk.name))
|
|
544
|
+
else:
|
|
545
|
+
checkpoints.append(chk.name)
|
|
546
|
+
|
|
547
|
+
best_checkpoint = next(
|
|
548
|
+
(chk.name for chk in train_info.checkpoints if "best" in chk.name), None
|
|
562
549
|
)
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
"
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
550
|
+
if not best_checkpoint and checkpoints:
|
|
551
|
+
best_checkpoint = get_file_name_with_ext(checkpoints[-1])
|
|
552
|
+
|
|
553
|
+
task_info = api.task.get_info_by_id(train_info.task_id)
|
|
554
|
+
workspace_id = task_info["workspaceId"]
|
|
555
|
+
|
|
556
|
+
project = api.project.get_info_by_name(workspace_id, train_info.project_name)
|
|
557
|
+
project_id = project.id if project else None
|
|
558
|
+
|
|
559
|
+
model_files = {}
|
|
560
|
+
if train_info.config_path:
|
|
561
|
+
model_files["config"] = self.get_config_path(
|
|
562
|
+
train_info.artifacts_folder
|
|
563
|
+
).replace(train_info.artifacts_folder, "")
|
|
564
|
+
|
|
565
|
+
input_datetime = task_info["startedAt"]
|
|
566
|
+
parsed_datetime = datetime.strptime(input_datetime, "%Y-%m-%dT%H:%M:%S.%fZ")
|
|
567
|
+
date_time = parsed_datetime.strftime("%Y-%m-%d %H:%M:%S")
|
|
568
|
+
|
|
569
|
+
experiment_info_data = {
|
|
570
|
+
"experiment_name": f"Unknown {self.framework_name} experiment",
|
|
571
|
+
"framework_name": self.framework_name,
|
|
572
|
+
"model_name": f"Unknown {self.framework_name} model",
|
|
573
|
+
"task_type": train_info.task_type,
|
|
574
|
+
"project_id": project_id,
|
|
575
|
+
"task_id": train_info.task_id,
|
|
576
|
+
"model_files": model_files,
|
|
577
|
+
"checkpoints": checkpoints,
|
|
578
|
+
"best_checkpoint": best_checkpoint,
|
|
579
|
+
"artifacts_dir": train_info.artifacts_folder,
|
|
580
|
+
"datetime": date_time,
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
experiment_info_fields = {
|
|
584
|
+
field.name
|
|
585
|
+
for field in ExperimentInfo.__dataclass_fields__.values() # pylint: disable=no-member
|
|
586
|
+
}
|
|
587
|
+
for field in experiment_info_fields:
|
|
588
|
+
if field not in experiment_info_data:
|
|
589
|
+
experiment_info_data[field] = None
|
|
590
|
+
|
|
591
|
+
return ExperimentInfo(**experiment_info_data)
|
|
592
|
+
except Exception as e:
|
|
593
|
+
logger.warning(f"Failed to build experiment info: {e}")
|
|
594
|
+
return None
|
|
591
595
|
|
|
592
596
|
train_infos = self.get_list(sort)
|
|
593
597
|
|
|
@@ -571,7 +571,9 @@ class Inference:
|
|
|
571
571
|
) as download_pbar:
|
|
572
572
|
self.gui.download_progress.show()
|
|
573
573
|
sly_fs.download(
|
|
574
|
-
url=file_url,
|
|
574
|
+
url=file_url,
|
|
575
|
+
save_path=file_path,
|
|
576
|
+
progress=download_pbar.update,
|
|
575
577
|
)
|
|
576
578
|
local_model_files[file] = file_path
|
|
577
579
|
else:
|
|
@@ -590,6 +592,10 @@ class Inference:
|
|
|
590
592
|
for file in model_files:
|
|
591
593
|
file_url = model_files[file]
|
|
592
594
|
file_info = self.api.file.get_info_by_path(team_id, file_url)
|
|
595
|
+
if file_info is None:
|
|
596
|
+
raise FileNotFoundError(
|
|
597
|
+
f"File '{file_url}' not found in Team Files. Make sure the file exists."
|
|
598
|
+
)
|
|
593
599
|
file_size = file_info.sizeb
|
|
594
600
|
file_name = os.path.basename(file_url)
|
|
595
601
|
file_path = os.path.join(self.model_dir, file_name)
|
|
@@ -1374,7 +1380,11 @@ class Inference:
|
|
|
1374
1380
|
return result
|
|
1375
1381
|
|
|
1376
1382
|
def _inference_images_ids(
|
|
1377
|
-
self,
|
|
1383
|
+
self,
|
|
1384
|
+
api: Api,
|
|
1385
|
+
state: dict,
|
|
1386
|
+
images_ids: List[int],
|
|
1387
|
+
async_inference_request_uuid: str = None,
|
|
1378
1388
|
):
|
|
1379
1389
|
"""Inference images by ids.
|
|
1380
1390
|
If "output_project_id" in state, upload images and annotations to the output project.
|
|
@@ -1799,7 +1809,8 @@ class Inference:
|
|
|
1799
1809
|
dataset_id = _get_or_create_new_dataset(output_project_id, src_dataset_id)
|
|
1800
1810
|
image_names = [result["image_name"] for result in results]
|
|
1801
1811
|
image_infos = api.image.get_list(
|
|
1802
|
-
dataset_id,
|
|
1812
|
+
dataset_id,
|
|
1813
|
+
filters=[{"field": "name", "operator": "in", "value": image_names}],
|
|
1803
1814
|
)
|
|
1804
1815
|
meta_changed = False
|
|
1805
1816
|
anns = []
|
|
@@ -2104,7 +2115,10 @@ class Inference:
|
|
|
2104
2115
|
# Read images
|
|
2105
2116
|
if cache_project_on_model:
|
|
2106
2117
|
images_nps = []
|
|
2107
|
-
for
|
|
2118
|
+
for (
|
|
2119
|
+
dataset_id,
|
|
2120
|
+
images_infos,
|
|
2121
|
+
) in images_infos_batch_by_dataset.items():
|
|
2108
2122
|
dataset_info = datasets_infos_dict[dataset_id]
|
|
2109
2123
|
images_paths, _ = zip(
|
|
2110
2124
|
*read_from_cached_project(
|
|
@@ -2116,7 +2130,10 @@ class Inference:
|
|
|
2116
2130
|
images_nps.extend([sly_image.read(path) for path in images_paths])
|
|
2117
2131
|
else:
|
|
2118
2132
|
images_nps = []
|
|
2119
|
-
for
|
|
2133
|
+
for (
|
|
2134
|
+
dataset_id,
|
|
2135
|
+
images_infos,
|
|
2136
|
+
) in images_infos_batch_by_dataset.items():
|
|
2120
2137
|
images_nps.extend(
|
|
2121
2138
|
self.cache.download_images(
|
|
2122
2139
|
api,
|
|
@@ -2845,7 +2862,8 @@ def update_meta_and_ann(meta: ProjectMeta, ann: Annotation):
|
|
|
2845
2862
|
"""Update project meta and annotation to match each other
|
|
2846
2863
|
If obj class or tag meta from annotation conflicts with project meta
|
|
2847
2864
|
add suffix to obj class or tag meta.
|
|
2848
|
-
Return tuple of updated project meta, annotation and boolean flag if meta was changed.
|
|
2865
|
+
Return tuple of updated project meta, annotation and boolean flag if meta was changed.
|
|
2866
|
+
"""
|
|
2849
2867
|
obj_classes_suffixes = ["_nn"]
|
|
2850
2868
|
tag_meta_suffixes = ["_nn"]
|
|
2851
2869
|
ann_obj_classes = {}
|
|
@@ -15,7 +15,7 @@ supervisely/annotation/obj_class_mapper.py,sha256=aIJDoRULqcAOD2a1CQPk2OOF8k3VPP
|
|
|
15
15
|
supervisely/annotation/renamer.py,sha256=rVvNLtpfd1kKUVPgm8VlLmYSDByWjriJ92FobC4buqY,1944
|
|
16
16
|
supervisely/annotation/tag.py,sha256=m_sPgrr_ZW8HuiK7Fr2-WnHwKwez1WZtGrcdZN2DZuQ,17598
|
|
17
17
|
supervisely/annotation/tag_collection.py,sha256=MVPTzer9rLpD4O0g2XhYFUheK7-ILgwAXDJd1em3kZ8,10015
|
|
18
|
-
supervisely/annotation/tag_meta.py,sha256=
|
|
18
|
+
supervisely/annotation/tag_meta.py,sha256=2UkgRSMuQ7LXH48Ok2bJNdlK-miX54wXYAoB_as9_a0,27543
|
|
19
19
|
supervisely/annotation/tag_meta_collection.py,sha256=JY2wAo4dF47UylYeglkJtRtpVOArGjf3dXeEYIHFWP0,14491
|
|
20
20
|
supervisely/annotation/tag_meta_mapper.py,sha256=RWeTrxJ64syodyhXIRSH007bX6Hr3B45tG14YTcpwSU,1639
|
|
21
21
|
supervisely/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -250,7 +250,7 @@ supervisely/app/widgets/empty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
250
250
|
supervisely/app/widgets/empty/empty.py,sha256=fCr8I7CQ2XLo59bl2txjDrblOGiu0TzUcM-Pq6s7gKY,1285
|
|
251
251
|
supervisely/app/widgets/empty/template.html,sha256=aDBKkin5aLuqByzNN517-rTYCGIg5SPKgnysYMPYjv8,40
|
|
252
252
|
supervisely/app/widgets/experiment_selector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
253
|
-
supervisely/app/widgets/experiment_selector/experiment_selector.py,sha256=
|
|
253
|
+
supervisely/app/widgets/experiment_selector/experiment_selector.py,sha256=D1RrMuA6xXg8M5DyBUKro-AUqj3oFNMIlo6pZUR0SQY,19889
|
|
254
254
|
supervisely/app/widgets/experiment_selector/style.css,sha256=-zPPXHnJvatYj_xVVAb7T8uoSsUTyhm5xCKWkkFQ78E,548
|
|
255
255
|
supervisely/app/widgets/experiment_selector/template.html,sha256=k7f_Xl6nDUXXwu6IY_RblYni5TbZRRxCBduY5O_SyFs,2908
|
|
256
256
|
supervisely/app/widgets/fast_table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -386,7 +386,7 @@ supervisely/app/widgets/pagination/template.html,sha256=1z9pt2SOTjA5Kmt8YjSiyO8X
|
|
|
386
386
|
supervisely/app/widgets/pie_chart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
387
387
|
supervisely/app/widgets/pie_chart/pie_chart.py,sha256=E0erw7kPXiudJzNhWMKdOnMgK9u6yYlPw10noKoO2jw,7809
|
|
388
388
|
supervisely/app/widgets/pretrained_models_selector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
389
|
-
supervisely/app/widgets/pretrained_models_selector/pretrained_models_selector.py,sha256=
|
|
389
|
+
supervisely/app/widgets/pretrained_models_selector/pretrained_models_selector.py,sha256=y21fRcDWuP1RbqxNzy3MRxWFi8-f9pV0SsDaNIWqlvE,14102
|
|
390
390
|
supervisely/app/widgets/pretrained_models_selector/style.css,sha256=po3FssuZhg3lKFU3VcTLqTW-qTCXLDnxYi2lCtYXhBc,363
|
|
391
391
|
supervisely/app/widgets/pretrained_models_selector/template.html,sha256=4owO7X84Ii35vMioeTOwMAdR9OwlvLFe19MNPDX4kWM,5170
|
|
392
392
|
supervisely/app/widgets/project_selector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -718,7 +718,7 @@ supervisely/nn/prediction_dto.py,sha256=8QQE6h_feOf3bjWtyG_PoU8FIQrr4g8PoMOyoscm
|
|
|
718
718
|
supervisely/nn/task_type.py,sha256=UJvSJ4L3I08j_e6sU6Ptu7kS5p1H09rfhfoDUSZ2iys,522
|
|
719
719
|
supervisely/nn/utils.py,sha256=-Xjv5KLu8CTtyi7acqsIX1E0dDwKZPED4D6b4Z_Ln3k,1451
|
|
720
720
|
supervisely/nn/artifacts/__init__.py,sha256=m7KYTMzEJnoV9wcU_0xzgLuPz69Dqp9va0fP32tohV4,576
|
|
721
|
-
supervisely/nn/artifacts/artifacts.py,sha256=
|
|
721
|
+
supervisely/nn/artifacts/artifacts.py,sha256=mizJzrzAMoURYnHU-Ap8OdUAxRngDtR5PC0RyDxBp8k,21079
|
|
722
722
|
supervisely/nn/artifacts/detectron2.py,sha256=6iu5Yslc-SxCKJVNl6sn84qeXmD-JIQShJIxuLdzf2o,1673
|
|
723
723
|
supervisely/nn/artifacts/hrda.py,sha256=3DzbjDIt9YuLozMrKmYYw13oxc14xju2vzbxKVq2G4I,1073
|
|
724
724
|
supervisely/nn/artifacts/mmclassification.py,sha256=M0m9HHF5koHsl5RuFkRU0_clckA1sFty3X6awB2eKNo,1527
|
|
@@ -859,7 +859,7 @@ supervisely/nn/benchmark/visualization/widgets/table/__init__.py,sha256=47DEQpj8
|
|
|
859
859
|
supervisely/nn/benchmark/visualization/widgets/table/table.py,sha256=atmDnF1Af6qLQBUjLhK18RMDKAYlxnsuVHMSEa5a-e8,4319
|
|
860
860
|
supervisely/nn/inference/__init__.py,sha256=mtEci4Puu-fRXDnGn8RP47o97rv3VTE0hjbYO34Zwqg,1622
|
|
861
861
|
supervisely/nn/inference/cache.py,sha256=KvzCgMbEBLdiJAxJDLicIPKAlYb52P9_kpNPWfiVY8Y,28194
|
|
862
|
-
supervisely/nn/inference/inference.py,sha256=
|
|
862
|
+
supervisely/nn/inference/inference.py,sha256=acNJH-1UthvJgyhI-9KJv8hzo8LjOVVdXPkoEuwfRLg,128864
|
|
863
863
|
supervisely/nn/inference/session.py,sha256=jmkkxbe2kH-lEgUU6Afh62jP68dxfhF5v6OGDfLU62E,35757
|
|
864
864
|
supervisely/nn/inference/video_inference.py,sha256=8Bshjr6rDyLay5Za8IB8Dr6FURMO2R_v7aELasO8pR4,5746
|
|
865
865
|
supervisely/nn/inference/gui/__init__.py,sha256=wCxd-lF5Zhcwsis-wScDA8n1Gk_1O00PKgDviUZ3F1U,221
|
|
@@ -1057,9 +1057,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
1057
1057
|
supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
|
|
1058
1058
|
supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
|
|
1059
1059
|
supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
|
|
1060
|
-
supervisely-6.73.
|
|
1061
|
-
supervisely-6.73.
|
|
1062
|
-
supervisely-6.73.
|
|
1063
|
-
supervisely-6.73.
|
|
1064
|
-
supervisely-6.73.
|
|
1065
|
-
supervisely-6.73.
|
|
1060
|
+
supervisely-6.73.261.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
1061
|
+
supervisely-6.73.261.dist-info/METADATA,sha256=-ebDT49QDbB4Ly0fCqehbeu-_SN7bLV1lObohSxHS4M,33573
|
|
1062
|
+
supervisely-6.73.261.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
1063
|
+
supervisely-6.73.261.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
|
|
1064
|
+
supervisely-6.73.261.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
|
|
1065
|
+
supervisely-6.73.261.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|