Skip to content

Commit 6e84a85

Browse files
authored
Merge pull request #603 from superannotateai/friday
Friday
2 parents 6dd1f09 + 9a8ff00 commit 6e84a85

Some content is hidden

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

42 files changed

+1955
-1458
lines changed

CHANGELOG.md

Lines changed: 0 additions & 379 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 596 additions & 0 deletions
Large diffs are not rendered by default.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Welcome to the SuperAnnotate Python Software Development Kit (SDK), which enable
1212
:target: https://github.com/superannotateai/superannotate-python-sdk/blob/master/LICENSE/
1313
:alt: License
1414
.. |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
15+
:target: https://github.com/superannotateai/superannotate-python-sdk/blob/master/CHANGELOG.rst
1616
:alt: Changelog
1717

1818
Resources

docs/source/api_reference/api_folder.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Folders
33
=======
44

55
.. automethod:: superannotate.SAClient.search_folders
6+
.. automethod:: superannotate.SAClient.set_folder_status
67
.. automethod:: superannotate.SAClient.assign_folder
78
.. automethod:: superannotate.SAClient.unassign_folder
89
.. automethod:: superannotate.SAClient.get_folder_by_id

docs/source/api_reference/api_project.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ Projects
55
.. _ref_search_projects:
66
.. automethod:: superannotate.SAClient.create_project
77
.. automethod:: superannotate.SAClient.search_projects
8-
.. automethod:: superannotate.SAClient.create_project_from_metadata
98
.. automethod:: superannotate.SAClient.clone_project
109
.. automethod:: superannotate.SAClient.rename_project
1110
.. automethod:: superannotate.SAClient.delete_project
1211
.. _ref_get_project_metadata:
1312
.. automethod:: superannotate.SAClient.get_project_by_id
1413
.. automethod:: superannotate.SAClient.set_project_status
1514
.. automethod:: superannotate.SAClient.get_project_metadata
16-
.. automethod:: superannotate.SAClient.get_project_image_count
1715
.. automethod:: superannotate.SAClient.upload_images_to_project
1816
.. automethod:: superannotate.SAClient.attach_items_from_integrated_storage
1917
.. automethod:: superannotate.SAClient.upload_image_to_project

docs/source/changelog_link.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../CHANGELOG.rst

docs/source/index.rst

Lines changed: 2 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -16,115 +16,7 @@
1616
API Reference <api_reference/index>
1717
CLI Reference <cli_client>
1818
SA Server <sa_server>
19+
History <changelog_link>
1920
LICENSE.rst
2021

