Skip to content

Commit eda7d93

Browse files
authored
Merge pull request #457 from superannotateai/friday
Friday
2 parents 6f0b2a8 + 93ddb2f commit eda7d93

File tree

119 files changed

+4301
-4726
lines changed

Some content is hidden

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

119 files changed

+4301
-4726
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/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ SuperAnnotate Python SDK allows access to the platform without web browser:
2929

3030
.. code-block:: python
3131
32-
import superannotate as sa
32+
from superannotate import SAClient
33+
34+
sa = SAClient()
3335
3436
sa.create_project("Example Project 1", "example", "Vector")
3537

docs/source/superannotate.sdk.rst

Lines changed: 78 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -8,73 +8,80 @@ API Reference
88
Remote functions
99
----------------
1010

11-
Initialization and authentication
11+
Instantiation and authentication
1212
_________________________________
1313

14-
.. autofunction:: superannotate.init
14+
.. autoclass:: superannotate.SAClient
1515

1616

17-
.. _ref_projects:
18-
1917
Projects
2018
________
2119

2220
.. _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
21+
.. automethod:: superannotate.SAClient.search_projects
22+
.. automethod:: superannotate.SAClient.create_project
23+
.. automethod:: superannotate.SAClient.create_project_from_metadata
24+
.. automethod:: superannotate.SAClient.clone_project
25+
.. automethod:: superannotate.SAClient.delete_project
26+
.. automethod:: superannotate.SAClient.rename_project
2927
.. _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
28+
.. automethod:: superannotate.SAClient.get_project_metadata
29+
.. automethod:: superannotate.SAClient.get_project_image_count
30+
.. automethod:: superannotate.SAClient.search_folders
31+
.. automethod:: superannotate.SAClient.get_folder_metadata
32+
.. automethod:: superannotate.SAClient.create_folder
33+
.. automethod:: superannotate.SAClient.delete_folders
34+
.. automethod:: superannotate.SAClient.upload_images_to_project
35+
.. automethod:: superannotate.SAClient.attach_items_from_integrated_storage
36+
.. automethod:: superannotate.SAClient.upload_image_to_project
37+
.. automethod:: superannotate.SAClient.delete_annotations
4038
.. _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
39+
.. automethod:: superannotate.SAClient.upload_images_from_folder_to_project
40+
.. automethod:: superannotate.SAClient.upload_video_to_project
41+
.. automethod:: superannotate.SAClient.upload_videos_from_folder_to_project
4442
.. _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
43+
.. automethod:: superannotate.SAClient.upload_annotations_from_folder_to_project
44+
.. automethod:: superannotate.SAClient.upload_preannotations_from_folder_to_project
45+
.. automethod:: superannotate.SAClient.add_contributors_to_project
46+
.. automethod:: superannotate.SAClient.get_project_settings
47+
.. automethod:: superannotate.SAClient.set_project_default_image_quality_in_editor
48+
.. automethod:: superannotate.SAClient.get_project_workflow
49+
.. automethod:: superannotate.SAClient.set_project_workflow
5250

5351
----------
5452

5553
Exports
5654
_______
5755

58-
.. autofunction:: superannotate.prepare_export
59-
.. autofunction:: superannotate.get_annotations
60-
.. autofunction:: superannotate.get_annotations_per_frame
56+
.. automethod:: superannotate.SAClient.prepare_export
57+
.. automethod:: superannotate.SAClient.get_annotations
58+
.. automethod:: superannotate.SAClient.get_annotations_per_frame
6159
.. _ref_download_export:
62-
.. autofunction:: superannotate.download_export
63-
.. autofunction:: superannotate.get_exports
60+
.. automethod:: superannotate.SAClient.download_export
61+
.. automethod:: superannotate.SAClient.get_exports
6462

6563
----------
6664

6765
Items
6866
______
6967

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
68+
.. automethod:: superannotate.SAClient.query
69+
.. automethod:: superannotate.SAClient.search_items
70+
.. automethod:: superannotate.SAClient.download_annotations
71+
.. automethod:: superannotate.SAClient.attach_items
72+
.. automethod:: superannotate.SAClient.copy_items
73+
.. automethod:: superannotate.SAClient.move_items
74+
.. automethod:: superannotate.SAClient.assign_items
75+
.. automethod:: superannotate.SAClient.unassign_items
76+
.. automethod:: superannotate.SAClient.get_item_metadata
77+
.. automethod:: superannotate.SAClient.set_annotation_statuses
78+
79+
----------
80+
81+
Subsets
82+
______
83+
84+
.. automethod:: superannotate.SAClient.get_subsets
7885

