Skip to content

Commit a5d9fc7

Browse files
committed
Update docs
1 parent 04a0837 commit a5d9fc7

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

docs/source/userguide/quickstart.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ To create a new "Vector" project with name "Example Project 1" and description
101101
102102
project = "Example Project 1"
103103
104-
sa.create_project(project, "test", "Vector")
104+
sa_client.create_project(project, "test", "Vector")
105105
106106
----------
107107

@@ -115,7 +115,7 @@ To upload all images with extensions "jpg" or "png" from the
115115

116116
.. code-block:: python
117117
118-
sa.upload_images_from_folder_to_project(project, "<local_folder_path>")
118+
sa_client.upload_images_from_folder_to_project(project, "<local_folder_path>")
119119
120120
See the full argument options for
121121
:py:func:`upload_images_from_folder_to_project` :ref:`here <ref_upload_images_from_folder_to_project>`.
@@ -144,19 +144,19 @@ To download the image one can use:
144144
145145
image = "example_image1.jpg"
146146
147-
sa.download_image(project, image, "<path_to_local_dir>")
147+
sa_client.download_image(project, image, "<path_to_local_dir>")
148148
149149
To download image annotations:
150150

151151
.. code-block:: python
152152
153-
sa.download_image_annotations(project, image, "<path_to_local_dir>")
153+
sa_client.download_image_annotations(project, image, "<path_to_local_dir>")
154154
155155
Upload back to the platform with:
156156

157157
.. code-block:: python
158158
159-
sa.upload_image_annotations(project, image, "<path_to_json>")
159+
sa_client.upload_image_annotations(project, image, "<path_to_json>")
160160
161161
---------
162162

@@ -168,4 +168,4 @@ A team contributor can be invited to the team with:
168168

169169
.. code-block:: python
170170
171-
sa.invite_contributors_to_team(emails=["admin@superannotate.com"], admin=False)
171+
sa_client.invite_contributors_to_team(emails=["admin@superannotate.com"], admin=False)

