Skip to content

Commit b93fb96

Browse files
authored
Merge pull request #813 from superannotateai/develop
Develop
2 parents 665d224 + 101f898 commit b93fb96

24 files changed

+1988
-39
lines changed

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ History
66

77
All release highlights of this project will be documented in this file.
88

9+
4.4.38 - August 20, 2025
10+
________________________
11+
12+
**Updated**
13+
14+
- ``SAClient.create_project`` now supports template uploads for Multimodal projects with the addition of a new ``form`` parameter.
15+
- ``SAClient.upload_video_to_project`` should install ``ffmpeg-python`` manually for the function.
16+
- ``SAClient.upload_videos_from_folder_to_project`` should install ``ffmpeg-python`` manually for the function.
17+
18+
919
4.4.37 - July 18, 2025
1020
______________________
1121

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ opencv-python-headless~=4.7
55
packaging~=24.0
66
plotly~=5.14
77
pandas~=2.0
8-
ffmpeg-python~=0.2
98
pillow>=9.5,~=10.0
109
tqdm~=4.66
1110
requests==2.*
1211
aiofiles==23.*
1312
fire==0.4.0
1413
mixpanel==4.8.3
15-
superannotate-schemas==1.0.49
14+
superannotate-schemas==1.0.49

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.37"
6+
__version__ = "4.4.38"
77

88

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

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

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,35 +1131,40 @@ def create_project(
11311131
workflows: Any = None,
11321132
instructions_link: str = None,
11331133
workflow: str = None,
1134+
form: dict = None,
11341135
):
1135-
"""Create a new project in the team.
1136+
"""Creates a new project in the team. For Multimodal projects, you must provide a valid form object,
1137+
which serves as a template determining the layout and behavior of the project's interface.
11361138
1137-
:param project_name: the new project's name
1139+
:param project_name: The new project's name.
11381140
:type project_name: str
11391141
1140-
:param project_description: the new project's description
1142+
:param project_description: The new project's description.
11411143
:type project_description: str
11421144
1143-
:param project_type: the new project type, Vector, Pixel, Video, Document, Tiled, PointCloud, Multimodal.
1145+
:param project_type: The project type. Supported types: 'Vector', 'Pixel', 'Video', 'Document', 'Tiled', 'PointCloud', 'Multimodal'.
11441146
:type project_type: str
11451147
11461148
:param settings: list of settings objects
11471149
:type settings: list of dicts
11481150
1149-
:param classes: list of class objects
1151+
:param classes: List of class objects. Not allowed for 'Multimodal' projects.
11501152
:type classes: list of dicts
11511153
1152-
:param workflows: Deprecated
1154+
:param workflows: Deprecated. Do not use.
11531155
:type workflows: list of dicts
11541156
1155-
:param workflow: the name of the workflow already created within the team, which must match exactly.
1156-
If None, the default “System workflow” workflow will be set.
1157+
:param workflow: Name of the workflow already created within the team (must match exactly). If None, the default "System workflow" will be used.
11571158
:type workflow: str
11581159
1159-
:param instructions_link: str of instructions URL
1160+
:param instructions_link: URL for project instructions.
11601161
:type instructions_link: str
11611162
1162-
:return: dict object metadata the new project
1163+
:param form: Required for Multimodal projects. Must be a JSON object that conforms to SuperAnnotate’s schema
1164+
for Multimodal form templates, as used in the Multimodal Form Editor.
1165+
:type form: dict
1166+
1167+
:return: Metadata of the newly created project.
11631168
:rtype: dict
11641169
"""
11651170
if workflows is not None:
@@ -1172,6 +1177,16 @@ def create_project(
11721177
settings = parse_obj_as(List[SettingEntity], settings)
11731178
else:
11741179
settings = []
1180+
if ProjectType(project_type) == ProjectType.MULTIMODAL:
1181+
if not form:
1182+
raise AppException(
1183+
"A form object is required when creating a Multimodal project."
1184+
)
1185+
if classes is not None:
1186+
raise AppException(
1187+
"Classes cannot be provided for Multimodal projects."
1188+
)
1189+
settings.append(SettingEntity(attribute="TemplateState", value=1))
11751190
if classes:
11761191
classes = parse_obj_as(List[AnnotationClassEntity], classes)
11771192
project_entity = entities.ProjectEntity(
@@ -1194,6 +1209,13 @@ def create_project(
11941209
project_response = self.controller.projects.create(project_entity)
11951210
project_response.raise_for_status()
11961211
project = project_response.data
1212+
if form:
1213+
form_response = self.controller.projects.attach_form(project, form)
1214+
try:
1215+
form_response.raise_for_status()
1216+
except AppException:
1217+
self.controller.projects.delete(project)
1218+
raise
11971219
if classes:
11981220
classes_response = self.controller.annotation_classes.create_multiple(
11991221
project, classes
@@ -2392,6 +2414,9 @@ def upload_videos_from_folder_to_project(
23922414
"""Uploads image frames from all videos with given extensions from folder_path to the project.
23932415
Sets status of all the uploaded images to set_status if it is not None.
23942416
2417+
.. note::
2418+
Only works on Image projects.
2419+
23952420
:param project: project name or folder path (e.g., "project1/folder1")
23962421
:type project: str
23972422
@@ -2486,6 +2511,9 @@ def upload_video_to_project(
24862511
"""Uploads image frames from video to platform. Uploaded images will have
24872512
names "<video_name>_<frame_no>.jpg".
24882513
2514+
.. note::
2515+
Only works on Image projects.
2516+
24892517
:param project: project name or folder path (e.g., "project1/folder1")
24902518
:type project: str
24912519

src/superannotate/lib/core/entities/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from lib.core.entities.items import PROJECT_ITEM_ENTITY_MAP
1313
from lib.core.entities.items import TiledEntity
1414
from lib.core.entities.items import VideoEntity
15+
from lib.core.entities.multimodal_form import FormModel
16+
from lib.core.entities.multimodal_form import generate_classes_from_form
1517
from lib.core.entities.project import AttachmentEntity
1618
from lib.core.entities.project import ContributorEntity
1719
from lib.core.entities.project import CustomFieldEntity
@@ -55,4 +57,7 @@
5557
"UserEntity",
5658
"IntegrationEntity",
5759
"PROJECT_ITEM_ENTITY_MAP",
60+
# multimodal
61+
"FormModel",
62+
"generate_classes_from_form",
5863
]

0 commit comments

Comments
 (0)