Skip to content

Commit 1e24db4

Browse files
committed
Added mixpanel, changed docs
1 parent 1d8bb20 commit 1e24db4

40 files changed

+1310
-1219
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- '--application-directories'
1010
- app
1111
- repo: 'https://github.com/python/black'
12-
rev: 19.10b0
12+
rev: 22.3.0
1313
hooks:
1414
- id: black
1515
name: Code Formatter (black)

docs/source/superannotate.sdk.rst

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Remote functions
1111
Initialization and authentication
1212
_________________________________
1313

14-
.. autofunction:: superannotate.init
14+
.. automethod:: superannotate.SAClient.__init__
1515

1616

1717
.. _ref_projects:
@@ -20,61 +20,61 @@ Projects
2020
________
2121

2222
.. _ref_search_projects:
23-
.. autofunction:: superannotate.search_projects
24-
.. autofunction:: superannotate.create_project
25-
.. autofunction:: superannotate.create_project_from_metadata
26-
.. autofunction:: superannotate.clone_project
27-
.. autofunction:: superannotate.delete_project
28-
.. autofunction:: superannotate.rename_project
23+
.. automethod:: superannotate.SAClient.search_projects
24+
.. automethod:: superannotate.SAClient.create_project
25+
.. automethod:: superannotate.SAClient.create_project_from_metadata
26+
.. automethod:: superannotate.SAClient.clone_project
27+
.. automethod:: superannotate.SAClient.delete_project
28+
.. automethod:: superannotate.SAClient.rename_project
2929
.. _ref_get_project_metadata:
30-
.. autofunction:: superannotate.get_project_metadata
31-
.. autofunction:: superannotate.get_project_image_count
32-
.. autofunction:: superannotate.search_folders
33-
.. autofunction:: superannotate.get_folder_metadata
34-
.. autofunction:: superannotate.create_folder
35-
.. autofunction:: superannotate.delete_folders
36-
.. autofunction:: superannotate.upload_images_to_project
37-
.. autofunction:: superannotate.attach_items_from_integrated_storage
38-
.. autofunction:: superannotate.upload_image_to_project
39-
.. autofunction:: superannotate.delete_annotations
30+
.. automethod:: superannotate.SAClient.get_project_metadata
31+
.. automethod:: superannotate.SAClient.get_project_image_count
32+
.. automethod:: superannotate.SAClient.search_folders
33+
.. automethod:: superannotate.SAClient.get_folder_metadata
34+
.. automethod:: superannotate.SAClient.create_folder
35+
.. automethod:: superannotate.SAClient.delete_folders
36+
.. automethod:: superannotate.SAClient.upload_images_to_project
37+
.. automethod:: superannotate.SAClient.attach_items_from_integrated_storage
38+
.. automethod:: superannotate.SAClient.upload_image_to_project
39+
.. automethod:: superannotate.SAClient.delete_annotations
4040
.. _ref_upload_images_from_folder_to_project:
41-
.. autofunction:: superannotate.upload_images_from_folder_to_project
42-
.. autofunction:: superannotate.upload_video_to_project
43-
.. autofunction:: superannotate.upload_videos_from_folder_to_project
41+
.. automethod:: superannotate.SAClient.upload_images_from_folder_to_project
42+
.. automethod:: superannotate.SAClient.upload_video_to_project
43+
.. automethod:: superannotate.SAClient.upload_videos_from_folder_to_project
4444
.. _ref_upload_annotations_from_folder_to_project:
45-
.. autofunction:: superannotate.upload_annotations_from_folder_to_project
46-
.. autofunction:: superannotate.upload_preannotations_from_folder_to_project
47-
.. autofunction:: superannotate.add_contributors_to_project
48-
.. autofunction:: superannotate.get_project_settings
49-
.. autofunction:: superannotate.set_project_default_image_quality_in_editor
50-
.. autofunction:: superannotate.get_project_workflow
51-
.. autofunction:: superannotate.set_project_workflow
45+
.. automethod:: superannotate.SAClient.upload_annotations_from_folder_to_project
46+
.. automethod:: superannotate.SAClient.upload_preannotations_from_folder_to_project
47+
.. automethod:: superannotate.SAClient.add_contributors_to_project
48+
.. automethod:: superannotate.SAClient.get_project_settings
49+
.. automethod:: superannotate.SAClient.set_project_default_image_quality_in_editor
50+
.. automethod:: superannotate.SAClient.get_project_workflow
51+
.. automethod:: superannotate.SAClient.set_project_workflow
5252

