Skip to content

Commit 8359a3f

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Merge remote-tracking branch 'origin/re-design-sdk' into re-design-sdk
# Conflicts: # src/superannotate/lib/app/input_converters/conversion.py # src/superannotate/lib/app/interface/sdk_interface.py
2 parents c61208a + 1ba3d99 commit 8359a3f

File tree

16 files changed

+1742
-9
lines changed

16 files changed

+1742
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ __pycache__/
44
*$py.class
55
*mypy*
66
*.egg*
7+
*DS_Store*
78

89
# C extensions
910
*.so
@@ -16,7 +17,6 @@ dist/
1617
downloads/
1718
eggs/
1819
.eggs/
19-
lib/
2020
lib64/
2121
parts/
2222
sdist/

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from superannotate.lib.app.analytics.class_analytics import aggregate_annotations_as_df
21
from superannotate.lib.app.analytics.class_analytics import attribute_distribution
32
from superannotate.lib.app.analytics.class_analytics import class_distribution
43
from superannotate.lib.app.annotation_helpers import add_annotation_bbox_to_json
@@ -38,6 +37,7 @@
3837
from superannotate.lib.app.interface.sdk_interface import (
3938
add_annotation_template_to_image,
4039
)
40+
from superannotate.lib.app.interface.sdk_interface import aggregate_annotations_as_df
4141
from superannotate.lib.app.interface.sdk_interface import assign_folder
4242
from superannotate.lib.app.interface.sdk_interface import assign_images
4343
from superannotate.lib.app.interface.sdk_interface import attach_image_urls_to_project

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
import pandas as pd
55
import plotly.express as px
6+
from superannotate.lib.app.mixp.decorators import Trackable
67

78
from .common import aggregate_annotations_as_df
89

910
logger = logging.getLogger("superannotate-python-sdk")
1011

1112

13+
@Trackable
1214
def class_distribution(export_root, project_names, visualize=False):
1315
"""Aggregate distribution of classes across multiple projects.
1416
@@ -57,6 +59,7 @@ def class_distribution(export_root, project_names, visualize=False):
5759
return df
5860

5961

62+
@Trackable
6063
def attribute_distribution(export_root, project_names, visualize=False):
6164
"""Aggregate distribution of attributes across multiple projects.
6265

src/superannotate/lib/app/convertors/df_converter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
from pathlib import Path
33

44
import pandas as pd
5+
from superannotate.lib.app.mixp.decorators import Trackable
56

67

8+
@Trackable
79
def df_to_annotations(df, output_dir):
810
"""Converts and saves pandas DataFrame annotation info (see aggregate_annotations_as_df)
911
in output_dir.
@@ -129,6 +131,7 @@ def df_to_annotations(df, output_dir):
129131
)
130132

131133

134+
@Trackable
132135
def filter_annotation_instances(annotations_df, include=None, exclude=None):
133136
"""Filter annotation instances from project annotations pandas DataFrame.
134137
@@ -195,6 +198,7 @@ def filter_annotation_instances(annotations_df, include=None, exclude=None):
195198
return result
196199

197200

201+
@Trackable
198202
def filter_images_by_comments(
199203
annotations_df,
200204
include_unresolved_comments=True,
@@ -230,6 +234,7 @@ def filter_images_by_comments(
230234
return list(images)
231235

232236

237+
@Trackable
233238
def filter_images_by_tags(annotations_df, include=None, exclude=None):
234239
"""Filter images on tags
235240

src/superannotate/lib/app/convertors/dicom_converter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import numpy as np
44
import pydicom
55
from PIL import Image
6+
from superannotate.lib.app.mixp.decorators import Trackable
67

78

9+
@Trackable
810
def dicom_to_rgb_sequence(
911
input_dicom_file, output_dir, output_image_quality="original"
1012
):

src/superannotate/lib/app/input_converters/conversion.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from lib.app.exceptions import AppException
88
from lib.core.exceptions import AppValidationException
9+
from lib.app.mixp.decorators import Trackable
910

1011
from .export_from_sa_conversions import export_from_sa
1112
from .import_to_sa_conversions import import_to_sa
@@ -133,7 +134,7 @@ def _passes_converter_sanity(args, direction):
133134
)
134135

135136

136-
# @Trackable
137+
@Trackable
137138
def export_annotation(
138139
input_dir,
139140
output_dir,
@@ -219,7 +220,7 @@ def export_annotation(
219220
export_from_sa(args)
220221

221222

222-
# @Trackable
223+
@Trackable
223224
def import_annotation(
224225
input_dir,
225226
output_dir,
@@ -403,7 +404,7 @@ def import_annotation(
403404
import_to_sa(args)
404405

405406

406-
# @Trackable
407+
@Trackable
407408
def convert_project_type(input_dir, output_dir):
408409
""" Converts SuperAnnotate 'Vector' project type to 'Pixel' or reverse.
409410
@@ -423,7 +424,7 @@ def convert_project_type(input_dir, output_dir):
423424
sa_convert_project_type(input_dir, output_dir)
424425

425426

426-
# @Trackable
427+
@Trackable
427428
def coco_split_dataset(
428429
coco_json_path, image_dir, output_dir, dataset_list_name, ratio_list
429430
):
@@ -474,7 +475,7 @@ def coco_split_dataset(
474475
split_coco(coco_json_path, image_dir, output_dir, dataset_list_name, ratio_list)
475476

476477

477-
# @Trackable
478+
@Trackable
478479
def convert_json_version(input_dir, output_dir, version=2):
479480
"""
480481
Converts SuperAnnotate JSON versions. Newest JSON version is 2.

0 commit comments

Comments
 (0)