diff --git a/src/superannotate/__init__.py b/src/superannotate/__init__.py index 46f4ad380..705d3c859 100644 --- a/src/superannotate/__init__.py +++ b/src/superannotate/__init__.py @@ -60,6 +60,7 @@ from superannotate.lib.app.interface.sdk_interface import create_project from superannotate.lib.app.interface.sdk_interface import create_project_from_metadata from superannotate.lib.app.interface.sdk_interface import delete_annotation_class +from superannotate.lib.app.interface.sdk_interface import delete_annotations from superannotate.lib.app.interface.sdk_interface import ( delete_contributor_to_team_invitation, ) @@ -235,6 +236,7 @@ "assign_images", "unassign_images", "download_image_annotations", + "delete_annotations", "upload_image_to_project", "upload_image_annotations", "upload_images_from_public_urls_to_project", diff --git a/src/superannotate/lib/app/interface/sdk_interface.py b/src/superannotate/lib/app/interface/sdk_interface.py index 2e335f3d2..92224ede2 100644 --- a/src/superannotate/lib/app/interface/sdk_interface.py +++ b/src/superannotate/lib/app/interface/sdk_interface.py @@ -1498,7 +1498,7 @@ def get_image_annotations(project: Union[str, dict], image_name: str): project_name=project_name, folder_name=folder_name, image_name=image_name ) if res.errors: - raise AppValidationException(res) + raise AppException(res) return res.data @@ -3593,3 +3593,24 @@ def aggregate_annotations_as_df( verbose, folder_names, ) + + +@Trackable +@validate_input +def delete_annotations(project: str, image_names: List[str] = None): + """ + Delete image annotations from a given list of images. + + :param project: project name or folder path (e.g., "project1/folder1") + :type project: str + :param image_names: image names. If None, all image annotations from a given project/folder will be deleted. + :type image_names: list of strs + """ + + project_name, folder_name = extract_project_folder(project) + + response = controller.delete_annotations( + project_name=project, folder_name=folder_name, image_names=image_names + ) + if response.errors: + raise AppException(response.errors) diff --git a/src/superannotate/lib/core/serviceproviders.py b/src/superannotate/lib/core/serviceproviders.py index a2806c6b1..d12ac70d3 100644 --- a/src/superannotate/lib/core/serviceproviders.py +++ b/src/superannotate/lib/core/serviceproviders.py @@ -296,3 +296,17 @@ def run_prediction( self, team_id: int, project_id: int, ml_model_id: int, image_ids: list ): raise NotImplementedError + + def delete_image_annotations( + self, + team_id: int, + project_id: int, + folder_id: int = None, + image_names: List[str] = None, + ) -> int: + raise NotImplementedError + + def get_annotations_delete_progress( + self, team_id: int, project_id: int, poll_id: int + ): + raise NotImplementedError diff --git a/src/superannotate/lib/core/usecases.py b/src/superannotate/lib/core/usecases.py index ac300bfff..a7402f4c1 100644 --- a/src/superannotate/lib/core/usecases.py +++ b/src/superannotate/lib/core/usecases.py @@ -15,6 +15,7 @@ from pathlib import Path from typing import Iterable from typing import List +from typing import Optional import boto3 import cv2 @@ -2081,6 +2082,9 @@ def execute(self): file_postfix = "___objects.json" else: file_postfix = "___pixel.json" + data["annotation_mask_filename"] = f"{self._image_name}___save.png" + data["annotation_json_filename"] = f"{self._image_name}{file_postfix}" + response = requests.get( url=credentials["annotation_json_path"]["url"], headers=credentials["annotation_json_path"]["headers"], @@ -2098,7 +2102,6 @@ def execute(self): headers=annotation_blue_map_creds["headers"], ) data["annotation_mask"] = io.BytesIO(response.content) - data["annotation_mask_filename"] = f"{self._image_name}___save.png" self._response.data = data @@ -4482,3 +4485,56 @@ def execute(self): self._response.data = uploaded, failed_images, duplications return self._response + + +class DeleteAnnotations(BaseUseCase): + POLL_AWAIT_TIME = 2 + + def __init__( + self, + project: ProjectEntity, + folder: FolderEntity, + backend_service: SuerannotateServiceProvider, + image_names: Optional[List[str]] = None, + ): + super().__init__() + self._project = project + self._folder = folder + self._image_names = image_names + self._backend_service = backend_service + + def execute(self) -> Response: + + if self._folder.name == "root" and not self._image_names: + poll_id = self._backend_service.delete_image_annotations( + project_id=self._project.uuid, team_id=self._project.team_id, + ) + else: + poll_id = self._backend_service.delete_image_annotations( + project_id=self._project.uuid, + team_id=self._project.team_id, + folder_id=self._folder.uuid, + image_names=self._image_names, + ) + + if poll_id: + timeout_start = time.time() + while time.time() < timeout_start + self.POLL_AWAIT_TIME: + progress = int( + self._backend_service.get_annotations_delete_progress( + project_id=self._project.uuid, + team_id=self._project.team_id, + poll_id=poll_id, + ).get("process", -1) + ) + if 0 < progress < 100: + logger.info(f"Delete annotations in progress {progress}/100") + elif 0 > progress: + self._response.errors = "Annotations delete fails." + break + else: + logger.info(f"Annotations deleted") + break + else: + self._response.errors = AppException("Invalid image names.") + return self._response diff --git a/src/superannotate/lib/infrastructure/controller.py b/src/superannotate/lib/infrastructure/controller.py index 0c5038c5c..570f68733 100644 --- a/src/superannotate/lib/infrastructure/controller.py +++ b/src/superannotate/lib/infrastructure/controller.py @@ -1446,3 +1446,19 @@ def search_models( ml_models_repo=ml_models_repo, condition=condition ) return use_case.execute() + + def delete_annotations( + self, + project_name: str, + folder_name: str, + image_names: Optional[List[str]] = None, + ): + project = self._get_project(project_name) + folder = self._get_folder(project, folder_name) + use_case = usecases.DeleteAnnotations( + project=project, + folder=folder, + backend_service=self._backend_client, + image_names=image_names, + ) + return use_case.execute() diff --git a/src/superannotate/lib/infrastructure/services.py b/src/superannotate/lib/infrastructure/services.py index c264935c0..5a49a4b9d 100644 --- a/src/superannotate/lib/infrastructure/services.py +++ b/src/superannotate/lib/infrastructure/services.py @@ -181,6 +181,8 @@ class SuperannotateBackendService(BaseBackendService): URL_SEGMENTATION = "images/segmentation" URL_PREDICTION = "images/prediction" URL_SET_IMAGES_STATUSES_BULK = "image/updateAnnotationStatusBulk" + URL_DELETE_ANNOTATIONS = "annotations/remove" + URL_DELETE_ANNOTATIONS_PROGRESS = "annotations/getRemoveStatus" def get_project(self, uuid: int, team_id: int): get_project_url = urljoin(self.api_url, self.URL_GET_PROJECT.format(uuid)) @@ -945,3 +947,35 @@ def run_prediction( }, ) return res.json() + + def delete_image_annotations( + self, + team_id: int, + project_id: int, + folder_id: int = None, + image_names: List[str] = None, + ) -> int: + delete_annotations_url = urljoin(self.api_url, self.URL_DELETE_ANNOTATIONS) + params = {"team_id": team_id, "project_id": project_id} + data = {} + if folder_id: + params["folder_id"] = folder_id + if image_names: + data["image_names"] = image_names + response = self._request( + delete_annotations_url, "post", params=params, data=data + ) + if response.ok: + return response.json()["poll_id"] + + def get_annotations_delete_progress( + self, team_id: int, project_id: int, poll_id: int + ): + get_progress_url = urljoin(self.api_url, self.URL_DELETE_ANNOTATIONS_PROGRESS) + + response = self._request( + get_progress_url, + "get", + params={"team_id": team_id, "project_id": project_id, "poll_id": poll_id}, + ) + return response.json() diff --git a/tests/data_set/sample_project_vector_single_image/classes/classes.json b/tests/data_set/sample_project_vector_single_image/classes/classes.json new file mode 100644 index 000000000..810a5a436 --- /dev/null +++ b/tests/data_set/sample_project_vector_single_image/classes/classes.json @@ -0,0 +1,157 @@ +[ + { + "id": 55917, + "project_id": 11979, + "name": "Personal vehicle", + "color": "#ecb65f", + "count": 25, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:48:19.000Z", + "attribute_groups": [ + { + "id": 17245, + "class_id": 55917, + "name": "Num doors", + "is_multiselect": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z", + "attributes": [ + { + "id": 62792, + "group_id": 17245, + "project_id": 11979, + "name": "2", + "count": 1, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:46:28.000Z" + }, + { + "id": 62793, + "group_id": 17245, + "project_id": 11979, + "name": "4", + "count": 1, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z" + } + ] + } + ] + }, + { + "id": 55918, + "project_id": 11979, + "name": "Large vehicle", + "color": "#737b28", + "count": 1, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:48:19.000Z", + "attribute_groups": [ + { + "id": 17246, + "class_id": 55918, + "name": "swedish", + "is_multiselect": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z", + "attributes": [ + { + "id": 62794, + "group_id": 17246, + "project_id": 11979, + "name": "yes", + "count": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z" + }, + { + "id": 62795, + "group_id": 17246, + "project_id": 11979, + "name": "no", + "count": 1, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:46:28.000Z" + } + ] + }, + { + "id": 17247, + "class_id": 55918, + "name": "Num doors", + "is_multiselect": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z", + "attributes": [ + { + "id": 62796, + "group_id": 17247, + "project_id": 11979, + "name": "2", + "count": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z" + }, + { + "id": 62797, + "group_id": 17247, + "project_id": 11979, + "name": "4", + "count": 1, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:46:28.000Z" + } + ] + } + ] + }, + { + "id": 55919, + "project_id": 11979, + "name": "Human", + "color": "#e4542b", + "count": 9, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:48:14.000Z", + "attribute_groups": [ + { + "id": 17248, + "class_id": 55919, + "name": "Height", + "is_multiselect": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z", + "attributes": [ + { + "id": 62798, + "group_id": 17248, + "project_id": 11979, + "name": "Tall", + "count": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z" + }, + { + "id": 62799, + "group_id": 17248, + "project_id": 11979, + "name": "Short", + "count": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z" + } + ] + } + ] + }, + { + "id": 55920, + "project_id": 11979, + "name": "Plant", + "color": "#46ccb2", + "count": 0, + "createdAt": "2020-10-12T11:35:20.000Z", + "updatedAt": "2020-10-12T11:35:20.000Z", + "attribute_groups": [] + } +] diff --git a/tests/data_set/sample_project_vector_single_image/example_image_1.jpg b/tests/data_set/sample_project_vector_single_image/example_image_1.jpg new file mode 100644 index 000000000..4dee9355b Binary files /dev/null and b/tests/data_set/sample_project_vector_single_image/example_image_1.jpg differ diff --git a/tests/data_set/sample_project_vector_single_image/example_image_1.jpg___fuse.png b/tests/data_set/sample_project_vector_single_image/example_image_1.jpg___fuse.png new file mode 100644 index 000000000..13781afee Binary files /dev/null and b/tests/data_set/sample_project_vector_single_image/example_image_1.jpg___fuse.png differ diff --git a/tests/data_set/sample_project_vector_single_image/example_image_1.jpg___objects.json b/tests/data_set/sample_project_vector_single_image/example_image_1.jpg___objects.json new file mode 100644 index 000000000..1fee7ad53 --- /dev/null +++ b/tests/data_set/sample_project_vector_single_image/example_image_1.jpg___objects.json @@ -0,0 +1,3092 @@ +{ + "metadata": { + "name": "example_image_1.jpg", + "width": 1024, + "height": 683, + "status": "Completed", + "pinned": false, + "isPredicted": null, + "projectId": null, + "annotatorEmail": null, + "qaEmail": null + }, + "instances": [ + { + "type": "bbox", + "classId": 72274, + "probability": 100, + "points": { + "x1": 437.16, + "x2": 465.23, + "y1": 341.5, + "y2": 357.09 + }, + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [ + { + "id": 117845, + "groupId": 28230, + "name": "2", + "groupName": "Num doors" + } + ], + "trackingId": "aaa97f80c9e54a5f2dc2e920fc92e5033d9af45b", + "error": null, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "bbox", + "classId": 72274, + "probability": 100, + "points": { + "x1": 480.0, + "x2": 490.0, + "y1": 340.0, + "y2": 350.0 + }, + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [ + { + "id": 117845, + "groupId": 28230, + "name": "2", + "groupName": "Num doors" + } + ], + "error": null, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle1" + }, + { + "type": "bbox", + "classId": 72274, + "probability": 100, + "points": { + "x1": 500.0, + "x2": 510.0, + "y1": 340.0, + "y2": 350.0 + }, + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [ + { + "id": 117845, + "groupId": 28230, + "name": "10", + "groupName": "Num doors" + } + ], + "error": null, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "bbox", + "classId": 72274, + "probability": 100, + "points": { + "x1": 520.0, + "x2": 530.0, + "y1": 340.0, + "y2": 350.0 + }, + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [ + { + "id": 117845, + "groupId": 28230, + "name": "4", + "groupName": "Num doors1" + } + ], + "error": null, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "template", + "classId": 72274, + "probability": 100, + "points": [ + { + "id": 1, + "x": 800.8311630011381, + "y": 431.7220764160156 + }, + { + "id": 2, + "x": 834.6965942382812, + "y": 431.8820692877566 + }, + { + "id": 3, + "x": 834.6965942382812, + "y": 480.848388671875 + }, + { + "id": 4, + "x": 801.0125574701838, + "y": 480.848388671875 + }, + { + "id": 5, + "x": 702.6083268971072, + "y": 437.5428573337124 + }, + { + "id": 6, + "x": 702.5221557617188, + "y": 474.8859480851478 + } + ], + "connections": [ + { + "id": 1, + "from": 1, + "to": 2 + }, + { + "id": 2, + "from": 2, + "to": 3 + }, + { + "id": 3, + "from": 3, + "to": 4 + }, + { + "id": 4, + "from": 4, + "to": 1 + }, + { + "id": 5, + "from": 1, + "to": 5 + }, + { + "id": 6, + "from": 5, + "to": 6 + }, + { + "id": 7, + "from": 6, + "to": 4 + } + ], + "groupId": 0, + "pointLabels": { + "4": "top_left", + "5": "bottom_left" + }, + "locked": false, + "visible": false, + "attributes": [ + { + "name": "4", + "groupName": "Num doors", + "groupId": 28230, + "id": 117846 + } + ], + "templateId": -1, + "trackingId": "cbde2787e76c41be77c1079e8d090252ad701ea", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 281.98, + 383.75, + 282.55, + 378.1, + 287.26, + 376.12, + 297.35, + 372.91, + 311.01, + 372.82, + 319.59, + 375.74, + 323.55, + 378.28, + 325.91, + 381.68, + 326.66, + 385.45, + 325.43, + 387.62, + 324.02, + 388.75, + 317.23, + 388.84, + 315.54, + 390.26, + 312.43, + 390.54, + 308.66, + 388.46, + 306.39, + 388.84, + 297.44, + 389.03, + 291.5, + 388.18, + 287.64, + 384.51 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "bf069efee9e65463824466f442a409a137eabaee", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 266.9, + 384.88, + 267.47, + 404.21, + 276.23, + 404.87, + 277.65, + 407.32, + 278.78, + 407.79, + 282.17, + 407.79, + 284.15, + 407.32, + 285.19, + 403.92, + 292.73, + 403.83, + 293.29, + 405.43, + 294.99, + 406.37, + 297.53, + 406.28, + 298.57, + 405.43, + 301.12, + 404.39, + 302.15, + 402.41, + 303.38, + 395.53, + 301.49, + 391.39, + 296.12, + 389.03, + 291.78, + 388.84, + 286.79, + 384.13, + 284.9, + 384.51 + ], + "groupId": 1, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "a520dde722112d1579ff65260166d02ac1c14e2", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 262.94, + 385.54, + 263.88, + 404.68, + 262.47, + 404.96, + 262.19, + 406.66, + 261.34, + 408.07, + 259.74, + 408.54, + 256.53, + 408.64, + 255.59, + 408.16, + 254.84, + 407.13, + 254.08, + 403.92, + 252.76, + 402.79, + 250.69, + 402.32, + 249.75, + 401.19, + 250.5, + 389.03, + 254.18, + 384.51, + 262.56, + 384.32 + ], + "groupId": 1, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "97e8bcc305b69af97b1a51c102c22a03887410bd", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 348.62, + 395.91, + 367.76, + 395.34, + 367, + 384.32, + 364.36, + 378, + 349.09, + 377.81, + 346.55, + 385.54, + 346.55, + 395.82 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "15e2bd2a9bf66c4df00df9fbe6fd6db43abc56", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 325.25, + 402.32, + 321.1, + 410.99, + 321, + 424.47, + 329.21, + 424.75, + 329.49, + 423.06, + 344.57, + 423.15, + 344.85, + 424.85, + 349.94, + 424.38, + 349.09, + 409.2, + 344.57, + 401.47 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "98c3f3a3fdeb809c7a8de125447acce21abda84f", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 114.81, + 432.5, + 149.32, + 430.8, + 169.65, + 442.24, + 187.65, + 446.05, + 192.94, + 453.25, + 192.31, + 462.14, + 189.77, + 467.44, + 183.84, + 470.83, + 177.48, + 472.52, + 169.65, + 480.57, + 163.93, + 481.62, + 160.54, + 477.18, + 159.27, + 472.73, + 159.91, + 468.28, + 159.49, + 458.76, + 156.94, + 450.71, + 136.62, + 437.37, + 119.04, + 436.52 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "de78e5e22b397426228bed63c15ad2f41bfe653", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 120.52, + 437.37, + 135.77, + 437.79, + 156.31, + 450.5, + 158.85, + 459.39, + 159.27, + 468.71, + 158.21, + 474.21, + 152.92, + 480.78, + 147.84, + 483.74, + 142.54, + 484.17, + 139.37, + 482.05, + 140.43, + 477.6, + 144.87, + 475.91, + 146.78, + 471.25, + 144.03, + 457.27 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "7adde574ed24f845d700b0c8371122bfe667751f", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 81.46, + 437.16, + 94.38, + 435.04, + 110.9, + 433.56, + 117.67, + 434.83, + 133.77, + 448.8, + 144.99, + 457.27, + 147.32, + 471.67, + 145.62, + 475.91, + 141.6, + 477.6, + 136.31, + 485.22, + 131.65, + 487.98, + 126.78, + 488.61, + 122.97, + 472.73, + 118.52, + 464.26, + 110.9, + 455.37, + 103.06, + 441.18, + 99.89, + 438.64 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "4a47c34904d5e6bafdab32f9896c4013b1ddd153", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 684.8, + 420.93, + 683.1, + 416.3, + 634.11, + 414.48, + 626.68, + 419.72, + 622.9, + 424.35, + 609.62, + 425.69, + 604.63, + 427.76, + 600.73, + 434.34, + 600.48, + 440.19, + 600.97, + 440.92, + 604.02, + 442.01, + 604.99, + 445.67, + 607.18, + 447.99, + 610.96, + 450.18, + 618.64, + 450.91, + 621.2, + 448.72, + 622.54, + 446.16, + 626.8, + 446.16, + 626.92, + 440.67, + 629.6, + 435.31, + 633.75, + 432.39, + 646.79, + 430.32, + 664.09, + 420.81, + 685.05, + 422.4 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "eb882a5e0012c77a1557c47bf386b21b6f6848", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 674.69, + 421.91, + 664.82, + 421.3, + 646.66, + 430.56, + 634.24, + 432.63, + 629.85, + 435.68, + 627.29, + 440.55, + 627.05, + 444.94, + 628.14, + 447.13, + 628.63, + 447.86, + 631.68, + 448.35, + 633.38, + 451.4, + 634.48, + 452.25, + 634.72, + 446.89, + 636.43, + 437.99, + 645.57, + 434.34, + 656.53, + 431.05 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "56b1a09c67ce96a1719afe9f8c2b50b3dd08cd1c", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 100, + "points": [ + 729.77, + 442.26, + 729.89, + 436.04, + 726.11, + 425.93, + 719.9, + 423.86, + 676.27, + 422.93, + 670.06, + 424.22, + 656.78, + 431.41, + 641.67, + 435.68, + 636.92, + 438.12, + 635.09, + 447.25, + 634.97, + 452.86, + 635.7, + 453.71, + 640.33, + 455.17, + 643.25, + 457.86, + 649.59, + 458.22, + 652.27, + 457.86, + 654.95, + 454.32, + 656.29, + 453.47, + 664.45, + 453.96, + 667.62, + 458.71, + 668.72, + 458.95, + 671.64, + 458.95, + 673.96, + 458.34, + 676.52, + 456.76, + 678.35, + 454.32, + 686.75, + 454.93, + 689.92, + 459.56, + 691.51, + 460.78, + 696.87, + 461.27, + 699.67, + 460.29, + 702.84, + 456.51, + 705.27, + 455.91, + 706.86, + 452.37, + 708.69, + 450.79, + 722.21, + 445.18, + 725.87, + 445.43 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "12a358abc908ad69e8b599ab359e12ecfe1047", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 96, + "points": [ + 703, + 462.81, + 703, + 464.81, + 712, + 472.81, + 712, + 474.81, + 724, + 474.81, + 729, + 471.81, + 741.61, + 472.86, + 745.32, + 476.75, + 753.29, + 476.57, + 756.25, + 473.97, + 770, + 473.81, + 780, + 478.81, + 784, + 478.81, + 792, + 474.81, + 802, + 474.81, + 806, + 478.81, + 812, + 479.81, + 817, + 477.81, + 820, + 473.81, + 832.61, + 472.49, + 834, + 468.81, + 833, + 453.81, + 827, + 448.81, + 805, + 437.81, + 783, + 434.81, + 750, + 434.81, + 739, + 437.81, + 726, + 445.81, + 722, + 445.81, + 709, + 450.81, + 707, + 452.81, + 705.11, + 457.11 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "8f8ef909a683eaf9852b4d9784ec63b471c58d16", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 98, + "points": [ + 1023.86, + 432.09, + 1019, + 434, + 1008, + 440, + 1001, + 447, + 960, + 450, + 952, + 453, + 945, + 460, + 940, + 472, + 942, + 496, + 945, + 500, + 948, + 500, + 954, + 510, + 958, + 514, + 980, + 515, + 992, + 504, + 999, + 506, + 1006, + 513, + 1009, + 514, + 1016.82, + 516.78, + 1023.86, + 515.86 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "d9975dc56b159b1690fbdea7b04dd35f2ba69366", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "polygon", + "classId": 72274, + "probability": 98, + "points": [ + 6, + 447, + 0, + 459, + 0, + 528, + 2, + 531, + 12, + 530, + 20, + 536, + 25, + 536, + 33, + 530, + 61, + 530, + 77, + 528, + 86, + 534, + 94, + 535, + 99, + 532, + 100, + 525, + 102, + 522, + 109.39, + 521.38, + 111.09, + 529.47, + 122.6, + 528.2, + 126.44, + 491.97, + 122, + 474, + 118, + 465, + 110, + 456, + 103, + 442, + 99, + 439, + 47, + 438, + 16, + 442 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "76d42d45e8b0c11a055dff75a405b515bb1dd53f", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Personal vehicle" + }, + { + "type": "bbox", + "classId": 72275, + "probability": 100, + "points": { + "x1": 240.68, + "x2": 304.61, + "y1": 378.93, + "y2": 410.11 + }, + "groupId": 0, + "pointLabels": { + "0": "Top Left", + "4": "Bottom Right" + }, + "locked": false, + "visible": true, + "attributes": [ + { + "id": 117848, + "groupId": 28231, + "name": "no", + "groupName": "swedish" + }, + { + "id": 117850, + "groupId": 28232, + "name": "4", + "groupName": "Num doors" + } + ], + "trackingId": "ac43151b5ac2d511beac8d2ec15695f421b93882", + "error": null, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Large vehicle" + }, + { + "type": "template", + "classId": 72276, + "probability": 100, + "points": [ + { + "id": 1, + "x": 590.36328125, + "y": 505.471431864795 + }, + { + "id": 2, + "x": 590.2529541686341, + "y": 504.29565523299704 + }, + { + "id": 3, + "x": 590.0863828554258, + "y": 502.0855402722193 + }, + { + "id": 4, + "x": 589.8926669948704, + "y": 500.1575188822054 + }, + { + "id": 5, + "x": 588.2789742606027, + "y": 491.4069519042969 + }, + { + "id": 6, + "x": 591.6578771570227, + "y": 498.7841862403542 + }, + { + "id": 7, + "x": 592.6675015963041, + "y": 497.5725781649412 + }, + { + "id": 8, + "x": 593.4538138253348, + "y": 495.05589353721325 + }, + { + "id": 9, + "x": 591.9352490770948, + "y": 502.2054028345276 + }, + { + "id": 10, + "x": 591.4315175486134, + "y": 504.8054433249257 + }, + { + "id": 11, + "x": 591.0675032060225, + "y": 506.48433274969244 + }, + { + "id": 12, + "x": 593.6178112658826, + "y": 501.4214392039917 + }, + { + "id": 13, + "x": 592.6682424021291, + "y": 504.65690054240156 + }, + { + "id": 14, + "x": 591.8309557568896, + "y": 507.1707458496094 + }, + { + "id": 15, + "x": 594.685306758671, + "y": 499.50420568423283 + }, + { + "id": 16, + "x": 594.4346668956044, + "y": 503.3523914672602 + }, + { + "id": 17, + "x": 593.4855715573489, + "y": 505.4433191217528 + }, + { + "id": 18, + "x": 592.9555204622038, + "y": 507.0652772868338 + }, + { + "id": 19, + "x": 589.5701713142814, + "y": 496.6512277677259 + }, + { + "id": 20, + "x": 590.8887191604782, + "y": 499.291411604618 + }, + { + "id": 21, + "x": 591.1992693890583, + "y": 501.8345208353304 + }, + { + "id": 22, + "x": 591.0341186523438, + "y": 501.9896778816582 + } + ], + "connections": [ + { + "id": 1, + "from": 5, + "to": 4 + }, + { + "id": 2, + "from": 3, + "to": 4 + }, + { + "id": 3, + "from": 3, + "to": 2 + }, + { + "id": 4, + "from": 2, + "to": 1 + }, + { + "id": 5, + "from": 5, + "to": 6 + }, + { + "id": 6, + "from": 6, + "to": 9 + }, + { + "id": 7, + "from": 9, + "to": 10 + }, + { + "id": 8, + "from": 10, + "to": 11 + }, + { + "id": 9, + "from": 5, + "to": 7 + }, + { + "id": 10, + "from": 7, + "to": 12 + }, + { + "id": 11, + "from": 12, + "to": 13 + }, + { + "id": 12, + "from": 13, + "to": 14 + }, + { + "id": 13, + "from": 5, + "to": 8 + }, + { + "id": 14, + "from": 8, + "to": 15 + }, + { + "id": 15, + "from": 15, + "to": 16 + }, + { + "id": 16, + "from": 16, + "to": 17 + }, + { + "id": 17, + "from": 17, + "to": 18 + }, + { + "id": 18, + "from": 5, + "to": 19 + }, + { + "id": 19, + "from": 19, + "to": 20 + }, + { + "id": 20, + "from": 20, + "to": 21 + }, + { + "id": 21, + "from": 21, + "to": 22 + } + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "templateId": -1, + "trackingId": "2c89e809614523cf56c9aeab932e90b87aaf5e4f", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "template", + "classId": 72276, + "probability": 100, + "points": [ + { + "id": 1, + "x": 332.9866027832032, + "y": 526.2959883676228 + }, + { + "id": 2, + "x": 332.8439004919032, + "y": 527.5132367654812 + }, + { + "id": 3, + "x": 334.35612353649776, + "y": 527.3324179308058 + }, + { + "id": 4, + "x": 336.2640990372543, + "y": 524.0976645502819 + }, + { + "id": 5, + "x": 337.51601736886164, + "y": 516.1050720214844 + }, + { + "id": 6, + "x": 339.060296362573, + "y": 524.7754271337591 + }, + { + "id": 7, + "x": 341.64884537916925, + "y": 526.5125154522543 + }, + { + "id": 8, + "x": 344.0771833147321, + "y": 527.3880219566797 + }, + { + "id": 9, + "x": 335.88342117477254, + "y": 527.9910814406194 + }, + { + "id": 10, + "x": 334.6968087835627, + "y": 529.0659044885928 + }, + { + "id": 11, + "x": 333.86405081277377, + "y": 527.8757251825314 + }, + { + "id": 12, + "x": 339.9883503337483, + "y": 529.320022177355 + }, + { + "id": 13, + "x": 338.46802612975404, + "y": 530.370269900207 + }, + { + "id": 14, + "x": 337.1430909712236, + "y": 530.7341613769531 + }, + { + "id": 15, + "x": 341.9785882300073, + "y": 531.0127476105173 + }, + { + "id": 16, + "x": 340.85258785708925, + "y": 532.1869901255352 + }, + { + "id": 17, + "x": 339.1688606346047, + "y": 532.8862634202454 + }, + { + "id": 18, + "x": 339.0958418793731, + "y": 532.8511886128618 + }, + { + "id": 19, + "x": 342.74045026171336, + "y": 523.5337313474565 + }, + { + "id": 20, + "x": 343.0975823874003, + "y": 525.8059083903495 + }, + { + "id": 21, + "x": 341.95265642103254, + "y": 527.6336142573132 + }, + { + "id": 22, + "x": 340.4774169921875, + "y": 527.7661633949826 + } + ], + "connections": [ + { + "id": 1, + "from": 5, + "to": 4 + }, + { + "id": 2, + "from": 3, + "to": 4 + }, + { + "id": 3, + "from": 3, + "to": 2 + }, + { + "id": 4, + "from": 2, + "to": 1 + }, + { + "id": 5, + "from": 5, + "to": 6 + }, + { + "id": 6, + "from": 6, + "to": 9 + }, + { + "id": 7, + "from": 9, + "to": 10 + }, + { + "id": 8, + "from": 10, + "to": 11 + }, + { + "id": 9, + "from": 5, + "to": 7 + }, + { + "id": 10, + "from": 7, + "to": 12 + }, + { + "id": 11, + "from": 12, + "to": 13 + }, + { + "id": 12, + "from": 13, + "to": 14 + }, + { + "id": 13, + "from": 5, + "to": 8 + }, + { + "id": 14, + "from": 8, + "to": 15 + }, + { + "id": 15, + "from": 15, + "to": 16 + }, + { + "id": 16, + "from": 16, + "to": 17 + }, + { + "id": 17, + "from": 17, + "to": 18 + }, + { + "id": 18, + "from": 5, + "to": 19 + }, + { + "id": 19, + "from": 19, + "to": 20 + }, + { + "id": 20, + "from": 20, + "to": 21 + }, + { + "id": 21, + "from": 21, + "to": 22 + } + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "templateId": -1, + "trackingId": "bab62dc810b0cee390f8d5fb5fa62fade3c8da7", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "template", + "classId": 72276, + "probability": 100, + "points": [ + { + "id": 1, + "x": 500.7473449707031, + "y": 512.2212813363728 + }, + { + "id": 2, + "x": 499.83990268916875, + "y": 511.0267255350125 + }, + { + "id": 3, + "x": 499.35212573376333, + "y": 508.78712984486833 + }, + { + "id": 4, + "x": 499.49539176186363, + "y": 505.6112143549695 + }, + { + "id": 5, + "x": 505.1166338239397, + "y": 498.2973327636719 + }, + { + "id": 6, + "x": 501.5269101321042, + "y": 506.7595579931341 + }, + { + "id": 7, + "x": 503.99778336745044, + "y": 506.673098948348 + }, + { + "id": 8, + "x": 506.9555402483259, + "y": 505.9015717613673 + }, + { + "id": 9, + "x": 501.35003494430373, + "y": 510.62224599140063 + }, + { + "id": 10, + "x": 501.986939398797, + "y": 512.5206164026553 + }, + { + "id": 11, + "x": 503.15418142800803, + "y": 512.9774707880001 + }, + { + "id": 12, + "x": 503.6314472575764, + "y": 510.3629298921987 + }, + { + "id": 13, + "x": 503.9346398992853, + "y": 513.4720155056757 + }, + { + "id": 14, + "x": 506.3155763227861, + "y": 514.4830017089844 + }, + { + "id": 15, + "x": 506.32755673586666, + "y": 510.11449321598604 + }, + { + "id": 16, + "x": 506.78978268130794, + "y": 513.0534452036602 + }, + { + "id": 17, + "x": 508.6354744041359, + "y": 513.6350427171204 + }, + { + "id": 18, + "x": 508.56245564890435, + "y": 512.0705489644243 + }, + { + "id": 19, + "x": 509.736452458979, + "y": 503.5178622068315 + }, + { + "id": 20, + "x": 510.1524224752909, + "y": 508.84887714034943 + }, + { + "id": 21, + "x": 509.8898512452513, + "y": 511.676521972157 + }, + { + "id": 22, + "x": 509.7675476074219, + "y": 511.8091321449826 + } + ], + "connections": [ + { + "id": 1, + "from": 5, + "to": 4 + }, + { + "id": 2, + "from": 3, + "to": 4 + }, + { + "id": 3, + "from": 3, + "to": 2 + }, + { + "id": 4, + "from": 2, + "to": 1 + }, + { + "id": 5, + "from": 5, + "to": 6 + }, + { + "id": 6, + "from": 6, + "to": 9 + }, + { + "id": 7, + "from": 9, + "to": 10 + }, + { + "id": 8, + "from": 10, + "to": 11 + }, + { + "id": 9, + "from": 5, + "to": 7 + }, + { + "id": 10, + "from": 7, + "to": 12 + }, + { + "id": 11, + "from": 12, + "to": 13 + }, + { + "id": 12, + "from": 13, + "to": 14 + }, + { + "id": 13, + "from": 5, + "to": 8 + }, + { + "id": 14, + "from": 8, + "to": 15 + }, + { + "id": 15, + "from": 15, + "to": 16 + }, + { + "id": 16, + "from": 16, + "to": 17 + }, + { + "id": 17, + "from": 17, + "to": 18 + }, + { + "id": 18, + "from": 5, + "to": 19 + }, + { + "id": 19, + "from": 19, + "to": 20 + }, + { + "id": 20, + "from": 20, + "to": 21 + }, + { + "id": 21, + "from": 21, + "to": 22 + } + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "templateId": -1, + "trackingId": "f8f542a9e9da918d5d5cb8eed9052713302089", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "template", + "classId": 72276, + "probability": 100, + "points": [ + { + "id": 1, + "x": 460.2714192848242, + "y": 486.08071083487926 + }, + { + "id": 2, + "x": 454.92882596998356, + "y": 481.9066804669699 + }, + { + "id": 3, + "x": 461.0707178220127, + "y": 481.61528130084 + }, + { + "id": 4, + "x": 462.32680898178, + "y": 482.46856689453125 + }, + { + "id": 5, + "x": 444.8684189242054, + "y": 483.808782080494 + }, + { + "id": 6, + "x": 455.8683091235324, + "y": 497.2664014146353 + }, + { + "id": 7, + "x": 439.86159351357213, + "y": 498.91779556832523 + }, + { + "id": 8, + "x": 432.98627658437374, + "y": 519.4614616257791 + }, + { + "id": 9, + "x": 415.8799309258186, + "y": 515.9119205914317 + }, + { + "id": 10, + "x": 467.5532979208077, + "y": 499.0862192385027 + }, + { + "id": 11, + "x": 479.28433580441475, + "y": 514.1935318132136 + }, + { + "id": 12, + "x": 498.51239013671875, + "y": 512.030284394326 + }, + { + "id": 13, + "x": 454.8632612058889, + "y": 546.5478157765722 + }, + { + "id": 14, + "x": 444.0484270284733, + "y": 546.0017547475499 + }, + { + "id": 15, + "x": 464.16791732413037, + "y": 546.2800095783913 + }, + { + "id": 16, + "x": 468.63255127661785, + "y": 573.6905686937465 + }, + { + "id": 17, + "x": 457.1555372435924, + "y": 577.0907707675425 + }, + { + "id": 18, + "x": 432.2792663574219, + "y": 587.0443088500142 + }, + { + "id": 19, + "x": 429.91821938954894, + "y": 606.0040783618011 + }, + { + "id": 20, + "x": 463.69909188680566, + "y": 602.9990721708784 + }, + { + "id": 21, + "x": 484.317011118421, + "y": 607.0152893066406 + } + ], + "connections": [ + { + "id": 1, + "from": 1, + "to": 6 + }, + { + "id": 2, + "from": 6, + "to": 10 + }, + { + "id": 3, + "from": 10, + "to": 11 + }, + { + "id": 4, + "from": 11, + "to": 12 + }, + { + "id": 5, + "from": 7, + "to": 8 + }, + { + "id": 6, + "from": 8, + "to": 9 + }, + { + "id": 7, + "from": 14, + "to": 7 + }, + { + "id": 8, + "from": 14, + "to": 13 + }, + { + "id": 9, + "from": 13, + "to": 15 + }, + { + "id": 10, + "from": 15, + "to": 10 + }, + { + "id": 11, + "from": 7, + "to": 6 + }, + { + "id": 12, + "from": 14, + "to": 16 + }, + { + "id": 13, + "from": 15, + "to": 17 + }, + { + "id": 14, + "from": 16, + "to": 20 + }, + { + "id": 15, + "from": 20, + "to": 21 + }, + { + "id": 16, + "from": 17, + "to": 18 + }, + { + "id": 17, + "from": 18, + "to": 19 + }, + { + "id": 18, + "from": 5, + "to": 2 + }, + { + "id": 19, + "from": 2, + "to": 1 + }, + { + "id": 20, + "from": 1, + "to": 1 + }, + { + "id": 21, + "from": 3, + "to": 1 + }, + { + "id": 22, + "from": 3, + "to": 4 + } + ], + "groupId": 0, + "pointLabels": { + "0": "Nose" + }, + "locked": false, + "visible": false, + "attributes": [], + "templateId": -1, + "trackingId": "4fd95b7d6d95b7b84750e65aa89c70b9c86eb3b8", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "template", + "classId": 72276, + "probability": 100, + "points": [ + { + "id": 1, + "x": 569.4099335784475, + "y": 411.3099511426366 + }, + { + "id": 2, + "x": 565.2798621579027, + "y": 406.3627038525488 + }, + { + "id": 3, + "x": 567.377754831435, + "y": 405.3775634765625 + }, + { + "id": 4, + "x": 562.1341137290701, + "y": 404.67809199715805 + }, + { + "id": 5, + "x": 554.7715578497942, + "y": 408.0821593507321 + }, + { + "id": 6, + "x": 543.3504267346603, + "y": 422.3509408794715 + }, + { + "id": 7, + "x": 530.5325718803996, + "y": 432.4575436529285 + }, + { + "id": 8, + "x": 513.1264329109782, + "y": 468.5712030528786 + }, + { + "id": 9, + "x": 505.0783099316068, + "y": 498.26488325838557 + }, + { + "id": 10, + "x": 564.5019009957019, + "y": 431.59166109918834 + }, + { + "id": 11, + "x": 572.9879904477306, + "y": 466.0899617391194 + }, + { + "id": 12, + "x": 588.320701407949, + "y": 491.39197319472385 + }, + { + "id": 13, + "x": 547.1874731524312, + "y": 499.0241945917735 + }, + { + "id": 14, + "x": 536.2172232162276, + "y": 499.38451563669537 + }, + { + "id": 15, + "x": 558.2200212079587, + "y": 496.61095606638287 + }, + { + "id": 16, + "x": 565.8375729727319, + "y": 546.3956734358432 + }, + { + "id": 17, + "x": 545.4810409910515, + "y": 549.0779244124057 + }, + { + "id": 18, + "x": 502.6168107549702, + "y": 573.1785073042392 + }, + { + "id": 19, + "x": 506.98697907641065, + "y": 599.8044128417969 + }, + { + "id": 20, + "x": 555.6301612734296, + "y": 594.6135561518564 + }, + { + "id": 21, + "x": 585.93212890625, + "y": 602.2106018066406 + } + ], + "connections": [ + { + "id": 1, + "from": 1, + "to": 6 + }, + { + "id": 2, + "from": 6, + "to": 10 + }, + { + "id": 3, + "from": 10, + "to": 11 + }, + { + "id": 4, + "from": 11, + "to": 12 + }, + { + "id": 5, + "from": 7, + "to": 8 + }, + { + "id": 6, + "from": 8, + "to": 9 + }, + { + "id": 7, + "from": 14, + "to": 7 + }, + { + "id": 8, + "from": 14, + "to": 13 + }, + { + "id": 9, + "from": 13, + "to": 15 + }, + { + "id": 10, + "from": 15, + "to": 10 + }, + { + "id": 11, + "from": 7, + "to": 6 + }, + { + "id": 12, + "from": 14, + "to": 16 + }, + { + "id": 13, + "from": 15, + "to": 17 + }, + { + "id": 14, + "from": 16, + "to": 20 + }, + { + "id": 15, + "from": 20, + "to": 21 + }, + { + "id": 16, + "from": 17, + "to": 18 + }, + { + "id": 17, + "from": 18, + "to": 19 + }, + { + "id": 18, + "from": 5, + "to": 2 + }, + { + "id": 19, + "from": 2, + "to": 1 + }, + { + "id": 20, + "from": 1, + "to": 1 + }, + { + "id": 21, + "from": 3, + "to": 1 + }, + { + "id": 22, + "from": 3, + "to": 4 + } + ], + "groupId": 0, + "pointLabels": { + "0": "Nose" + }, + "locked": false, + "visible": false, + "attributes": [], + "templateId": -1, + "trackingId": "8894b2a1727f62631d26e885a5aaf9bc2ac2a578", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "template", + "classId": 72276, + "probability": 100, + "points": [ + { + "id": 1, + "x": 388.9594774956746, + "y": 424.3453820508397 + }, + { + "id": 2, + "x": 383.78257983006284, + "y": 420.2971520947363 + }, + { + "id": 3, + "x": 387.1454388819895, + "y": 419.5367736816406 + }, + { + "id": 4, + "x": 382.7214935156717, + "y": 418.8373022022362 + }, + { + "id": 5, + "x": 369.81775320578504, + "y": 421.3423522218259 + }, + { + "id": 6, + "x": 368.5353785473912, + "y": 441.4006845318153 + }, + { + "id": 7, + "x": 353.1593986570741, + "y": 443.28386811581913 + }, + { + "id": 8, + "x": 340.9145244608405, + "y": 484.88446599233174 + }, + { + "id": 9, + "x": 337.471170384727, + "y": 516.0647184634637 + }, + { + "id": 10, + "x": 380.0734310110131, + "y": 441.19236910700084 + }, + { + "id": 11, + "x": 392.6590966976267, + "y": 481.59771320396317 + }, + { + "id": 12, + "x": 411.22125244140625, + "y": 510.38843315566135 + }, + { + "id": 13, + "x": 368.27931488725477, + "y": 514.5319460566172 + }, + { + "id": 14, + "x": 361.465192188568, + "y": 515.6977785761485 + }, + { + "id": 15, + "x": 378.7043428557912, + "y": 512.1187075312266 + }, + { + "id": 16, + "x": 393.26020935016874, + "y": 556.5333687483432 + }, + { + "id": 17, + "x": 344.09536524138383, + "y": 562.7657295881869 + }, + { + "id": 18, + "x": 321.86363692684523, + "y": 598.4685463667392 + }, + { + "id": 19, + "x": 345.55514438756916, + "y": 610.3072814941406 + }, + { + "id": 20, + "x": 402.05302902711884, + "y": 603.0690004877939 + }, + { + "id": 21, + "x": 426.8170225465453, + "y": 607.0261535644531 + } + ], + "connections": [ + { + "id": 1, + "from": 1, + "to": 6 + }, + { + "id": 2, + "from": 6, + "to": 10 + }, + { + "id": 3, + "from": 10, + "to": 11 + }, + { + "id": 4, + "from": 11, + "to": 12 + }, + { + "id": 5, + "from": 7, + "to": 8 + }, + { + "id": 6, + "from": 8, + "to": 9 + }, + { + "id": 7, + "from": 14, + "to": 7 + }, + { + "id": 8, + "from": 14, + "to": 13 + }, + { + "id": 9, + "from": 13, + "to": 15 + }, + { + "id": 10, + "from": 15, + "to": 10 + }, + { + "id": 11, + "from": 7, + "to": 6 + }, + { + "id": 12, + "from": 14, + "to": 16 + }, + { + "id": 13, + "from": 15, + "to": 17 + }, + { + "id": 14, + "from": 16, + "to": 20 + }, + { + "id": 15, + "from": 20, + "to": 21 + }, + { + "id": 16, + "from": 17, + "to": 18 + }, + { + "id": 17, + "from": 18, + "to": 19 + }, + { + "id": 18, + "from": 5, + "to": 2 + }, + { + "id": 19, + "from": 2, + "to": 1 + }, + { + "id": 20, + "from": 1, + "to": 1 + }, + { + "id": 21, + "from": 3, + "to": 1 + }, + { + "id": 22, + "from": 3, + "to": 4 + } + ], + "groupId": 0, + "pointLabels": { + "0": "Nose" + }, + "locked": false, + "visible": false, + "attributes": [], + "templateId": -1, + "trackingId": "2fe1f0c6c4af879955d6f19cfcf113a6b929b73", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "polygon", + "classId": 72276, + "probability": 100, + "points": [ + 496.93, + 506.95, + 500.11, + 499.6, + 499.38, + 494.21, + 500.85, + 490.53, + 502.81, + 490.04, + 503.79, + 488.32, + 505.02, + 480.97, + 507.22, + 477.3, + 510.16, + 466.51, + 520.21, + 451.32, + 522.42, + 446.41, + 524.38, + 435.63, + 541.78, + 412.84, + 543, + 408.92, + 541.78, + 405.73, + 541.78, + 398.13, + 542.51, + 394.95, + 543.74, + 392.74, + 546.19, + 389.8, + 548.4, + 388.82, + 556.97, + 388.82, + 563.35, + 391.27, + 565.06, + 393.23, + 566.29, + 396.42, + 567.76, + 405.24, + 569.23, + 409.41, + 569.23, + 412.59, + 568.25, + 414.55, + 568, + 419.45, + 565.8, + 422.4, + 562.37, + 423.62, + 561.63, + 425.09, + 561.63, + 427.05, + 566.04, + 429.5, + 568, + 433.42, + 569.72, + 445.68, + 594.96, + 498.62, + 594.96, + 502.78, + 593.98, + 505.48, + 591.53, + 508.18, + 589.82, + 508.42, + 588.35, + 505.97, + 586.88, + 500.58, + 585.4, + 499.6, + 582.46, + 499.35, + 568.98, + 481.71, + 571.19, + 508.18, + 569.96, + 510.63, + 567.76, + 510.87, + 572.66, + 595.43, + 574.87, + 597.63, + 580.01, + 598.61, + 586.39, + 598.61, + 588.84, + 599.35, + 589.33, + 601.31, + 587.86, + 604.01, + 586.88, + 604.5, + 553.3, + 604.99, + 551.09, + 601.8, + 551.09, + 592.49, + 552.81, + 589.55, + 548.15, + 554.25, + 530.51, + 572.39, + 511.88, + 586.85, + 509.67, + 587.09, + 508.69, + 593.22, + 508.69, + 596.9, + 509.92, + 599.84, + 509.67, + 601.8, + 506.49, + 602.04, + 502.57, + 598.86, + 499.87, + 594.45, + 496.93, + 584.64, + 492.52, + 581.21, + 489.58, + 576.56, + 489.82, + 571.41, + 491.05, + 570.18, + 498.15, + 569.45, + 509.67, + 565.04, + 525.11, + 547.64, + 532.22, + 546.16, + 531.98, + 541.26, + 537.12, + 538.57, + 530.51, + 510.14, + 526.34, + 513.32, + 522.42, + 489.55, + 521.19, + 477.05, + 517.76, + 485.38, + 515.31, + 489.06, + 514.57, + 493.72, + 512.61, + 495.68, + 511.39, + 498.86, + 509.43, + 506.71, + 508.94, + 514.55, + 505.51, + 515.28, + 501.83, + 514.55, + 498.15, + 510.87, + 497.91, + 507.93 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "bf7e1885326a2aac18619c30d310c21e8fb89e93", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "polygon", + "classId": 72276, + "probability": 100, + "points": [ + 418.36, + 510.31, + 423.02, + 513.25, + 429.15, + 514.48, + 433.07, + 513.25, + 441.65, + 499.04, + 448.76, + 495.36, + 449.74, + 490.7, + 446.55, + 487.52, + 444.83, + 484.33, + 446.06, + 471.59, + 448.27, + 468.89, + 453.66, + 467.18, + 459.29, + 468.16, + 464.69, + 470.61, + 465.42, + 471.59, + 466.16, + 483.6, + 464.69, + 488.25, + 464.69, + 493.4, + 467.87, + 497.57, + 482.58, + 507.37, + 486.5, + 509.33, + 500.96, + 509.09, + 500.22, + 516.93, + 499.24, + 519.13, + 481.11, + 520.61, + 475.47, + 517.42, + 472.28, + 517.17, + 471.55, + 518.4, + 470.08, + 544.62, + 470.81, + 557.12, + 474.49, + 576, + 473.02, + 599.52, + 482.09, + 602.46, + 488.21, + 605.65, + 488.46, + 608.35, + 487.97, + 609.08, + 464.2, + 610.06, + 463.46, + 603.44, + 461.74, + 600.26, + 461.74, + 597.56, + 463.95, + 595.11, + 463.22, + 591.68, + 463.95, + 580.9, + 452.92, + 587.51, + 442.87, + 590.21, + 443.85, + 591.93, + 443.36, + 592.66, + 441.89, + 591.93, + 439.93, + 592.42, + 439.2, + 593.4, + 438.95, + 597.07, + 435.52, + 601.48, + 434.3, + 608.35, + 433.07, + 609.57, + 431.35, + 603.44, + 429.64, + 602.95, + 427.92, + 584.33, + 437.48, + 582.61, + 456.35, + 572.81, + 454.88, + 567.17, + 453.17, + 563.74, + 453.41, + 559.82, + 450.96, + 556.63, + 447.53, + 554.43, + 445.81, + 551.24, + 442.14, + 550.02, + 438.95, + 522.81, + 423.27, + 523.79, + 417.63, + 521.83, + 413.95, + 516.93, + 413.71, + 515.21 + ], + "groupId": 0, + "pointLabels": { + "0": "Left Hand", + "21": "Right Hand" + }, + "locked": false, + "visible": true, + "attributes": [], + "trackingId": "932bda5b59db89dd68602306c70d8da62e0afdc", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + }, + { + "type": "polygon", + "classId": 72276, + "probability": 100, + "points": [ + 380.35, + 435.63, + 378.64, + 439.31, + 395.79, + 464.55, + 396.28, + 478.03, + 394.57, + 481.22, + 407.56, + 499.11, + 408.05, + 501.07, + 410.74, + 502.05, + 410.99, + 504.99, + 415.15, + 507.93, + 415.15, + 509.4, + 410.25, + 513.32, + 407.8, + 517, + 399.22, + 516.75, + 390.4, + 510.87, + 389.18, + 512.34, + 397.51, + 539.06, + 397.75, + 559.89, + 400.2, + 568.47, + 409.76, + 593.96, + 417.12, + 602.78, + 422.51, + 604.25, + 428.63, + 603.76, + 429.61, + 606.21, + 428.63, + 608.42, + 402.65, + 614.3, + 396.53, + 611.85, + 395.79, + 609.4, + 397.51, + 602.04, + 395.55, + 599.35, + 394.57, + 599.35, + 383.29, + 574.84, + 380.6, + 555.97, + 369.32, + 542, + 350.45, + 561.61, + 334.03, + 598.86, + 335.01, + 600.82, + 340.65, + 606.21, + 343.34, + 607.44, + 348.49, + 607.93, + 349.47, + 608.66, + 349.72, + 610.62, + 348.25, + 612.09, + 346.78, + 612.58, + 319.82, + 610.62, + 315.89, + 608.17, + 318.1, + 599.84, + 319.08, + 590.77, + 329.13, + 566.02, + 339.42, + 549.11, + 342.61, + 541.51, + 341.38, + 529.74, + 339.18, + 533.91, + 333.79, + 524.6, + 333.3, + 521.9, + 325.94, + 519.45, + 339.42, + 477.54, + 339.18, + 467.98, + 336.48, + 463.82, + 359.52, + 408.92, + 366.38, + 404.5, + 379.62, + 404.5, + 380.84, + 404.99, + 385.5, + 411.12, + 387.7, + 416.27, + 387.7, + 420.68, + 389.42, + 424.6, + 388.44, + 428.03, + 386.97, + 429.75, + 386.23, + 434.65 + ], + "groupId": 0, + "pointLabels": {}, + "locked": false, + "visible": false, + "attributes": [], + "trackingId": "b4a35bf808984de199195734dfbb73b1cb5c8b5", + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "className": "Human" + } + ], + "tags": [], + "comments": [ + { + "x": 621.41, + "y": 631.6, + "resolved": true, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "correspondence": [ + { + "text": "Bordyuri mi mas@ petqa lini parking class-i mej myus mas@ Terrian class-i", + "email": "hovnatan@superannotate.com" + } + ] + }, + { + "x": 521.41, + "y": 531.6, + "resolved": false, + "createdAt": null, + "createdBy": null, + "creationType": null, + "updatedAt": null, + "updatedBy": null, + "correspondence": [ + { + "text": "dd", + "email": "hovnatan@superannotate.com" + } + ] + } + ] +} diff --git a/tests/integration/test_annotation_delete.py b/tests/integration/test_annotation_delete.py new file mode 100644 index 000000000..cadca3994 --- /dev/null +++ b/tests/integration/test_annotation_delete.py @@ -0,0 +1,61 @@ +import os +import pytest +from os.path import dirname + +import src.superannotate as sa +from tests.integration.base import BaseTestCase + + +class TestAnnotationDelete(BaseTestCase): + PROJECT_NAME_ = "TestAnnotationDelete" + PROJECT_DESCRIPTION = "desc" + PROJECT_TYPE = "Vector" + TEST_FOLDER_PATH = "data_set/sample_project_vector_single_image" + EXAMPLE_IMAGE_1 = "example_image_1.jpg" + EXAMPLE_IMAGE_2 = "example_image_2.jpg" + + @property + def folder_path(self): + return os.path.join(dirname(dirname(__file__)), self.TEST_FOLDER_PATH) + + @property + def classes_json(self): + return os.path.join( + dirname(dirname(__file__)), + "data_set/sample_project_vector/classes/classes.json", + ) + + @pytest.mark.skip( + "waiting for deployment to dev", + ) + def test_delete_annotations(self): + sa.upload_images_from_folder_to_project( + self.PROJECT_NAME, self.folder_path, annotation_status="InProgress" + ) + sa.create_annotation_classes_from_classes_json( + self.PROJECT_NAME, self.folder_path + "/classes/classes.json" + ) + sa.upload_annotations_from_folder_to_project( + self.PROJECT_NAME, f"{self.folder_path}" + ) + + sa.delete_annotations(self.PROJECT_NAME) + data = sa.get_image_annotations(self.PROJECT_NAME, self.EXAMPLE_IMAGE_1) + self.assertIsNone(data["annotation_json"]) + self.assertIsNotNone(data["annotation_json_filename"]) + self.assertIsNone(data["annotation_mask"]) + + @pytest.mark.skip( + "waiting for deployment to dev", + ) + def test_delete_annotations_by_not_exsisting_name(self): + sa.upload_images_from_folder_to_project( + self.PROJECT_NAME, self.folder_path, annotation_status="InProgress" + ) + sa.create_annotation_classes_from_classes_json( + self.PROJECT_NAME, self.folder_path + "/classes/classes.json" + ) + sa.upload_annotations_from_folder_to_project( + self.PROJECT_NAME, f"{self.folder_path}" + ) + self.assertRaises(Exception, sa.delete_annotations, self.PROJECT_NAME, [self.EXAMPLE_IMAGE_2])