5353
----------
5454

5555
Exports
5656
_______
5757

58-
.. autofunction:: superannotate.prepare_export
59-
.. autofunction:: superannotate.get_annotations
60-
.. autofunction:: superannotate.get_annotations_per_frame
58+
.. automethod:: superannotate.SAClient.prepare_export
59+
.. automethod:: superannotate.SAClient.get_annotations
60+
.. automethod:: superannotate.SAClient.get_annotations_per_frame
6161
.. _ref_download_export:
62-
.. autofunction:: superannotate.download_export
63-
.. autofunction:: superannotate.get_exports
62+
.. automethod:: superannotate.SAClient.download_export
63+
.. automethod:: superannotate.SAClient.get_exports
6464

6565
----------
6666

6767
Items
6868
______
6969

70-
.. autofunction:: superannotate.query
71-
.. autofunction:: superannotate.search_items
72-
.. autofunction:: superannotate.download_annotations
73-
.. autofunction:: superannotate.attach_items
74-
.. autofunction:: superannotate.copy_items
75-
.. autofunction:: superannotate.move_items
76-
.. autofunction:: superannotate.get_item_metadata
77-
.. autofunction:: superannotate.set_annotation_statuses
70+
.. automethod:: superannotate.SAClient.query
71+
.. automethod:: superannotate.SAClient.search_items
72+
.. automethod:: superannotate.SAClient.download_annotations
73+
.. automethod:: superannotate.SAClient.attach_items
74+
.. automethod:: superannotate.SAClient.copy_items
75+
.. automethod:: superannotate.SAClient.move_items
76+
.. automethod:: superannotate.SAClient.get_item_metadata
77+
.. automethod:: superannotate.SAClient.set_annotation_statuses
7878

7979
----------
8080

@@ -83,50 +83,50 @@ ______
8383

8484

8585
.. _ref_search_images:
86-
.. autofunction:: superannotate.download_image
87-
.. autofunction:: superannotate.set_image_annotation_status
88-
.. autofunction:: superannotate.set_images_annotation_statuses
89-
.. autofunction:: superannotate.download_image_annotations
90-
.. autofunction:: superannotate.upload_image_annotations
91-
.. autofunction:: superannotate.copy_image
92-
.. autofunction:: superannotate.pin_image
93-
.. autofunction:: superannotate.assign_images
94-
.. autofunction:: superannotate.delete_images
95-
.. autofunction:: superannotate.add_annotation_bbox_to_image
96-
.. autofunction:: superannotate.add_annotation_point_to_image
97-
.. autofunction:: superannotate.add_annotation_comment_to_image
98-
.. autofunction:: superannotate.upload_priority_scores
86+
.. automethod:: superannotate.SAClient.download_image
87+
.. automethod:: superannotate.SAClient.set_image_annotation_status
88+
.. automethod:: superannotate.SAClient.set_images_annotation_statuses
89+
.. automethod:: superannotate.SAClient.download_image_annotations
90+
.. automethod:: superannotate.SAClient.upload_image_annotations
91+
.. automethod:: superannotate.SAClient.copy_image
92+
.. automethod:: superannotate.SAClient.pin_image
93+
.. automethod:: superannotate.SAClient.assign_images
94+
.. automethod:: superannotate.SAClient.delete_images
95+
.. automethod:: superannotate.SAClient.add_annotation_bbox_to_image
96+
.. automethod:: superannotate.SAClient.add_annotation_point_to_image
97+
.. automethod:: superannotate.SAClient.add_annotation_comment_to_image
98+
.. automethod:: superannotate.SAClient.upload_priority_scores
9999

