unitlab 2.1.2__tar.gz → 2.1.3__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.
- {unitlab-2.1.2/src/unitlab.egg-info → unitlab-2.1.3}/PKG-INFO +1 -1
- {unitlab-2.1.2 → unitlab-2.1.3}/setup.py +1 -1
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/dataset.py +8 -34
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/main.py +4 -5
- {unitlab-2.1.2 → unitlab-2.1.3/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.1.2 → unitlab-2.1.3}/LICENSE.md +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/README.md +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/setup.cfg +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/__init__.py +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/__main__.py +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/client.py +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab/utils.py +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.1.2 → unitlab-2.1.3}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -39,18 +39,6 @@ class COCO:
|
|
39
39
|
self.data_path
|
40
40
|
)
|
41
41
|
)
|
42
|
-
if self.annotation_type not in [
|
43
|
-
"img_bbox",
|
44
|
-
"img_semantic_segmentation",
|
45
|
-
"img_instance_segmentation",
|
46
|
-
"img_polygon",
|
47
|
-
"img_keypoints",
|
48
|
-
]:
|
49
|
-
raise ValueError(
|
50
|
-
"Invalid annotation type '{}'. Supported types are: ['img_bbox', 'img_semantic_segmentation', 'img_polygon', 'img_keypoints']".format(
|
51
|
-
self.annotation_type
|
52
|
-
)
|
53
|
-
)
|
54
42
|
for required_key in ["images", "annotations", "categories"]:
|
55
43
|
if required_key not in self.dataset.keys():
|
56
44
|
raise KeyError(
|
@@ -284,30 +272,16 @@ class DatasetUploadHandler(COCO):
|
|
284
272
|
)
|
285
273
|
|
286
274
|
def get_img_instance_segmentation_payload(self, anns):
|
287
|
-
|
288
|
-
annotations = []
|
289
|
-
for ann in anns:
|
290
|
-
annotations.append(
|
291
|
-
{
|
292
|
-
"segmentation": ann["segmentation"],
|
293
|
-
"category_id": self.original_category_referecences.get(
|
294
|
-
ann["category_id"]
|
295
|
-
),
|
296
|
-
}
|
297
|
-
)
|
298
|
-
predicted_classes.add(
|
299
|
-
self.original_category_referecences.get(ann["category_id"])
|
300
|
-
)
|
301
|
-
return json.dumps(
|
302
|
-
{
|
303
|
-
"annotations": annotations,
|
304
|
-
"predicted_classes": list(predicted_classes),
|
305
|
-
"classes": self.classes,
|
306
|
-
}
|
307
|
-
)
|
275
|
+
return self.get_img_semantic_segmentation_payload(anns)
|
308
276
|
|
309
277
|
def get_img_polygon_payload(self, anns):
|
310
|
-
|
278
|
+
return self.get_img_semantic_segmentation_payload(anns)
|
279
|
+
|
280
|
+
def get_img_line_payload(self, anns):
|
281
|
+
return self.get_img_semantic_segmentation_payload(anns)
|
282
|
+
|
283
|
+
def get_img_point_payload(self, anns):
|
284
|
+
return self.get_img_semantic_segmentation_payload(anns)
|
311
285
|
|
312
286
|
def get_img_skeleton_payload(self, anns):
|
313
287
|
logger.warning("Not implemented yet")
|
@@ -32,9 +32,11 @@ class DownloadType(str, Enum):
|
|
32
32
|
|
33
33
|
class AnnotationType(str, Enum):
|
34
34
|
IMG_BBOX = "img_bbox"
|
35
|
-
IMG_POLYGON = "img_polygon"
|
36
35
|
IMG_SEMANTIC_SEGMENTATION = "img_semantic_segmentation"
|
37
36
|
IMG_INSTANCE_SEGMENTATION = "img_instance_segmentation"
|
37
|
+
IMG_POLYGON = "img_polygon"
|
38
|
+
IMG_LINE = "img_line"
|
39
|
+
IMG_POINT = "img_point"
|
38
40
|
IMG_SKELETON = "img_skeleton"
|
39
41
|
|
40
42
|
|
@@ -104,10 +106,7 @@ def dataset_upload(
|
|
104
106
|
help_prompt = ", ".join(
|
105
107
|
f"{idx}: {license['name']}" for idx, license in enumerate(licenses)
|
106
108
|
)
|
107
|
-
chosen_license = typer.prompt(
|
108
|
-
f"Select license {help_prompt}",
|
109
|
-
type=LicenseEnum,
|
110
|
-
)
|
109
|
+
chosen_license = typer.prompt(f"Select license {help_prompt}", type=LicenseEnum)
|
111
110
|
client.dataset_upload(
|
112
111
|
name,
|
113
112
|
annotation_type.value,
|
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
|