7986
----------
8087

@@ -83,50 +90,48 @@ ______
8390

8491

8592
.. _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
93+
.. automethod:: superannotate.SAClient.download_image
94+
.. automethod:: superannotate.SAClient.download_image_annotations
95+
.. automethod:: superannotate.SAClient.upload_image_annotations
96+
.. automethod:: superannotate.SAClient.copy_image
97+
.. automethod:: superannotate.SAClient.pin_image
98+
.. automethod:: superannotate.SAClient.assign_images
99+
.. automethod:: superannotate.SAClient.delete_images
100+
.. automethod:: superannotate.SAClient.add_annotation_bbox_to_image
101+
.. automethod:: superannotate.SAClient.add_annotation_point_to_image
102+
.. automethod:: superannotate.SAClient.add_annotation_comment_to_image
103+
.. automethod:: superannotate.SAClient.upload_priority_scores
99104

100105
----------
101106

102107
Annotation Classes
103108
__________________
104109

105-
.. autofunction:: superannotate.create_annotation_class
110+
.. automethod:: superannotate.SAClient.create_annotation_class
106111
.. _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
112+
.. automethod:: superannotate.SAClient.create_annotation_classes_from_classes_json
113+
.. automethod:: superannotate.SAClient.search_annotation_classes
114+
.. automethod:: superannotate.SAClient.download_annotation_classes_json
115+
.. automethod:: superannotate.SAClient.delete_annotation_class
111116

112117
----------
113118

114119
Team
115120
_________________
116121

117-
.. autofunction:: superannotate.get_team_metadata
118-
.. autofunction:: superannotate.get_integrations
119-
.. autofunction:: superannotate.invite_contributors_to_team
120-
.. autofunction:: superannotate.search_team_contributors
122+
.. automethod:: superannotate.SAClient.get_team_metadata
123+
.. automethod:: superannotate.SAClient.get_integrations
124+
.. automethod:: superannotate.SAClient.invite_contributors_to_team
125+
.. automethod:: superannotate.SAClient.search_team_contributors
121126

122127
----------
123128

124129
Neural Network
125130
_______________
126131

127-
.. autofunction:: superannotate.download_model
128-
.. autofunction:: superannotate.run_prediction
129-
.. autofunction:: superannotate.search_models
132+
.. automethod:: superannotate.SAClient.download_model
133+
.. automethod:: superannotate.SAClient.run_prediction
134+
.. automethod:: superannotate.SAClient.search_models
130135

131136
----------
132137

@@ -196,7 +201,7 @@ Export metadata example:
196201

197202

198203
Integration metadata
199-
_______________
204+
______________________
200205

201206
Integration metadata example:
202207

@@ -383,8 +388,8 @@ Working with annotations
383388
________________________
384389

385390
.. _ref_aggregate_annotations_as_df:
386-
.. autofunction:: superannotate.validate_annotations
387-
.. autofunction:: superannotate.aggregate_annotations_as_df
391+
.. automethod:: superannotate.SAClient.validate_annotations
392+
.. automethod:: superannotate.SAClient.aggregate_annotations_as_df
388393

389394
----------
390395

@@ -398,5 +403,5 @@ _____________________________________________________________
398403
Utility functions
399404
--------------------------------
400405

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

docs/source/tutorial.sdk.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ Include the package in your Python code:
7777

7878
.. code-block:: python
7979
80-
import superannotate as sa
80+
from superannotate import SAClient
8181
8282
SDK is ready to be used if default location config file was created using
8383
the :ref:`CLI init <ref_cli_init>`. Otherwise to authenticate SDK with the :ref:`custom config file <ref_custom_config_file>`:
8484

