Skip to content

Commit 6d6e897

Browse files
authored
Merge pull request #826 from superannotateai/FRIDAY-4611
Update Pixel project handling
2 parents c3a8b29 + 6bce539 commit 6d6e897

48 files changed

Lines changed: 58 additions & 1955 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/source/api_reference/api_metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Project metadata example:
1818
"creator_id": "admin@superannotate.com",
1919
"updatedAt": "2020-08-31T05:43:43.118Z",
2020
"createdAt": "2020-08-31T05:43:43.118Z"
21-
"type": "Vector", # Pixel, Video, Multimodal
21+
"type": "Vector", # Video, Multimodal
2222
"attachment_name": None,
2323
"attachment_path": None,
2424
"entropy_status": 1,

docs/source/cli_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To create a new project:
4242

4343
.. code-block:: bash
4444
45-
superannotatecli create-project --name <project_name> --description <project_description> --type <project_type Vector or Pixel>
45+
superannotatecli create-project --name <project_name> --description <project_description> --type <project_type Vector>
4646
4747
----------
4848

docs/source/userguide/setup_project.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ you are uploading to should contain annotation class with that name.
249249
250250
251251
This will try uploading to the project all the JSON files in the folder that have :file:`"<image_name>.json"` postfix.
252-
For pixel projects JSON files should be named :file:`"<image_name>___pixel.json"` and also for
253-
each JSON a mask image file should be present with the name
254-
:file:`"<image_name>___save.png"`. Image with :file:`<image_name>` should
252+
Image with :file:`<image_name>` should
255253
already be present in the project for the upload to work.
256254

257255

docs/source/userguide/utilities.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can find more information annotation format conversion :ref:`here <ref_conve
4040
export_annotation(
4141
"tests/converter_test/COCO/input/fromSuperAnnotate/cats_dogs_panoptic_segm",
4242
"tests/converter_test/COCO/output/panoptic",
43-
"COCO", "panoptic_test", "Pixel","panoptic_segmentation"
43+
"COCO", "panoptic_test","panoptic_segmentation"
4444
)
4545
4646
# From COCO keypoints detection format to SA annotation format
@@ -54,7 +54,7 @@ You can find more information annotation format conversion :ref:`here <ref_conve
5454
import_annotation(
5555
"tests/converter_test/VOC/input/fromPascalVOCToSuperAnnotate/VOC2012",
5656
"tests/converter_test/VOC/output/instances",
57-
"VOC", "instances_test", "Pixel", "instance_segmentation"
57+
"VOC", "instances_test", "instance_segmentation"
5858
)
5959
6060
# YOLO annotation format to SA annotation format

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
;addopts = -n 6 --dist loadscope
6+
addopts = -n 6 --dist loadscope

src/superannotate/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55

6-
__version__ = "4.5.1"
6+
__version__ = "4.5.2dev1"
77

88

99
os.environ.update({"sa_version": __version__})
@@ -17,7 +17,6 @@
1717
from lib.core import PACKAGE_VERSION_MAJOR_UPGRADE
1818
from lib.core.exceptions import AppException
1919
from lib.core.exceptions import FileChangedError
20-
from superannotate.lib.app.input_converters import convert_project_type
2120
from superannotate.lib.app.input_converters import export_annotation
2221
from superannotate.lib.app.input_converters import import_annotation
2322
from superannotate.lib.app.interface.sdk_interface import SAClient
@@ -37,7 +36,6 @@
3736
"FileChangedError",
3837
"import_annotation",
3938
"export_annotation",
40-
"convert_project_type",
4139
]
4240

4341
__author__ = "Superannotate"

src/superannotate/lib/app/analytics/aggregators.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import lib.core as constances
1111
import pandas as pd
12-
from lib.core import PIXEL_ANNOTATION_POSTFIX
1312
from lib.core import VECTOR_ANNOTATION_POSTFIX
1413
from lib.core.exceptions import AppException
1514

@@ -162,8 +161,6 @@ def _set_annotation_suffix(self, path):
162161
self._annotation_suffix = ".json"
163162
elif VECTOR_ANNOTATION_POSTFIX in fname.name:
164163
self._annotation_suffix = VECTOR_ANNOTATION_POSTFIX
165-
elif PIXEL_ANNOTATION_POSTFIX in fname.name:
166-
self._annotation_suffix = PIXEL_ANNOTATION_POSTFIX
167164
else:
168165
self._annotation_suffix = ".json"
169166

@@ -205,10 +202,7 @@ def aggregate_annotations_as_df(self):
205202
self.check_classes_path()
206203
annotation_paths = self.get_annotation_paths()
207204

208-
if self.project_type in (
209-
constances.ProjectType.VECTOR,
210-
constances.ProjectType.PIXEL,
211-
):
205+
if self.project_type is constances.ProjectType.VECTOR:
212206
return self.aggregate_image_annotations_as_df(annotation_paths)
213207
if self.project_type is constances.ProjectType.VIDEO:
214208
return self.aggregate_video_annotations_as_df(annotation_paths)

src/superannotate/lib/app/analytics/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ def __get_user_metadata(annotation):
173173

174174
if "___objects.json" in annotations_paths[0].name:
175175
type_postfix = "___objects.json"
176-
elif "___pixel.json" in annotations_paths[0].name:
177-
type_postfix = "___pixel.json"
178176
else:
179177
type_postfix = ".json"
180178

src/superannotate/lib/app/helpers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import numpy as np
1010
import pandas as pd
1111
from lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
12-
from lib.core import PIXEL_ANNOTATION_POSTFIX
1312
from lib.core import VECTOR_ANNOTATION_POSTFIX
1413
from lib.core.exceptions import AppException
1514

@@ -36,7 +35,6 @@ def get_local_annotation_paths(
3635
if i.name.endswith(
3736
(
3837
VECTOR_ANNOTATION_POSTFIX,
39-
PIXEL_ANNOTATION_POSTFIX,
4038
ATTACHED_VIDEO_ANNOTATION_POSTFIX,
4139
)
4240
)
@@ -66,10 +64,8 @@ def get_s3_annotation_paths(folder_path, s3_bucket, annotation_paths, recursive)
6664
for data in paginator.paginate(Bucket=s3_bucket, Prefix=folder_path):
6765
for annotation in data.get("Contents", []):
6866
key = annotation["Key"]
69-
if (
70-
key.endswith(VECTOR_ANNOTATION_POSTFIX)
71-
or key.endswith(PIXEL_ANNOTATION_POSTFIX)
72-
or key.endswith(ATTACHED_VIDEO_ANNOTATION_POSTFIX)
67+
if key.endswith(VECTOR_ANNOTATION_POSTFIX) or key.endswith(
68+
ATTACHED_VIDEO_ANNOTATION_POSTFIX
7369
):
7470
if not recursive and "/" in key[len(folder_path) + 1 :]:
7571
continue
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
from lib.app.input_converters.conversion import convert_project_type
21
from lib.app.input_converters.conversion import export_annotation
32
from lib.app.input_converters.conversion import import_annotation
43

54

65
__all__ = [
7-
"convert_project_type",
86
"export_annotation",
97
"import_annotation",
108
]

0 commit comments

Comments
 (0)