@@ -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_client.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_client.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_client.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_client.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
9111To create a new "Vector" project with name "Example Project 1" and description
10112"test":
@@ -13,19 +115,19 @@ To create a new "Vector" project with name "Example Project 1" and description
13115
14116 project = " Example Project 1"
15117
16- sa .create_project(project, " test" , " Vector" )
118+ sa_client .create_project(project, " test" , " Vector" )
17119
18120
19121 Uploading images to project
20- ---------------------------
122+ ===========================
21123
22124
23125To upload all images with extensions "jpg" or "png" from the
24126:file: `"<local_folder_path>" ` to the project "Example Project 1":
25127
26128.. code-block :: python
27129
28- sa .upload_images_from_folder_to_project(project, " <local_folder_path>" )
130+ sa_client .upload_images_from_folder_to_project(project, " <local_folder_path>" )
29131
30132 See the full argument options for
31133:py:func: `upload_images_from_folder_to_project ` :ref: `here <ref_upload_images_from_folder_to_project >`.
@@ -42,13 +144,13 @@ See the full argument options for
42144
43145
44146Creating a folder in a project
45- ______________________________
147+ ==============================
46148
47149To create a new folder "folder1" in the project "Example Project 1":
48150
49151.. code-block :: python
50152
51- sa .create_folder(project, " folder1" )
153+ sa_client .create_folder(project, " folder1" )
52154
53155 After that point almost all SDK functions that use project name as argument can
54156point to that folder with slash after the project name, e.g.,
@@ -60,16 +162,16 @@ point to that folder with slash after the project name, e.g.,
60162
61163 .. code-block :: python
62164
63- 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>" )
64166
65167 Working with annotation classes
66- _______________________________
168+ ===============================
67169
68170An annotation class for a project can be created with SDK's:
69171
70172.. code-block :: python
71173
72- sa .create_annotation_class(project, " Large car" , color = " #FFFFAA" )
174+ sa_client .create_annotation_class(project, " Large car" , color = " #FFFFAA" )
73175
74176
75177 To create annotation classes in bulk with SuperAnnotate export format
@@ -79,7 +181,7 @@ https://superannotate.readthedocs.io/en/stable/userguide/setup_project.html#work
79181
80182.. code-block :: python
81183
82- 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>" )
83185
84186
85187 All of the annotation classes of a project are downloaded (as :file: `classes/classes.json `) with
@@ -88,13 +190,13 @@ can also be downloaded separately with:
88190
89191.. code-block :: python
90192
91- sa .download_annotation_classes_json(project, " <path_to_local_folder>" )
193+ sa_client .download_annotation_classes_json(project, " <path_to_local_folder>" )
92194
93195 The :file: `classes.json ` file will be downloaded to :file: `"<path_to_local_folder>" ` folder.
94196
95197
96198Working with annotations
97- ________________________
199+ ========================
98200
99201
100202The SuperAnnotate format annotation JSONs have the general form:
@@ -143,7 +245,7 @@ you are uploading to should contain annotation class with that name.
143245
144246.. code-block :: python
145247
146- 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>" )
147249
148250
149251 This will try uploading to the project all the JSON files in the folder that have :file: `"<image_name>.json" ` postfix.
@@ -154,19 +256,19 @@ already be present in the project for the upload to work.
154256
155257
156258Exporting projects
157- __________________
259+ ==================
158260
159261To export the project annotations we need to prepare the export first:
160262
161263.. code-block :: python
162264
163- export = sa .prepare_export(project, include_fuse = True )
265+ export = sa_client .prepare_export(project, include_fuse = True )
164266
165267 We can download the prepared export with:
166268
167269.. code-block :: python
168270
169- 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 )
170272
171273:ref: `download_export <ref_download_export >` will wait until the export is
172274finished preparing and download it to the specified folder.
0 commit comments