8585
.. code-block:: python
8686
87-
sa.init("<path_to_config_json>")
87+
sa = SAClient(config_path="<path_to_config_json>")
8888
8989
Creating a project
9090
____________________________
@@ -273,80 +273,81 @@ You can find more information annotation format conversion :ref:`here <ref_conve
273273

274274
.. code-block:: python
275275
276-
import superannotate as sa
276+
from superannotate import export_annotation
277+
from superannotate import import_annotation
277278
278279
# From SA format to COCO panoptic format
279-
sa.export_annotation(
280+
export_annotation(
280281
"tests/converter_test/COCO/input/fromSuperAnnotate/cats_dogs_panoptic_segm",
281282
"tests/converter_test/COCO/output/panoptic",
282283
"COCO", "panoptic_test", "Pixel","panoptic_segmentation"
283284
)
284285
285286
# From COCO keypoints detection format to SA annotation format
286-
sa.import_annotation(
287+
import_annotation(
287288
"tests/converter_test/COCO/input/toSuperAnnotate/keypoint_detection",
288289
"tests/converter_test/COCO/output/keypoints",
289290
"COCO", "person_keypoints_test", "Vector", "keypoint_detection"
290291
)
291292
292293
# Pascal VOC annotation format to SA annotation format
293-
sa.import_annotation(
294+
import_annotation(
294295
"tests/converter_test/VOC/input/fromPascalVOCToSuperAnnotate/VOC2012",
295296
"tests/converter_test/VOC/output/instances",
296297
"VOC", "instances_test", "Pixel", "instance_segmentation"
297298
)
298299
299300
# YOLO annotation format to SA annotation format
300-
sa.import_annotation(
301+
import_annotation(
301302
'tests/converter_test/YOLO/input/toSuperAnnotate',
302303
'tests/converter_test/YOLO/output',
303304
'YOLO', '', 'Vector', 'object_detection'
304305
)
305306
306307
# LabelBox annotation format to SA annotation format
307-
sa.import_annotation(
308+
import_annotation(
308309
"tests/converter_test/LabelBox/input/toSuperAnnotate/",
309310
"tests/converter_test/LabelBox/output/objects/",
310311
"LabelBox", "labelbox_example", "Vector", "object_detection"
311312
)
312313
313314
# Supervisely annotation format to SA annotation format
314-
sa.import_annotation(
315+
import_annotation(
315316
"tests/converter_test/Supervisely/input/toSuperAnnotate",
316317
"tests/converter_test/Supervisely/output",
317318
"Supervisely", "", "Vector", "vector_annotation"
318319
)
319320
320321
# DataLoop annotation format to SA annotation format
321-
sa.import_annotation(
322+
import_annotation(
322323
"tests/converter_test/DataLoop/input/toSuperAnnotate",
323324
"tests/converter_test/DataLoop/output",
324325
"DataLoop", "", "Vector", "vector_annotation"
325326
)
326327
327328
# VGG annotation format to SA annotation format
328-
sa.import_annotation(
329+
import_annotation(
329330
"tests/converter_test/VGG/input/toSuperAnnotate",
330331
"tests/converter_test/VGG/output",
331332
"VGG", "vgg_test", "Vector", "instance_segmentation"
332333
)
333334
334335
# VoTT annotation format to SA annotation format
335-
sa.import_annotation(
336+
import_annotation(
336337
"tests/converter_test/VoTT/input/toSuperAnnotate",
337338
"tests/converter_test/VoTT/output",
338339
"VoTT", "", "Vector", "vector_annotation"
339340
)
340341
341342
# GoogleCloud annotation format to SA annotation format
342-
sa.import_annotation(
343+
import_annotation(
343344
"tests/converter_test/GoogleCloud/input/toSuperAnnotate",
344345
"tests/converter_test/GoogleCloud/output",
345346
"GoogleCloud", "image_object_detection", "Vector", "object_detection"
346347
)
347348
348349
# GoogleCloud annotation format to SA annotation format
349-
sa.import_annotation(
350+
import_annotation(
350351
"tests/converter_test/SageMaker/input/toSuperAnnotate",
351352
"tests/converter_test/SageMaker/output",
352353
"SageMaker", "test-obj-detect", "Vector", "object_detection"

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

requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
superannotate_schemas>=v1.0.43dev5
1+
superannotate_schemas>=v1.0.45dev1
22

0 commit comments

Comments
 (0)