Skip to content

Commit 78dac5b

Browse files
authored
Merge pull request #537 from superannotateai/develop
Develop
2 parents 2260e44 + 4ff7e62 commit 78dac5b

37 files changed

+1569
-923
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Changelog
22
All release highlights of this project will be documented in this file.
3-
3+
## 4.4.7 - December 04, 2022
4+
### Updated
5+
- `SAClient.search_folders` _method_ to add a new `status` argument for searching folders via status.
6+
- Schemas for `Annotation Classes` and `Video Annotation` to support **text** and **numeric input** attribute group types.
7+
### Fixed
8+
- `SAClient.query` _method_ to address invalid exceptions.
9+
- `SAClient.download_export` _method_ to address the issue with downloading for Windows OS.
10+
- `SAClient.attach_items_from_integrated_storage` _method_ to address "integration not found" error.
11+
- `SAClient.aggregate_annotations_as_df` _method_ to support files without "___objects" in their naming.
12+
### Removed
13+
- `SAClient.add_annotation_bbox_to_image` _method_, use `SAClient.upload_annotations` instead.
14+
- `SAClient.add_annotation_point_to_image` _method_, use `SAClient.upload_annotations` instead.
15+
- `SAClient.add_annotation_comment_to_image` _method_, use `SAClient.upload_annotations` instead.
16+
###
417
## 4.4.6 - November 23, 2022
518
### Updated
619
- `SAClient.aggregate_annotations_as_df` method to aggregate "comment" type instances.

docs/source/superannotate.sdk.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ ________
2828
.. automethod:: superannotate.SAClient.get_project_metadata
2929
.. automethod:: superannotate.SAClient.get_project_image_count
3030
.. automethod:: superannotate.SAClient.search_folders
31+
.. automethod:: superannotate.SAClient.assign_folder
32+
.. automethod:: superannotate.SAClient.unassign_folder
3133
.. automethod:: superannotate.SAClient.get_folder_metadata
3234
.. automethod:: superannotate.SAClient.create_folder
3335
.. automethod:: superannotate.SAClient.delete_folders
@@ -107,9 +109,6 @@ ______
107109
.. automethod:: superannotate.SAClient.download_image_annotations
108110
.. automethod:: superannotate.SAClient.upload_image_annotations
109111
.. automethod:: superannotate.SAClient.pin_image
110-
.. automethod:: superannotate.SAClient.add_annotation_bbox_to_image
111-
.. automethod:: superannotate.SAClient.add_annotation_point_to_image
112-
.. automethod:: superannotate.SAClient.add_annotation_comment_to_image
113112
.. automethod:: superannotate.SAClient.upload_priority_scores
114113

115114
----------

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33

44

5-
__version__ = "4.4.6"
5+
__version__ = "4.4.7"
66

77

88
sys.path.append(os.path.split(os.path.realpath(__file__))[0])

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pandas as pd
55
import plotly.express as px
66
from lib.app.exceptions import AppException
7-
from lib.core import DEPRICATED_DOCUMENT_VIDEO_MESSAGE
87
from superannotate.logger import get_default_logger
98

109

@@ -44,14 +43,6 @@ def aggregate_image_annotations_as_df(
4443
:rtype: pandas DataFrame
4544
"""
4645

47-
json_paths = list(Path(str(project_root)).glob("*.json"))
48-
if (
49-
json_paths
50-
and "___pixel.json" not in json_paths[0].name
51-
and "___objects.json" not in json_paths[0].name
52-
):
53-
raise AppException(DEPRICATED_DOCUMENT_VIDEO_MESSAGE)
54-
5546
logger.info("Aggregating annotations from %s as pandas DataFrame", project_root)
5647

5748
annotation_data = {
@@ -101,12 +92,16 @@ def aggregate_image_annotations_as_df(
10192
classes_json = json.load(open(classes_path))
10293
class_name_to_color = {}
10394
class_group_name_to_values = {}
95+
freestyle_attributes = set()
10496
for annotation_class in classes_json:
10597
name = annotation_class["name"]
10698
color = annotation_class["color"]
10799
class_name_to_color[name] = color
108100
class_group_name_to_values[name] = {}
109101
for attribute_group in annotation_class["attribute_groups"]:
102+
group_type = attribute_group.get("group_type")
103+
if group_type and group_type in ["text", "numeric"]:
104+
freestyle_attributes.add(attribute_group["name"])
110105
class_group_name_to_values[name][attribute_group["name"]] = []
111106
for attribute in attribute_group["attributes"]:
112107
class_group_name_to_values[name][attribute_group["name"]].append(
@@ -175,10 +170,14 @@ def __get_user_metadata(annotation):
175170

176171
if not annotations_paths:
177172
logger.warning(f"Could not find annotations in {project_root}.")
178-
if len(list(Path(project_root).rglob("*___objects.json"))) > 0:
173+
174+
if "___objects.json" in annotations_paths[0].name:
179175
type_postfix = "___objects.json"
180-
else:
176+
elif "___pixel.json" in annotations_paths[0].name:
181177
type_postfix = "___pixel.json"
178+
else:
179+
type_postfix = ".json"
180+
182181
for annotation_path in annotations_paths:
183182
annotation_json = json.load(open(annotation_path))
184183
parts = annotation_path.name.split(type_postfix)
@@ -294,6 +293,7 @@ def __get_user_metadata(annotation):
294293
not in class_group_name_to_values[annotation_class_name][
295294
attribute_group
296295
]
296+
and attribute_group not in freestyle_attributes
297297
):
298298
logger.warning(
299299
"Annotation class group value %s not in classes json. Skipping.",
@@ -383,9 +383,9 @@ def instance_consensus(inst_1, inst_2):
383383
384384
:param inst_1: First instance for consensus score.
385385
:type inst_1: shapely object
386+
386387
:param inst_2: Second instance for consensus score.
387388
:type inst_2: shapely object
388-
389389
"""
390390
if inst_1.type == inst_2.type == "Polygon":
391391
intersect = inst_1.intersection(inst_2)
@@ -404,19 +404,19 @@ def image_consensus(df, image_name, annot_type):
404404
405405
:param df: Annotation data of all images
406406
:type df: pandas.DataFrame
407+
407408
:param image_name: The image name for which the consensus score will be computed
408409
:type image_name: str
410+
409411
:param annot_type: Type of annotation instances to consider. Available candidates are: ["bbox", "polygon", "point"]
410412
:type dataset_format: str
411-
412413
"""
413414

414415
try:
415416
from shapely.geometry import Point, Polygon, box
416417
except ImportError:
417418
raise ImportError(
418-
"To use superannotate.benchmark or superannotate.consensus functions please install "
419-
"shapely package in Anaconda enviornment with # conda install shapely"
419+
"To use superannotate.benchmark or superannotate.consensus functions please install shapely package."
420420
)
421421

422422
image_df = df[df["imageName"] == image_name]

src/superannotate/lib/app/annotation_helpers.py

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)