100100
----------
101101

102102
Annotation Classes
103103
__________________
104104

105-
.. autofunction:: superannotate.create_annotation_class
105+
.. automethod:: superannotate.SAClient.create_annotation_class
106106
.. _ref_create_annotation_classes_from_classes_json:
107-
.. autofunction:: superannotate.create_annotation_classes_from_classes_json
108-
.. autofunction:: superannotate.search_annotation_classes
109-
.. autofunction:: superannotate.download_annotation_classes_json
110-
.. autofunction:: superannotate.delete_annotation_class
107+
.. automethod:: superannotate.SAClient.create_annotation_classes_from_classes_json
108+
.. automethod:: superannotate.SAClient.search_annotation_classes
109+
.. automethod:: superannotate.SAClient.download_annotation_classes_json
110+
.. automethod:: superannotate.SAClient.delete_annotation_class
111111

112112
----------
113113

114114
Team
115115
_________________
116116

117-
.. autofunction:: superannotate.get_team_metadata
118-
.. autofunction:: superannotate.get_integrations
119-
.. autofunction:: superannotate.invite_contributors_to_team
120-
.. autofunction:: superannotate.search_team_contributors
117+
.. automethod:: superannotate.SAClient.get_team_metadata
118+
.. automethod:: superannotate.SAClient.get_integrations
119+
.. automethod:: superannotate.SAClient.invite_contributors_to_team
120+
.. automethod:: superannotate.SAClient.search_team_contributors
121121

122122
----------
123123

124124
Neural Network
125125
_______________
126126

127-
.. autofunction:: superannotate.download_model
128-
.. autofunction:: superannotate.run_prediction
129-
.. autofunction:: superannotate.search_models
127+
.. automethod:: superannotate.SAClient.download_model
128+
.. automethod:: superannotate.SAClient.run_prediction
129+
.. automethod:: superannotate.SAClient.search_models
130130

131131
----------
132132

@@ -196,7 +196,7 @@ Export metadata example:
196196

197197

198198
Integration metadata
199-
_______________
199+
______________________
200200

201201
Integration metadata example:
202202

@@ -383,8 +383,8 @@ Working with annotations
383383
________________________
384384

385385
.. _ref_aggregate_annotations_as_df:
386-
.. autofunction:: superannotate.validate_annotations
387-
.. autofunction:: superannotate.aggregate_annotations_as_df
386+
.. automethod:: superannotate.SAClient.validate_annotations
387+
.. automethod:: superannotate.SAClient.aggregate_annotations_as_df
388388

389389
----------
390390

@@ -398,5 +398,5 @@ _____________________________________________________________
398398
Utility functions
399399
--------------------------------
400400

401-
.. autofunction:: superannotate.consensus
402-
.. autofunction:: superannotate.benchmark
401+
.. autofunction:: superannotate.SAClient.consensus
402+
.. autofunction:: superannotate.SAClient.benchmark

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
5-
;addopts = -n auto --dist=loadscope
5+
addopts = -n auto --dist=loadscope

src/superannotate/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
import os
22
import sys
3+
34
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
45

56
import logging.config # noqa
67
import requests # noqa
78
from packaging.version import parse # noqa
89
from superannotate.lib.app.analytics.class_analytics import class_distribution # noqa
910
from superannotate.lib.app.exceptions import AppException # noqa
10-
from superannotate.lib.app.input_converters.conversion import convert_json_version # noqa
11-
from superannotate.lib.app.input_converters.conversion import convert_project_type # noqa
12-
from superannotate.lib.app.input_converters.conversion import export_annotation # noqa
13-
from superannotate.lib.app.input_converters.conversion import import_annotation # noqa
11+
from superannotate.lib.app.input_converters import convert_json_version
12+
from superannotate.lib.app.input_converters import convert_project_type # noqa
13+
from superannotate.lib.app.input_converters import export_annotation # noqa
14+
from superannotate.lib.app.input_converters import import_annotation # noqa
1415
from superannotate.lib.app.interface.sdk_interface import SAClient # noqa
1516
from superannotate.lib.core import PACKAGE_VERSION_INFO_MESSAGE # noqa
1617
from superannotate.lib.core import PACKAGE_VERSION_MAJOR_UPGRADE # noqa
1718
from superannotate.lib.core import PACKAGE_VERSION_UPGRADE # noqa
1819
from superannotate.logger import get_default_logger # noqa
1920
from superannotate.version import __version__ # noqa
2021

