Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ History
All release highlights of this project will be documented in this file.

4.4.16 - November 12, 2023
_______________________
__________________________

**Added**

Expand Down
1 change: 1 addition & 0 deletions src/superannotate/lib/app/interface/sdk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,7 @@ def upload_annotations(
folder=folder,
annotations=annotations,
keep_status=keep_status,
user=self.controller.current_user,
)
if response.errors:
raise AppException(response.errors)
Expand Down
5 changes: 5 additions & 0 deletions src/superannotate/lib/core/usecases/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ def __init__(
folder: FolderEntity,
annotations: List[dict],
service_provider: BaseServiceProvider,
user: UserEntity,
keep_status: bool = False,
):
super().__init__(reporter)
Expand All @@ -304,6 +305,7 @@ def __init__(
self._service_provider = service_provider
self._keep_status = keep_status
self._report = Report([], [], [], [])
self._user = user

def validate_project_type(self):
if self._project.type == constants.ProjectType.PIXEL.value:
Expand Down Expand Up @@ -439,6 +441,9 @@ def execute(self):
annotation_name = annotation["metadata"]["name"]
item = name_item_map.get(annotation_name)
if item:
annotation = UploadAnnotationUseCase.set_defaults(
self._user.email, annotation, self._project.type
)
items_to_upload.append(
ItemToUpload(item=item, annotation_json=annotation)
)
Expand Down
2 changes: 2 additions & 0 deletions src/superannotate/lib/infrastructure/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ def upload_multiple(
folder: FolderEntity,
annotations: List[dict],
keep_status: bool,
user: UserEntity,
):
use_case = usecases.UploadAnnotationsUseCase(
reporter=Reporter(),
Expand All @@ -576,6 +577,7 @@ def upload_multiple(
annotations=annotations,
service_provider=self.service_provider,
keep_status=keep_status,
user=user,
)
return use_case.execute()

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/annotations/test_upload_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def test_annotation_folder_upload_download(self):
assert i["annotation_status"] == "InProgress"
assert annotation["instances"][-1]["type"] == "tag"
assert annotation["instances"][-2]["type"] == "tag"
assert annotation["instances"][-2]["probability"] == 100
assert annotation["instances"][-2]["creationType"] == "Preannotation"

def test_upload_keep_true(self):
self._attach_items()
Expand Down