datamint 2.0.0__tar.gz → 2.0.1__tar.gz
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 datamint might be problematic. Click here for more details.
- {datamint-2.0.0 → datamint-2.0.1}/PKG-INFO +1 -1
- {datamint-2.0.0 → datamint-2.0.1}/datamint/dataset/base_dataset.py +22 -15
- {datamint-2.0.0 → datamint-2.0.1}/pyproject.toml +1 -1
- {datamint-2.0.0 → datamint-2.0.1}/README.md +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/base_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/client.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/dto/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/annotations_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/channels_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/datasetsinfo_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/projects_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/resources_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/endpoints/users_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/api/entity_base_api.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/annotation_api_handler.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/api_handler.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/base_api_handler.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/dto/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/dto/annotation_dto.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/exp_api_handler.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/apihandler/root_api_handler.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/client_cmd_tools/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/client_cmd_tools/datamint_config.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/client_cmd_tools/datamint_upload.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/configs.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/dataset/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/dataset/annotation.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/dataset/dataset.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/annotation.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/base_entity.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/channel.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/datasetinfo.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/project.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/resource.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/entities/user.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/examples/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/examples/example_projects.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/exceptions.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/experiment/__init__.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/experiment/_patcher.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/experiment/experiment.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/logging.yaml +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/utils/logging_utils.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/utils/torchmetrics.py +0 -0
- {datamint-2.0.0 → datamint-2.0.1}/datamint/utils/visualization.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datamint
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -225,26 +225,34 @@ class DatamintBaseDataset:
|
|
|
225
225
|
else:
|
|
226
226
|
self._check_version()
|
|
227
227
|
|
|
228
|
+
def _init_metainfo(self) -> None:
|
|
229
|
+
# get the server info
|
|
230
|
+
self.project_info = self.get_info()
|
|
231
|
+
self.metainfo = self._get_datasetinfo().asdict().copy()
|
|
232
|
+
self.metainfo['updated_at'] = None
|
|
233
|
+
self.metainfo['resources'] = []
|
|
234
|
+
self.metainfo['all_annotations'] = self.all_annotations
|
|
235
|
+
self.images_metainfo = self.metainfo['resources']
|
|
236
|
+
|
|
228
237
|
def _load_metadata(self) -> bool:
|
|
229
238
|
"""Load and process dataset metadata."""
|
|
230
239
|
if hasattr(self, 'metainfo'):
|
|
231
240
|
_LOGGER.warning("Metadata already loaded.")
|
|
232
241
|
metadata_path = os.path.join(self.dataset_dir, 'dataset.json')
|
|
233
242
|
if not os.path.isfile(metadata_path):
|
|
234
|
-
|
|
235
|
-
self.project_info = self.get_info()
|
|
236
|
-
self.metainfo = self._get_datasetinfo().asdict().copy()
|
|
237
|
-
self.metainfo['updated_at'] = None
|
|
238
|
-
self.metainfo['resources'] = []
|
|
239
|
-
self.metainfo['all_annotations'] = self.all_annotations
|
|
240
|
-
self.images_metainfo = self.metainfo['resources']
|
|
243
|
+
self._init_metainfo()
|
|
241
244
|
return False
|
|
242
245
|
else:
|
|
243
246
|
with open(metadata_path, 'r') as file:
|
|
244
247
|
self.metainfo = json.load(file)
|
|
245
248
|
self.images_metainfo = self.metainfo['resources']
|
|
246
249
|
# Convert annotations from dict to Annotation objects
|
|
247
|
-
|
|
250
|
+
try:
|
|
251
|
+
self._convert_metainfo_to_clsobj()
|
|
252
|
+
except Exception as e:
|
|
253
|
+
_LOGGER.warning(f"Failed to convert annotations. Redownloading dataset. {type(e)}")
|
|
254
|
+
self._init_metainfo()
|
|
255
|
+
return False
|
|
248
256
|
return True
|
|
249
257
|
|
|
250
258
|
def _convert_metainfo_to_clsobj(self):
|
|
@@ -552,13 +560,12 @@ class DatamintBaseDataset:
|
|
|
552
560
|
"""Get project information from API."""
|
|
553
561
|
if hasattr(self, 'project_info') and self.project_info is not None:
|
|
554
562
|
return self.project_info
|
|
555
|
-
project = self.api.projects.get_by_name(self.project_name)
|
|
556
|
-
if
|
|
557
|
-
available_projects = project['all_projects']
|
|
563
|
+
project = self.api.projects.get_by_name(self.project_name)
|
|
564
|
+
if project is None:
|
|
558
565
|
raise DatamintDatasetException(
|
|
559
|
-
f"Project with name '{self.project_name}' not found.
|
|
560
|
-
f"Available projects: {available_projects}"
|
|
566
|
+
f"Project with name '{self.project_name}' not found."
|
|
561
567
|
)
|
|
568
|
+
project = project.asdict()
|
|
562
569
|
self.project_info = project
|
|
563
570
|
self.dataset_id = project['dataset_id']
|
|
564
571
|
return project
|
|
@@ -898,8 +905,8 @@ class DatamintBaseDataset:
|
|
|
898
905
|
################
|
|
899
906
|
|
|
900
907
|
### ANNOTATIONS ###
|
|
901
|
-
all_annotations = self.api.annotations.get_list(worklist_id=self.project_info['worklist_id'],
|
|
902
|
-
status=
|
|
908
|
+
all_annotations = self.api.annotations.get_list(worklist_id=None if self.all_annotations else self.project_info['worklist_id'],
|
|
909
|
+
status=None if self.all_annotations else 'published')
|
|
903
910
|
|
|
904
911
|
# group annotations by resource ID
|
|
905
912
|
annotations_by_resource: dict[str, list[Annotation]] = {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "datamint"
|
|
3
3
|
description = "A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows."
|
|
4
|
-
version = "2.0.
|
|
4
|
+
version = "2.0.1"
|
|
5
5
|
dynamic = ["dependencies"]
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|