22+
23+
SESSIONS = {}
24+
2125
__all__ = [
2226
"__version__",
2327
"SAClient",
@@ -52,14 +56,10 @@ def log_version_info():
5256
pip_version = max(pip_version, ver)
5357
if pip_version.major > local_version.major:
5458
logger.warning(
55-
PACKAGE_VERSION_MAJOR_UPGRADE.format(
56-
local_version, pip_version
57-
)
59+
PACKAGE_VERSION_MAJOR_UPGRADE.format(local_version, pip_version)
5860
)
5961
elif pip_version > local_version:
60-
logger.warning(
61-
PACKAGE_VERSION_UPGRADE.format(local_version, pip_version)
62-
)
62+
logger.warning(PACKAGE_VERSION_UPGRADE.format(local_version, pip_version))
6363

6464

6565
if not os.environ.get("SA_VERSION_CHECK", "True").lower() == "false":

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pandas as pd
44
import plotly.express as px
5-
from lib.app.mixp.decorators import Trackable
5+
from lib.app.interface.base_interface import Tracker
66
from superannotate.lib.app.exceptions import AppException
77
from superannotate.lib.core import DEPRICATED_DOCUMENT_VIDEO_MESSAGE
88
from superannotate.logger import get_default_logger
@@ -12,7 +12,7 @@
1212
logger = get_default_logger()
1313

1414

15-
@Trackable
15+
@Tracker
1616
def class_distribution(export_root, project_names, visualize=False):
1717
"""Aggregate distribution of classes across multiple projects.
1818
@@ -60,7 +60,11 @@ def class_distribution(export_root, project_names, visualize=False):
6060
df = df.sort_values(["count"], ascending=False)
6161

6262
if visualize:
63-
fig = px.bar(df, x="className", y="count",)
63+
fig = px.bar(
64+
df,
65+
x="className",
66+
y="count",
67+
)
6468
fig.update_traces(hovertemplate="%{x}: %{y}")
6569
fig.update_yaxes(title_text="Instance Count")
6670
fig.update_xaxes(title_text="")

src/superannotate/lib/app/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88

99

1010
def hex_to_rgb(hex_string):
11-
"""Converts HEX values to RGB values
12-
"""
11+
"""Converts HEX values to RGB values"""
1312
h = hex_string.lstrip("#")
1413
return tuple(int(h[i : i + 2], 16) for i in (0, 2, 4))
1514

1615

1716
def blue_color_generator(n, hex_values=True):
18-
""" Blue colors generator for SuperAnnotate blue mask.
19-
"""
17+
"""Blue colors generator for SuperAnnotate blue mask."""
2018
hex_colors = []
2119
for i in range(n + 1):
2220
int_color = i * 15
@@ -27,7 +25,9 @@ def blue_color_generator(n, hex_values=True):
2725
hex_color = (
2826
"#"
2927
+ "{:02x}".format(bgr_color[2])
30-
+ "{:02x}".format(bgr_color[1],)
28+
+ "{:02x}".format(
29+
bgr_color[1],
30+
)
3131
+ "{:02x}".format(bgr_color[0])
3232
)
3333
if hex_values:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from .conversion import convert_json_version
2+
from .conversion import convert_project_type
3+
from .conversion import export_annotation
4+
from .conversion import import_annotation
5+
6+
7+
__all__ = [
8+
"convert_json_version",
9+
"convert_project_type",
10+
"export_annotation",
11+
"import_annotation",
12+
]

0 commit comments

Comments
 (0)