diff --git a/docs/source/superannotate.sdk.rst b/docs/source/superannotate.sdk.rst index 22e9021ec..1f356fe78 100644 --- a/docs/source/superannotate.sdk.rst +++ b/docs/source/superannotate.sdk.rst @@ -126,6 +126,7 @@ _________________ .. autofunction:: superannotate.get_team_metadata .. autofunction:: superannotate.invite_contributor_to_team .. autofunction:: superannotate.delete_contributor_to_team_invitation +.. autofunction:: superannotate.search_team_contributors ---------- diff --git a/pytest.ini b/pytest.ini index 022233bc3..46c020215 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,4 +2,4 @@ minversion = 3.0 log_cli=true python_files = test_*.py -addopts = -n32 --dist=loadscope \ No newline at end of file +;addopts = -n32 --dist=loadscope \ No newline at end of file diff --git a/src/superannotate/lib/core/usecases.py b/src/superannotate/lib/core/usecases.py index 0b9e19965..ea25e50a0 100644 --- a/src/superannotate/lib/core/usecases.py +++ b/src/superannotate/lib/core/usecases.py @@ -2238,7 +2238,7 @@ def execute(self): with open(mask_path, "wb") as f: f.write(data["annotation_mask"].getbuffer()) else: - logger.info(f"There is no blue-map for the image.") + logger.info("There is no blue-map for the image.") json_path = Path(self._destination) / data["annotation_json_filename"] with open(json_path, "w") as f: diff --git a/src/superannotate/lib/infrastructure/repositories.py b/src/superannotate/lib/infrastructure/repositories.py index 80baf9314..874d1b987 100644 --- a/src/superannotate/lib/infrastructure/repositories.py +++ b/src/superannotate/lib/infrastructure/repositories.py @@ -431,7 +431,7 @@ def get_one(self, uuid: int) -> MLModelEntity: raise NotImplementedError def get_all(self, condition: Optional[Condition] = None) -> List[MLModelEntity]: - models = self._service.search_models(condition.build_query())["data"] + models = self._service.search_models(condition.build_query()) return [self.dict2entity(model) for model in models] def insert(self, entity: MLModelEntity) -> MLModelEntity: diff --git a/src/superannotate/lib/infrastructure/services.py b/src/superannotate/lib/infrastructure/services.py index 1428b45af..d3f1dfaa8 100644 --- a/src/superannotate/lib/infrastructure/services.py +++ b/src/superannotate/lib/infrastructure/services.py @@ -307,10 +307,7 @@ def get_folders(self, query_string: str = None, params: dict = None): get_folder_url = urljoin(self.api_url, self.URL_FOLDERS_IMAGES) if query_string: get_folder_url = f"{get_folder_url}?{query_string}" - response = self._get_all_pages( - get_folder_url, params=params, key_field="folders" - ) - return response + return self._get_all_pages(get_folder_url, params=params, key_field="folders") def delete_folders(self, project_id: int, team_id: int, folder_ids: List[int]): delete_folders_url = urljoin(self.api_url, self.URL_DELETE_FOLDERS) @@ -884,8 +881,8 @@ def search_models(self, query_string: str): search_model_url = urljoin(self.api_url, self.URL_MODELS) if query_string: search_model_url = f"{search_model_url}?{query_string}" - response = self._request(search_model_url, "get",) - return response.json() + # response = self._request(search_model_url, "get",) + return self._get_all_pages(search_model_url) def bulk_get_folders(self, team_id: int, project_ids: List[int]): get_folders_url = urljoin(self.api_url, self.URL_BULK_GET_FOLDERS) diff --git a/tests/data_set/sample_project_vector/example_image_1.jpg___fuse.png b/tests/data_set/sample_project_vector/example_image_1.jpg___fuse.png index c37596918..0d9661854 100644 Binary files a/tests/data_set/sample_project_vector/example_image_1.jpg___fuse.png and b/tests/data_set/sample_project_vector/example_image_1.jpg___fuse.png differ diff --git a/tests/integration/test_basic_images.py b/tests/integration/test_basic_images.py index e52424b40..d120291a8 100644 --- a/tests/integration/test_basic_images.py +++ b/tests/integration/test_basic_images.py @@ -28,15 +28,15 @@ def test_basic_images(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.classes_json_path + ) + sa.upload_image_annotations( project=self.PROJECT_NAME, image_name=self.EXAMPLE_IMAGE_1, annotation_json=f"{self.folder_path}/{self.EXAMPLE_IMAGE_1}___pixel.json", ) - sa.create_annotation_classes_from_classes_json( - self.PROJECT_NAME, self.classes_json_path - ) - downloaded = sa.download_image( project=self.PROJECT_NAME, image_name=self.EXAMPLE_IMAGE_1,