1- import logging .config
21import os
32import sys
3+ sys .path .append (os .path .split (os .path .realpath (__file__ ))[0 ])
44
5- import requests
6- from packaging .version import parse
7- from superannotate .lib import core as constances
8- from superannotate .lib import get_default_controller
9- from superannotate .lib .app .analytics .class_analytics import class_distribution
10- from superannotate .lib .app .exceptions import AppException
11- from superannotate .lib .app .input_converters .conversion import convert_json_version
12- from superannotate .lib .app .input_converters .conversion import convert_project_type
13- from superannotate .lib .app .input_converters .conversion import export_annotation
14- from superannotate .lib .app .input_converters .conversion import import_annotation
15- from superannotate .lib .app .interface .sdk_interface import add_annotation_bbox_to_image
16- from superannotate .lib .app .interface .sdk_interface import (
17- add_annotation_comment_to_image ,
18- )
19- from superannotate .lib .app .interface .sdk_interface import add_annotation_point_to_image
20- from superannotate .lib .app .interface .sdk_interface import add_contributors_to_project
21- from superannotate .lib .app .interface .sdk_interface import aggregate_annotations_as_df
22- from superannotate .lib .app .interface .sdk_interface import assign_folder
23- from superannotate .lib .app .interface .sdk_interface import assign_images
24- from superannotate .lib .app .interface .sdk_interface import attach_items
25- from superannotate .lib .app .interface .sdk_interface import (
26- attach_items_from_integrated_storage ,
27- )
28- from superannotate .lib .app .interface .sdk_interface import benchmark
29- from superannotate .lib .app .interface .sdk_interface import clone_project
30- from superannotate .lib .app .interface .sdk_interface import consensus
31- from superannotate .lib .app .interface .sdk_interface import copy_image
32- from superannotate .lib .app .interface .sdk_interface import copy_items
33- from superannotate .lib .app .interface .sdk_interface import create_annotation_class
34- from superannotate .lib .app .interface .sdk_interface import (
35- create_annotation_classes_from_classes_json ,
36- )
37- from superannotate .lib .app .interface .sdk_interface import create_folder
38- from superannotate .lib .app .interface .sdk_interface import create_project
39- from superannotate .lib .app .interface .sdk_interface import create_project_from_metadata
40- from superannotate .lib .app .interface .sdk_interface import delete_annotation_class
41- from superannotate .lib .app .interface .sdk_interface import delete_annotations
42- from superannotate .lib .app .interface .sdk_interface import delete_folders
43- from superannotate .lib .app .interface .sdk_interface import delete_images
44- from superannotate .lib .app .interface .sdk_interface import delete_project
45- from superannotate .lib .app .interface .sdk_interface import (
46- download_annotation_classes_json ,
47- )
48- from superannotate .lib .app .interface .sdk_interface import download_annotations
49- from superannotate .lib .app .interface .sdk_interface import download_export
50- from superannotate .lib .app .interface .sdk_interface import download_image
51- from superannotate .lib .app .interface .sdk_interface import download_image_annotations
52- from superannotate .lib .app .interface .sdk_interface import download_model
53- from superannotate .lib .app .interface .sdk_interface import get_annotations
54- from superannotate .lib .app .interface .sdk_interface import get_annotations_per_frame
55- from superannotate .lib .app .interface .sdk_interface import get_exports
56- from superannotate .lib .app .interface .sdk_interface import get_folder_metadata
57- from superannotate .lib .app .interface .sdk_interface import get_integrations
58- from superannotate .lib .app .interface .sdk_interface import get_item_metadata
59- from superannotate .lib .app .interface .sdk_interface import get_project_image_count
60- from superannotate .lib .app .interface .sdk_interface import get_project_metadata
61- from superannotate .lib .app .interface .sdk_interface import get_project_settings
62- from superannotate .lib .app .interface .sdk_interface import get_project_workflow
63- from superannotate .lib .app .interface .sdk_interface import get_team_metadata
64- from superannotate .lib .app .interface .sdk_interface import init
65- from superannotate .lib .app .interface .sdk_interface import invite_contributors_to_team
66- from superannotate .lib .app .interface .sdk_interface import move_items
67- from superannotate .lib .app .interface .sdk_interface import pin_image
68- from superannotate .lib .app .interface .sdk_interface import prepare_export
69- from superannotate .lib .app .interface .sdk_interface import query
70- from superannotate .lib .app .interface .sdk_interface import rename_project
71- from superannotate .lib .app .interface .sdk_interface import run_prediction
72- from superannotate .lib .app .interface .sdk_interface import search_annotation_classes
73- from superannotate .lib .app .interface .sdk_interface import search_folders
74- from superannotate .lib .app .interface .sdk_interface import search_items
75- from superannotate .lib .app .interface .sdk_interface import search_models
76- from superannotate .lib .app .interface .sdk_interface import search_projects
77- from superannotate .lib .app .interface .sdk_interface import search_team_contributors
78- from superannotate .lib .app .interface .sdk_interface import set_annotation_statuses
79- from superannotate .lib .app .interface .sdk_interface import set_auth_token
80- from superannotate .lib .app .interface .sdk_interface import set_image_annotation_status
81- from superannotate .lib .app .interface .sdk_interface import set_images_annotation_statuses
82- from superannotate .lib .app .interface .sdk_interface import (
83- set_project_default_image_quality_in_editor ,
84- )
85- from superannotate .lib .app .interface .sdk_interface import set_project_workflow
86- from superannotate .lib .app .interface .sdk_interface import unassign_folder
87- from superannotate .lib .app .interface .sdk_interface import unassign_images
88- from superannotate .lib .app .interface .sdk_interface import (
89- upload_annotations_from_folder_to_project ,
90- )
91- from superannotate .lib .app .interface .sdk_interface import upload_image_annotations
92- from superannotate .lib .app .interface .sdk_interface import upload_image_to_project
93- from superannotate .lib .app .interface .sdk_interface import (
94- upload_images_from_folder_to_project ,
95- )
96- from superannotate .lib .app .interface .sdk_interface import upload_images_to_project
97- from superannotate .lib .app .interface .sdk_interface import (
98- upload_preannotations_from_folder_to_project ,
99- )
100- from superannotate .lib .app .interface .sdk_interface import upload_priority_scores
101- from superannotate .lib .app .interface .sdk_interface import upload_video_to_project
102- from superannotate .lib .app .interface .sdk_interface import (
103- upload_videos_from_folder_to_project ,
104- )
105- from superannotate .lib .app .interface .sdk_interface import validate_annotations
106- from superannotate .logger import get_default_logger
107- from superannotate .version import __version__
108-
109-
110- controller = get_default_controller ()
111-
5+ import logging .config # noqa
6+ import requests # noqa
7+ from packaging .version import parse # noqa
8+ from superannotate .lib .app .analytics .class_analytics import class_distribution # noqa
9+ 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
14+ from superannotate .lib .app .interface .sdk_interface import SAClient # noqa
15+ from superannotate .lib .core import PACKAGE_VERSION_INFO_MESSAGE # noqa
16+ from superannotate .lib .core import PACKAGE_VERSION_MAJOR_UPGRADE # noqa
17+ from superannotate .lib .core import PACKAGE_VERSION_UPGRADE # noqa
18+ from superannotate .logger import get_default_logger # noqa
19+ from superannotate .version import __version__ # noqa
11220
11321__all__ = [
11422 "__version__" ,
115- "controller" ,
116- "constances" ,
23+ "SAClient" ,
11724 # Utils
11825 "AppException" ,
119- "validate_annotations" ,
120- #
121- "init" ,
122- "set_auth_token" ,
12326 # analytics
12427 "class_distribution" ,
125- "aggregate_annotations_as_df" ,
126- "get_exports" ,
127- # annotations
128- "get_annotations" ,
129- "download_annotations" ,
130- "get_annotations_per_frame" ,
131- # integrations
132- "get_integrations" ,
133- "attach_items_from_integrated_storage" ,
13428 # converters
13529 "convert_json_version" ,
13630 "import_annotation" ,
13731 "export_annotation" ,
13832 "convert_project_type" ,
139- # Teams Section
140- "get_team_metadata" ,
141- "search_team_contributors" ,
142- # Projects Section
143- "create_project_from_metadata" ,
144- "get_project_settings" ,
145- "get_project_metadata" ,
146- "get_project_workflow" ,
147- "set_project_workflow" ,
148- "search_projects" ,
149- "create_project" ,
150- "clone_project" ,
151- "delete_project" ,
152- "rename_project" ,
153- "upload_priority_scores" ,
154- # Images Section
155- "copy_image" ,
156- # Folders Section
157- "create_folder" ,
158- "get_folder_metadata" ,
159- "delete_folders" ,
160- "search_folders" ,
161- "assign_folder" ,
162- "unassign_folder" ,
163- # Items Section
164- "get_item_metadata" ,
165- "search_items" ,
166- "query" ,
167- "attach_items" ,
168- "copy_items" ,
169- "move_items" ,
170- "set_annotation_statuses" ,
171- # Image Section
172- "delete_images" ,
173- "download_image" ,
174- "pin_image" ,
175- "get_project_image_count" ,
176- "assign_images" ,
177- "unassign_images" ,
178- "download_image_annotations" ,
179- "delete_annotations" ,
180- "upload_image_to_project" ,
181- "upload_image_annotations" ,
182- "upload_images_from_folder_to_project" ,
183- # Video Section
184- "upload_videos_from_folder_to_project" ,
185- # Annotation Section
186- "create_annotation_class" ,
187- "delete_annotation_class" ,
188- "prepare_export" ,
189- "download_export" ,
190- "set_images_annotation_statuses" ,
191- "add_annotation_bbox_to_image" ,
192- "add_annotation_point_to_image" ,
193- "add_annotation_comment_to_image" ,
194- "search_annotation_classes" ,
195- "create_annotation_classes_from_classes_json" ,
196- "upload_annotations_from_folder_to_project" ,
197- "upload_preannotations_from_folder_to_project" ,
198- "download_annotation_classes_json" ,
199- "set_project_default_image_quality_in_editor" ,
200- "run_prediction" ,
201- "search_models" ,
202- "download_model" ,
203- "set_image_annotation_status" ,
204- "benchmark" ,
205- "consensus" ,
206- "upload_video_to_project" ,
207- "upload_images_to_project" ,
208- "add_contributors_to_project" ,
209- "invite_contributors_to_team" ,
21033]
21134
21235__author__ = "Superannotate"
21336
214- sys .path .append (os .path .split (os .path .realpath (__file__ ))[0 ])
21537logging .getLogger ("botocore" ).setLevel (logging .CRITICAL )
21638logger = get_default_logger ()
21739
21840
21941def log_version_info ():
22042 local_version = parse (__version__ )
22143 if local_version .is_prerelease :
222- logger .info (constances . PACKAGE_VERSION_INFO_MESSAGE .format (__version__ ))
44+ logger .info (PACKAGE_VERSION_INFO_MESSAGE .format (__version__ ))
22345 req = requests .get ("https://pypi.python.org/pypi/superannotate/json" )
22446 if req .ok :
22547 releases = req .json ().get ("releases" , [])
@@ -230,13 +52,13 @@ def log_version_info():
23052 pip_version = max (pip_version , ver )
23153 if pip_version .major > local_version .major :
23254 logger .warning (
233- constances . PACKAGE_VERSION_MAJOR_UPGRADE .format (
55+ PACKAGE_VERSION_MAJOR_UPGRADE .format (
23456 local_version , pip_version
23557 )
23658 )
23759 elif pip_version > local_version :
23860 logger .warning (
239- constances . PACKAGE_VERSION_UPGRADE .format (local_version , pip_version )
61+ PACKAGE_VERSION_UPGRADE .format (local_version , pip_version )
24062 )
24163
24264
0 commit comments