Skip to content

Commit 8741aff

Browse files
authored
Merge pull request #819 from superannotateai/FRIDAY-4146
Docs update, project argument handling update
2 parents dd470d1 + b2e6d47 commit 8741aff

File tree

17 files changed

+387
-240
lines changed

17 files changed

+387
-240
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ History
77
All release highlights of this project will be documented in this file.
88

99
4.4.39 - November 13, 2025
10-
________________________
10+
__________________________
1111

1212
**Updated**
1313

docs/source/api_reference/api_metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Project metadata example:
1818
"creator_id": "admin@superannotate.com",
1919
"updatedAt": "2020-08-31T05:43:43.118Z",
2020
"createdAt": "2020-08-31T05:43:43.118Z"
21-
"type": "Vector",
21+
"type": "Vector", # Pixel, Video, Multimodal
2222
"attachment_name": None,
2323
"attachment_path": None,
2424
"entropy_status": 1,

docs/source/userguide/setup_project.rst

Lines changed: 109 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,110 @@ Setup Project
33
=============
44

55

6-
Creating a project
7-
------------------
6+
Creating a Multimodal project
7+
------------------------------
8+
9+
For Multimodal projects you **must** provide a ``form`` JSON object that
10+
conforms to SuperAnnotate's Multimodal form template schema. The form
11+
defines the project's UI layout and component behavior in the Multimodal
12+
Form Editor.
13+
14+
.. code-block:: python
15+
16+
minimal_form = {
17+
"components": [
18+
{
19+
"id": "component_id_0",
20+
"type": "select",
21+
"permissions": [],
22+
"hasTooltip": False,
23+
"label": "Select",
24+
"isRequired": False,
25+
"value": [],
26+
"options": [
27+
{"value": "Partially complete, needs review", "checked": False},
28+
{"value": "Incomplete", "checked": False},
29+
{"value": "Complete", "checked": False},
30+
{"value": "4", "checked": False}
31+
],
32+
"exclude": False,
33+
"isMultiselect": True,
34+
"placeholder": "Select"
35+
},
36+
{
37+
"id": "component_id_1",
38+
"type": "input",
39+
"permissions": [],
40+
"hasTooltip": False,
41+
"label": "Text input",
42+
"placeholder": "Placeholder",
43+
"isRequired": False,
44+
"value": "",
45+
"min": 0,
46+
"max": 300,
47+
"exclude": False
48+
},
49+
{
50+
"id": "component_id_2",
51+
"type": "number",
52+
"permissions": [],
53+
"hasTooltip": False,
54+
"label": "Number",
55+
"exclude": False,
56+
"isRequired": False,
57+
"value": None,
58+
"min": None,
59+
"max": None,
60+
"step": 1
61+
}
62+
],
63+
"code": "",
64+
"environments": []
65+
}
66+
67+
response = sa.create_project(
68+
project_name="My Multimodal Project",
69+
project_description="Example multimodal project created via SDK",
70+
project_type="Multimodal",
71+
form=minimal_form
72+
)
73+
74+
After creating the project, you can create folders and generate items:
75+
76+
.. code-block:: python
77+
78+
# Create a new folder in the project
79+
sa.create_folder(
80+
project="My Multimodal Project",
81+
folder_name="First Folder"
82+
)
83+
84+
# Generate multiple items in the specific project and folder
85+
# If there are no items in the folder, it will generate a blank item
86+
# otherwise, it will generate items based on the Custom Form
87+
sa.generate_items(
88+
project="My Multimodal Project/First Folder",
89+
count=10,
90+
name="My Item"
91+
)
92+
93+
To upload annotations to these items:
94+
95+
.. code-block:: python
96+
97+
annotations = [
98+
# list of annotation dicts
99+
]
100+
101+
sa.upload_annotations(
102+
project="My Multimodal Project/First Folder",
103+
annotations=annotations,
104+
keep_status=True,
105+
data_spec="multimodal"
106+
)
107+
108+
Creating a Vector project
109+
--------------------------
8110

9111
To create a new "Vector" project with name "Example Project 1" and description
10112
"test":
@@ -17,7 +119,7 @@ To create a new "Vector" project with name "Example Project 1" and description
17119
18120
19121
Uploading images to project
20-
---------------------------
122+
===========================
21123

22124

23125
To upload all images with extensions "jpg" or "png" from the
@@ -42,7 +144,7 @@ See the full argument options for
42144

43145

44146
Creating a folder in a project
45-
______________________________
147+
==============================
46148

47149
To create a new folder "folder1" in the project "Example Project 1":
48150

@@ -63,7 +165,7 @@ point to that folder with slash after the project name, e.g.,
63165
sa.upload_images_from_folder_to_project(project + "/folder1", "<local_folder_path>")
64166
65167
Working with annotation classes
66-
_______________________________
168+
===============================
67169

68170
An annotation class for a project can be created with SDK's:
69171

@@ -94,7 +196,7 @@ The :file:`classes.json` file will be downloaded to :file:`"<path_to_local_folde
94196

95197

96198
Working with annotations
97-
________________________
199+
========================
98200

99201

100202
The SuperAnnotate format annotation JSONs have the general form:
@@ -154,7 +256,7 @@ already be present in the project for the upload to work.
154256

155257

156258
Exporting projects
157-
__________________
259+
==================
158260

159261
To export the project annotations we need to prepare the export first:
160262

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
;addopts = -n 6 --dist loadscope
6+
addopts = -n 6 --dist loadscope

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

55

6-
__version__ = "4.4.39"
6+
__version__ = "4.4.40dev1"
77

88

99
os.environ.update({"sa_version": __version__})

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from lib.core.pydantic_v1 import ErrorWrapper
2121
from lib.core.pydantic_v1 import ValidationError
2222
from lib.infrastructure.controller import Controller
23-
from lib.infrastructure.utils import extract_project_folder
23+
from lib.infrastructure.utils import extract_project_folder_inputs
2424
from lib.infrastructure.validators import wrap_error
2525
from mixpanel import Mixpanel
2626

@@ -176,9 +176,7 @@ def default_parser(function_name: str, kwargs: dict) -> tuple:
176176
elif value is None:
177177
properties[key] = value
178178
elif key == "project":
179-
properties["project_name"], folder_name = extract_project_folder(value)
180-
if folder_name:
181-
properties["folder_name"] = folder_name
179+
properties.update(extract_project_folder_inputs(value))
182180
elif isinstance(value, (str, int, float, bool)):
183181
properties[key] = value
184182
elif isinstance(value, dict):

0 commit comments

Comments
 (0)