docs/source/userguide/setup_project.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Form Editor.
6464
"environments": []
6565
}
6666
67-
response = sa.create_project(
67+
response = sa_client.create_project(
6868
project_name="My Multimodal Project",
6969
project_description="Example multimodal project created via SDK",
7070
project_type="Multimodal",
@@ -76,15 +76,15 @@ After creating the project, you can create folders and generate items:
7676
.. code-block:: python
7777
7878
# Create a new folder in the project
79-
sa.create_folder(
79+
sa_client.create_folder(
8080
project="My Multimodal Project",
8181
folder_name="First Folder"
8282
)
8383
8484
# Generate multiple items in the specific project and folder
8585
# If there are no items in the folder, it will generate a blank item
8686
# otherwise, it will generate items based on the Custom Form
87-
sa.generate_items(
87+
sa_client.generate_items(
8888
project="My Multimodal Project/First Folder",
8989
count=10,
9090
name="My Item"
@@ -98,7 +98,7 @@ To upload annotations to these items:
9898
# list of annotation dicts
9999
]
100100
101-
sa.upload_annotations(
101+
sa_client.upload_annotations(
102102
project="My Multimodal Project/First Folder",
103103
annotations=annotations,
104104
keep_status=True,
@@ -115,7 +115,7 @@ To create a new "Vector" project with name "Example Project 1" and description
115115
116116
project = "Example Project 1"
117117
118-
sa.create_project(project, "test", "Vector")
118+
sa_client.create_project(project, "test", "Vector")
119119
120120
121121
Uploading images to project
@@ -127,7 +127,7 @@ To upload all images with extensions "jpg" or "png" from the
127127

128128
.. code-block:: python
129129
130-
sa.upload_images_from_folder_to_project(project, "<local_folder_path>")
130+
sa_client.upload_images_from_folder_to_project(project, "<local_folder_path>")
131131
132132
See the full argument options for
133133
:py:func:`upload_images_from_folder_to_project` :ref:`here <ref_upload_images_from_folder_to_project>`.
@@ -150,7 +150,7 @@ To create a new folder "folder1" in the project "Example Project 1":
150150

151151
.. code-block:: python
152152
153-
sa.create_folder(project, "folder1")
153+
sa_client.create_folder(project, "folder1")
154154
155155
After that point almost all SDK functions that use project name as argument can
156156
point to that folder with slash after the project name, e.g.,
@@ -162,7 +162,7 @@ point to that folder with slash after the project name, e.g.,
162162

163163
.. code-block:: python
164164
165-
sa.upload_images_from_folder_to_project(project + "/folder1", "<local_folder_path>")
165+
sa_client.upload_images_from_folder_to_project(project + "/folder1", "<local_folder_path>")
166166
167167
Working with annotation classes
168168
===============================
@@ -171,7 +171,7 @@ An annotation class for a project can be created with SDK's:
171171

172172
.. code-block:: python
173173
174-
sa.create_annotation_class(project, "Large car", color="#FFFFAA")
174+
sa_client.create_annotation_class(project, "Large car", color="#FFFFAA")
175175
176176
177177
To create annotation classes in bulk with SuperAnnotate export format
@@ -181,7 +181,7 @@ https://superannotate.readthedocs.io/en/stable/userguide/setup_project.html#work
181181

182182
.. code-block:: python
183183
184-
sa.create_annotation_classes_from_classes_json(project, "<path_to_classes_json>")
184+
sa_client.create_annotation_classes_from_classes_json(project, "<path_to_classes_json>")
185185
186186
187187
All of the annotation classes of a project are downloaded (as :file:`classes/classes.json`) with
@@ -190,7 +190,7 @@ can also be downloaded separately with:
190190

191191
.. code-block:: python
192192
193-
sa.download_annotation_classes_json(project, "<path_to_local_folder>")
193+
sa_client.download_annotation_classes_json(project, "<path_to_local_folder>")
194194
195195
The :file:`classes.json` file will be downloaded to :file:`"<path_to_local_folder>"` folder.
196196

@@ -245,7 +245,7 @@ you are uploading to should contain annotation class with that name.
245245

246246
.. code-block:: python
247247
248-
sa.upload_annotations_from_folder_to_project(project, "<path_to_local_dir>")
248+
sa_client.upload_annotations_from_folder_to_project(project, "<path_to_local_dir>")
249249
250250
251251
This will try uploading to the project all the JSON files in the folder that have :file:`"<image_name>.json"` postfix.
@@ -262,13 +262,13 @@ To export the project annotations we need to prepare the export first:
262262

263263
.. code-block:: python
264264
265-
export = sa.prepare_export(project, include_fuse=True)
265+
export = sa_client.prepare_export(project, include_fuse=True)
266266
267267
We can download the prepared export with:
268268

269269
.. code-block:: python
270270
271-
sa.download_export(project, export, "<local_folder_path>", extract_zip_contents=True)
271+
sa_client.download_export(project, export, "<local_folder_path>", extract_zip_contents=True)
272272
273273
:ref:`download_export <ref_download_export>` will wait until the export is
274274
finished preparing and download it to the specified folder.

docs/source/userguide/utilities.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ to convert them to other annotation formats:
2020

2121
.. code-block:: python
2222
23-
sa.export_annotation("<input_folder>", "<output_folder>", "<dataset_format>", "<dataset_name>",
23+
sa_client.export_annotation("<input_folder>", "<output_folder>", "<dataset_format>", "<dataset_name>",
2424
"<project_type>", "<task>")
2525
2626
.. note::
@@ -197,10 +197,10 @@ Example Python Script:
197197
csv_to_jsonl("annotations.csv", "annotations.jsonl")
198198
199199
# Upload to SuperAnnotate
200-
sa = SAClient()
200+
sa_client = SAClient()
201201
annotations = [json.loads(line) for line in Path("annotations.jsonl").open("r", encoding="utf-8")]
202202
203-
response = sa.upload_annotations(
203+
response = sa_client.upload_annotations(
204204
project="project1/folder1",
205205
annotations=annotations,
206206
keep_status=True,
@@ -214,7 +214,7 @@ Fetching Annotations and Converting to JSONL/CSV
214214
Steps to Retrieve and Convert Annotations:
215215
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216216

217-
1. Fetch **annotations from SuperAnnotate** using `sa.get_annotations()`.
217+
1. Fetch **annotations from SuperAnnotate** using `sa_client.get_annotations()`.
218218
2. Convert the **annotation list into JSONL format**.
219219
3. Convert the **JSONL data into CSV** for external use.
220220

@@ -230,8 +230,8 @@ Python Script to Convert Annotations to JSONL:
230230
jsonl_file.write('\n')
231231
232232
# Fetch annotations from SuperAnnotate
233-
sa = SAClient()
234-
annotations = sa.get_annotations("project", data_spec="multimodal")
233+
sa_client = SAClient()
234+
annotations = sa_client.get_annotations("project", data_spec="multimodal")
235235
236236
# Convert to JSONL
237237
convert_annotations_to_jsonl(annotations, "fetched_annotations.jsonl")
@@ -284,7 +284,7 @@ SuperAnnotate format annotations:
284284

285285
.. code-block:: python
286286
287-
df = sa.aggregate_annotations_as_df("<path_to_project_folder>")
287+
df = sa_client.aggregate_annotations_as_df("<path_to_project_folder>")
288288
289289
The created DataFrame will have columns specified at
290290
:ref:`aggregate_annotations_as_df <ref_aggregate_annotations_as_df>`.

0 commit comments

Comments
 (0)