21-
----------
22-
23-
SuperAnnotate Python SDK documentation
24-
==================================================================
25-
26-
SuperAnnotate Python SDK allows access to the platform without web browser:
27-
28-
.. code-block:: python
29-
30-
from superannotate import SAClient
31-
32-
33-
sa_client = SAClient()
34-
35-
project = 'Dogs'
36-
37-
sa_client.create_project(
38-
project_name=project,
39-
project_description='Test project generated via SDK',
40-
project_type='Vector'
41-
)
42-
43-
sa_client.create_annotation_class(
44-
project=project,
45-
name='dog',
46-
color='#F9E0FA',
47-
class_type='tag'
48-
)
49-
50-
sa_client.attach_items(
51-
project=project,
52-
attachments=[
53-
{
54-
'url': 'https://drive.google.com/uc?export=download&id=1ipOrZNSTlPUkI_hnrW9aUD5yULqqq5Vl',
55-
'name': 'dog.jpeg'
56-
}
57-
]
58-
)
59-
60-
sa_client.upload_annotations(
61-
project=project,
62-
annotations=[
63-
{
64-
'metadata': {'name': 'dog.jpeg'},
65-
'instances': [
66-
{'type': 'tag', 'className': 'dog'}
67-
]
68-
}
69-
]
70-
)
71-
72-
sa_client.get_annotations(project=project, items=['dog.jpeg'])
73-
74-
----------
75-
76-
Installation
77-
____________
78-
79-
80-
SDK is available on PyPI:
81-
82-
.. code-block:: bash
83-
84-
pip install superannotate
85-
86-
87-
The package officially supports Python 3.7+ and was tested under Linux and
88-
Windows (`Anaconda <https://www.anaconda.com/products/individual#windows>`_) platforms.
89-
90-
----------
91-
92-
Supported Features
93-
__________________
94-
95-
- Search projects
96-
- Create/delete a project
97-
- Upload images to a project from a local or AWS S3 folder
98-
- Upload videos to a project from a local folder
99-
- Upload annotations/pre-annotations to a project from local or AWS S3 folder
100-
- Set the annotation status of the images being uploaded
101-
- Export annotations from a project to a local or AWS S3 folder
102-
- Share and unshare a project with a team contributor
103-
- Invite a team contributor
104-
- Search images in a project
105-
- Download a single image
106-
- Copy/move image between projects
107-
- Get image bytes (e.g., for numpy array creation)
108-
- Set image annotation status
109-
- Download image annotations/pre-annotations
110-
- Create/download project annotation classes
111-
- Add annotations to images on platform
112-
- Convert annotation format from/to COCO
113-
- Add annotations to local SuperAnnotate format JSONs
114-
- CLI commands for simple tasks
115-
- Aggregate class/attribute distribution as histogram
116-
117-
----------
118-
119-
License
120-
_______
121-
122-
This SDK is distributed under the :ref:`MIT License <ref_license>`.
123-
124-
----------
125-
126-
Questions and Issues
127-
____________________
128-
129-
For questions and issues please use issue tracker on
130-
`GitHub <https://github.com/superannotateai/superannotate-python-sdk>`_.
22+
.. include:: ../../README.rst

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
pydicom>=2.0.0
22
boto3>=1.14.53
3-
requests==2.26.0
3+
requests==2.28.2
44
requests-toolbelt>=0.9.1
55
aiohttp>=3.8.1
66
tqdm==4.64.0
77
pillow==9.4.0
88
matplotlib>=3.3.1
99
xmltodict==0.12.0
1010
opencv-python>=4.4.0.42
11-
wheel>=0.38.4
11+
wheel>=0.40.0
1212
packaging>=20.4
1313
plotly>=4.1.0
1414
ffmpeg-python>=0.2.0
1515
fire==0.4.0
1616
mixpanel==4.8.3
17-
pydantic>=1.10.4
17+
pydantic>=1.10.7
1818
setuptools>=57.4.0
1919
email-validator>=1.0.3
2020
jsonschema==3.2.0
2121
pandas>=1.1.4
2222
aiofiles==0.8.0
23-
Werkzeug==2.2.2
23+
Werkzeug==2.2.3
2424
Jinja2==3.1.2

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
import typing
55

6-
__version__ = "4.4.11"
6+
__version__ = "4.4.12dev4"
77

88

99
sys.path.append(os.path.split(os.path.realpath(__file__))[0])

src/superannotate/lib/app/interface/base_interface.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ def get_mp_instance(self) -> Mixpanel:
132132
return Mixpanel(mp_token)
133133

134134
@staticmethod
135-
def get_default_payload(team_name, user_id):
135+
def get_default_payload(team_name, user_email):
136136
return {
137137
"SDK": True,
138138
"Team": team_name,
139-
"Team Owner": user_id,
139+
"User Email": user_email,
140140
"Version": __version__,
141141
"Python version": platform.python_version(),
142142
"Python interpreter type": platform.python_implementation(),
@@ -207,13 +207,15 @@ def _track_method(self, args, kwargs, success: bool):
207207
function_name = self.function.__name__ if self.function else ""
208208
arguments = self.extract_arguments(self.function, *args, **kwargs)
209209
event_name, properties = self.default_parser(function_name, arguments)
210-
user_id = client.controller.team_data.creator_id
210+
user_email = client.controller.current_user.email
211211
team_name = client.controller.team_data.name
212212

213213
properties["Success"] = success
214-
default = self.get_default_payload(team_name=team_name, user_id=user_id)
214+
default = self.get_default_payload(
215+
team_name=team_name, user_email=user_email
216+
)
215217
self._track(
216-
user_id,
218+
user_email,
217219
event_name,
218220
{**default, **properties, **CONFIG.get_current_session().data},
219221
)

0 commit comments

Comments
 (0)