|
| 1 | +SuperAnnotate Python SDK |
| 2 | +=============================== |
| 3 | +|Python| |License| |Changelog| |
| 4 | + |
| 5 | + |
| 6 | +Welcome to the SuperAnnotate Python Software Development Kit (SDK), which enables Python programmers to create software that incorporates services of the platform and effortlessly integrates SuperAnnotate into their AI process. |
| 7 | + |
| 8 | +.. |Python| image:: https://img.shields.io/static/v1?label=python&message=3.7/3.8/3.9/3.10/3.11&color=blue&style=flat-square |
| 9 | + :target: https://pypi.org/project/superannotate/ |
| 10 | + :alt: Python Versions |
| 11 | +.. |License| image:: https://img.shields.io/static/v1?label=license&message=MIT&color=green&style=flat-square |
| 12 | + :target: https://github.com/superannotateai/superannotate-python-sdk/blob/master/LICENSE/ |
| 13 | + :alt: License |
| 14 | +.. |Changelog| image:: https://img.shields.io/static/v1?label=change&message=log&color=yellow&style=flat-square |
| 15 | + :target: https://github.com/superannotateai/superannotate-python-sdk/blob/master/CHANGELOG.md |
| 16 | + :alt: Changelog |
| 17 | + |
| 18 | +Resources |
| 19 | +--------------- |
| 20 | + |
| 21 | +- API Reference and User Guide available on `Read the Docs <https://superannotate.readthedocs.io/en/stable/superannotate.sdk.html>`__ |
| 22 | +- `Platform documentation <https://doc.superannotate.com/>`__ |
| 23 | + |
| 24 | + |
| 25 | +Authentication |
| 26 | +--------------- |
| 27 | + |
| 28 | +.. code-block:: python |
| 29 | +
|
| 30 | + >>> from superannotate import SAClient |
| 31 | + # by environment variable SA_TOKEN |
| 32 | + >>> sa_client = SAClient() |
| 33 | + # by token |
| 34 | + >>> sa_client = SAClient(token='<team token>') |
| 35 | + # by config file |
| 36 | + # default path is ~/.superannotate/config.json |
| 37 | + >>> sa_client = SAClient(config_path='~/.superannotate/dev_config.json') |
| 38 | +
|
| 39 | +Using superannotate |
| 40 | +------------------- |
| 41 | + |
| 42 | +.. code-block:: python |
| 43 | +
|
| 44 | + >>> from superannotate import SAClient |
| 45 | + >>> sa_client =SAClient() |
| 46 | + >>> project = 'Dogs' |
| 47 | + >>> sa_client.create_project( |
| 48 | + project_name=project, |
| 49 | + project_description='Test project generated via SDK', |
| 50 | + project_type='Vector' |
| 51 | + ) |
| 52 | + >>> sa_client.create_annotation_class( |
| 53 | + project=project, |
| 54 | + name='dog', |
| 55 | + color='#F9E0FA', |
| 56 | + class_type='tag' |
| 57 | + ) |
| 58 | + >>> sa_client.attach_items( |
| 59 | + project=project, |
| 60 | + attachments=[ |
| 61 | + { |
| 62 | + 'url': 'https://drive.google.com/uc?export=download&id=1ipOrZNSTlPUkI_hnrW9aUD5yULqqq5Vl', |
| 63 | + 'name': 'dog.jpeg' |
| 64 | + } |
| 65 | + ] |
| 66 | + ) |
| 67 | + >>> sa_client.upload_annotations( |
| 68 | + project=project, |
| 69 | + annotations=[ |
| 70 | + { |
| 71 | + 'metadata': {'name': 'dog.jpeg'}, |
| 72 | + 'instances': [ |
| 73 | + {'type': 'tag', 'className': 'dog'} |
| 74 | + ] |
| 75 | + } |
| 76 | + ] |
| 77 | + ) |
| 78 | + >>> sa_client.get_annotations(project=project, items=['dog.jpeg']) |
| 79 | +
|
| 80 | +Installation |
| 81 | +------------ |
| 82 | + |
| 83 | +SuperAnnotate python SDK is available on PyPI: |
| 84 | + |
| 85 | +.. code-block:: bash |
| 86 | +
|
| 87 | + pip install superannotate |
| 88 | +
|
| 89 | +
|
| 90 | +The package officially supports Python 3.7+ and was tested under Linux and |
| 91 | +Windows (`Anaconda <https://www.anaconda.com/products/individual#windows>`__ |
| 92 | +) platforms. |
| 93 | + |
| 94 | +For more detailed installation steps and package usage please have a look at the `tutorial <https://superannotate.readthedocs.io/en/stable/tutorial.sdk.html>`__ |
| 95 | + |
| 96 | + |
| 97 | +Supported Features |
| 98 | +------------------ |
| 99 | + |
| 100 | +- search/get/create/clone/update/delete projects |
| 101 | +- search/get/create/delete folders |
| 102 | +- assign folders to project contributors |
| 103 | +- upload items to a project from a local or AWS S3 folder |
| 104 | +- attach items by URL or from an integrated storage, meanwhile keeping them secure in your cloud provider |
| 105 | +- get integrated cloud storages |
| 106 | +- upload annotations (also from local or AWS S3 folder) |
| 107 | +- delete annotations |
| 108 | +- set items annotations statuses |
| 109 | +- get/download/export annotations from a project (also to a local or AWS S3 folder) |
| 110 | +- invite/search team contributors or add contributors to a specific project |
| 111 | +- search/get/copy/move items in a project |
| 112 | +- query items using SA Query Language |
| 113 | +- define custom metadata for items and upload custom values (query based on your custom metadata) |
| 114 | +- upload priority scores |
| 115 | +- get available subsets (sets of segregated items), query items in a subset or add items to a subset |
| 116 | +- assign or anassign items to project contributors |
| 117 | +- download an image that has been uploaded to project |
| 118 | +- search/create/download/delete project annotation classes |
| 119 | +- search/download models |
| 120 | +- run predictions |
| 121 | +- convert annotations from/to COCO format |
| 122 | +- convert annotation from VOC, SuperVisely, LabelBox, DataLoop, VGG, VoTT, SageMaker, GoogleCloud, YOLO formats |
| 123 | +- CLI commands for simple tasks |
| 124 | + |
| 125 | +Questions and Issues |
| 126 | +-------------------- |
| 127 | + |
| 128 | +For questions and issues please use this repo’s issue tracker on GitHub or contact support@superannotate.com. |
0 commit comments