From 2260e444c5eac648a348a4e87c638e9008d42cce Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan <84702976+VaghinakDev@users.noreply.github.com> Date: Sun, 13 Nov 2022 20:38:33 +0400 Subject: [PATCH 1/7] Update __init__.py --- src/superannotate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/superannotate/__init__.py b/src/superannotate/__init__.py index e441f04f4..5ed674f65 100644 --- a/src/superannotate/__init__.py +++ b/src/superannotate/__init__.py @@ -2,7 +2,7 @@ import sys -__version__ = "4.4.6b2" +__version__ = "4.4.6" sys.path.append(os.path.split(os.path.realpath(__file__))[0]) From 3cfad5ea254a9c7975474f03eca1a751b1d82a58 Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan <84702976+VaghinakDev@users.noreply.github.com> Date: Thu, 1 Dec 2022 16:28:33 +0400 Subject: [PATCH 2/7] Update __init__.py --- src/superannotate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/superannotate/__init__.py b/src/superannotate/__init__.py index bc3a40b5a..bbd5517a6 100644 --- a/src/superannotate/__init__.py +++ b/src/superannotate/__init__.py @@ -1,7 +1,7 @@ import os import sys -__version__ = "4.4.7dev6" +__version__ = "4.4.7b1" sys.path.append(os.path.split(os.path.realpath(__file__))[0]) From 92f8e9a55d2a88af2287d5e41ae3c8eba94a23ba Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan Date: Thu, 1 Dec 2022 17:06:00 +0400 Subject: [PATCH 3/7] Update filename change logic --- src/superannotate/__init__.py | 2 +- src/superannotate/lib/core/usecases/models.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/superannotate/__init__.py b/src/superannotate/__init__.py index bbd5517a6..73888e75e 100644 --- a/src/superannotate/__init__.py +++ b/src/superannotate/__init__.py @@ -1,7 +1,7 @@ import os import sys -__version__ = "4.4.7b1" +__version__ = "4.4.7b2" sys.path.append(os.path.split(os.path.realpath(__file__))[0]) diff --git a/src/superannotate/lib/core/usecases/models.py b/src/superannotate/lib/core/usecases/models.py index 33b6db449..0ef05d390 100644 --- a/src/superannotate/lib/core/usecases/models.py +++ b/src/superannotate/lib/core/usecases/models.py @@ -2,6 +2,7 @@ import os.path import tempfile import time +import platform import zipfile from pathlib import Path from typing import List @@ -140,7 +141,8 @@ def execute(self): class DownloadExportUseCase(BaseReportableUseCase): - FORBIDDEN_CHARS = "*./\[]:;|,\"\'" + FORBIDDEN_CHARS = "*./\\[]:;|,\"'" + def __init__( self, service_provider: BaseServiceProvider, @@ -206,9 +208,10 @@ def download_to_local_storage(self, destination: str, extract_zip=False): time.sleep(1) self.reporter.stop_spinner() filename = Path(export["path"]).stem - for char in DownloadExportUseCase.FORBIDDEN_CHARS: - filename=filename.replace(char, "_") - filepath = Path(destination) / (filename+'.zip') + if platform.system().lower() == "windows": + for char in DownloadExportUseCase.FORBIDDEN_CHARS: + filename = filename.replace(char, "_") + filepath = Path(destination) / (filename + ".zip") with requests.get(export["download"], stream=True) as response: response.raise_for_status() with open(filepath, "wb") as f: From 2d0f7946e33942d3bee917b0563d916c7738c518 Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan Date: Fri, 2 Dec 2022 13:02:41 +0400 Subject: [PATCH 4/7] Fix list_by_names --- .../lib/infrastructure/services/item.py | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/superannotate/lib/infrastructure/services/item.py b/src/superannotate/lib/infrastructure/services/item.py index 6916a3bdd..55b11cfc5 100644 --- a/src/superannotate/lib/infrastructure/services/item.py +++ b/src/superannotate/lib/infrastructure/services/item.py @@ -46,17 +46,26 @@ def list_by_names( folder: entities.FolderEntity, names: List[str], ): - return self.client.request( - self.URL_LIST_BY_NAMES, - "post", - data={ - "project_id": project.id, - "team_id": project.team_id, - "folder_id": folder.id, - "names": names, - }, - content_type=ItemListResponse, - ) + chunk_size = 200 + items = [] + response = None + for i in range(0, len(names), chunk_size): + response = self.client.request( + self.URL_LIST_BY_NAMES, + "post", + data={ + "project_id": project.id, + "team_id": project.team_id, + "folder_id": folder.id, + "names": names[i : i + chunk_size], # noqa + }, + content_type=ItemListResponse, + ) + if not response.ok: + return response + items.extend(response.data) + response.data = items + return response def attach( self, From 72d3c23bae2574d83f4124183eaaae4003bb1ce2 Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan Date: Fri, 2 Dec 2022 16:57:36 +0400 Subject: [PATCH 5/7] Changed validation in SetAnnotationStatues --- src/superannotate/lib/core/usecases/items.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/superannotate/lib/core/usecases/items.py b/src/superannotate/lib/core/usecases/items.py index c88e5a9ed..4a035a382 100644 --- a/src/superannotate/lib/core/usecases/items.py +++ b/src/superannotate/lib/core/usecases/items.py @@ -658,16 +658,16 @@ def validate_items(self): existing_items = [] for i in range(0, len(self._item_names), self.CHUNK_SIZE): search_names = self._item_names[i : i + self.CHUNK_SIZE] # noqa - cand_items = self._service_provider.items.list_by_names( + response = self._service_provider.items.list_by_names( project=self._project, folder=self._folder, names=search_names, - ).data + ) + if not response.ok: + raise AppValidationException(response.error) - if isinstance(cand_items, dict): - continue + cand_items = response.data existing_items += cand_items - if not existing_items: raise AppValidationException(self.ERROR_MESSAGE) if existing_items: From 233a0b6a74ff887b1776f2768ca39910c005fbb3 Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan <84702976+VaghinakDev@users.noreply.github.com> Date: Fri, 2 Dec 2022 17:12:21 +0400 Subject: [PATCH 6/7] Update __init__.py --- src/superannotate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/superannotate/__init__.py b/src/superannotate/__init__.py index 73888e75e..7f1a61962 100644 --- a/src/superannotate/__init__.py +++ b/src/superannotate/__init__.py @@ -1,7 +1,7 @@ import os import sys -__version__ = "4.4.7b2" +__version__ = "4.4.7b3" sys.path.append(os.path.split(os.path.realpath(__file__))[0]) From 2cb2a296a97d5ba7d09d7343aca6223f4867f66c Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan <84702976+VaghinakDev@users.noreply.github.com> Date: Sun, 4 Dec 2022 11:34:48 +0400 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72901cf20..0809bb829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Changelog All release highlights of this project will be documented in this file. - +## 4.4.7 - December 04, 2022 +### Updated +- `SAClient.search_folders` _method_ to add a new `status` argument for searching folders via status. +- Schemas for `Annotation Classes` and `Video Annotation` to support **text** and **numeric input** attribute group types. +### Fixed +- `SAClient.query` _method_ to address invalid exceptions. +- `SAClient.download_export` _method_ to address the issue with downloading for Windows OS. +- `SAClient.attach_items_from_integrated_storage` _method_ to address "integration not found" error. +- `SAClient.aggregate_annotations_as_df` _method_ to support files without "___objects" in their naming. +### Removed +- `SAClient.add_annotation_bbox_to_image` _method_, use `SAClient.upload_annotations` instead. +- `SAClient.add_annotation_point_to_image` _method_, use `SAClient.upload_annotations` instead. +- `SAClient.add_annotation_comment_to_image` _method_, use `SAClient.upload_annotations` instead. +### ## 4.4.6 - November 23, 2022 ### Updated - `SAClient.aggregate_annotations_as_df` method to aggregate "comment" type instances.