From 5781d67c25f6740304d83b3cbc142071b88fecbf Mon Sep 17 00:00:00 2001 From: John Wilkie Date: Thu, 26 Sep 2024 11:11:18 +0100 Subject: [PATCH] Style improvements --- e2e_tests/cli/test_convert.py | 33 -- e2e_tests/cli/test_import.py | 365 ++++++++---------- e2e_tests/cli/test_pull.py | 22 -- .../image_1.json | 121 ++++++ .../image_2.json | 121 ++++++ .../image_3.json | 121 ++++++ .../image_4.json | 121 ++++++ .../image_5.json | 121 ++++++ .../image_6.json | 121 ++++++ .../image_7.json | 121 ++++++ .../image_8.json | 121 ++++++ .../image_1.json | 236 +++++++++++ .../image_2.json | 216 +++++++++++ .../image_3.json | 328 ++++++++++++++++ .../image_4.json | 244 ++++++++++++ .../image_5.json | 288 ++++++++++++++ .../image_6.json | 280 ++++++++++++++ .../image_7.json | 164 ++++++++ .../image_8.json | 304 +++++++++++++++ .../image_1.json | 0 .../image_2.json | 0 .../image_3.json | 0 .../image_4.json | 0 .../image_5.json | 0 .../image_6.json | 0 .../image_7.json | 0 .../image_8.json | 0 e2e_tests/helpers.py | 24 +- 28 files changed, 3210 insertions(+), 262 deletions(-) delete mode 100644 e2e_tests/cli/test_convert.py delete mode 100644 e2e_tests/cli/test_pull.py create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7.json create mode 100644 e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8.json rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_1.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_2.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_3.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_4.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_5.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_6.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_7.json (100%) rename e2e_tests/data/import/{image_basic_annotations => image_annotations_without_subtypes}/image_8.json (100%) diff --git a/e2e_tests/cli/test_convert.py b/e2e_tests/cli/test_convert.py deleted file mode 100644 index f91be5e0a..000000000 --- a/e2e_tests/cli/test_convert.py +++ /dev/null @@ -1,33 +0,0 @@ -# from pathlib import Path - - -# from e2e_tests.helpers import assert_cli, run_cli_command -# from e2e_tests.objects import E2EDataset - - -# TODO -# def test_convert_to_coco(local_dataset: E2EDataset) -> None: -# """ -# Test converting a pre-defined Darwin JSON 2.0 release to the coco format. -# """ -# convert_dir = Path(__file__).parent / "data" / "convert" / "to_coco" -# result = run_cli_command( -# f"darwin dataset convert {local_dataset.name} coco {convert_dir}" -# ) -# assert_cli(result, 0) -# # Add validation logic here - -# TODO -# def test_convert_to_cvat(local_dataset: E2EDataset) -> None: -# """ -# Test converting a pre-defined Darwin JSON 2.0 release to the cvat format. -# """ -# convert_dir = Path(__file__).parent / "data" / "convert" / "to_cvat" -# result = run_cli_command( -# f"darwin dataset convert {local_dataset.name} cvat {convert_dir}" -# ) -# assert_cli(result, 0) -# # Add validation logic here - - -# Add more tests for other convert scenarios as described in the plan diff --git a/e2e_tests/cli/test_import.py b/e2e_tests/cli/test_import.py index fa3b9c4cf..8a041ef0b 100644 --- a/e2e_tests/cli/test_import.py +++ b/e2e_tests/cli/test_import.py @@ -4,6 +4,7 @@ assert_cli, run_cli_command, export_and_download_annotations, + delete_annotation_uuids, ) from e2e_tests.objects import E2EDataset, ConfigValues from darwin.utils.utils import parse_darwin_json @@ -13,321 +14,279 @@ from typing import List -def validate_downloaded_annotations( - tmp_dir: Path, import_dir: Path, appending: bool = False +def find_matching_actual_annotation( + expected_annotation: dt.Annotation, actual_annotations: List[dt.Annotation] ): """ - Validate that the annotations downloaded from a release match the annotations in - a particular directory, ignoring hidden files. - - If `appending` is set, then the number of actual annotations should exceed the - number of expected annotations + For a given expected annotation, finds the corresponding actual annotation based on + the `data` field & the annotation class type """ - annotations_dir = tmp_dir / "annotations" - with zipfile.ZipFile(tmp_dir / "dataset.zip") as z: - z.extractall(annotations_dir) - expected_annotation_files = { - file.name: str(file) - for file in import_dir.iterdir() - if file.is_file() and not file.name.startswith(".") - } - actual_annotation_files = { - file.name: str(file) - for file in annotations_dir.iterdir() - if file.is_file() and not file.name.startswith(".") - } - for file in expected_annotation_files: - assert file in actual_annotation_files - expected_annotations: List[dt.Annotation] = parse_darwin_json( - Path(expected_annotation_files[file]) - ).annotations # type: ignore - actual_annotations: List[dt.Annotation] = parse_darwin_json( - Path(actual_annotation_files[file]) - ).annotations # type: ignore + expected_annotation_data = expected_annotation.data + expected_annotation_type = expected_annotation.annotation_class.annotation_type + actual_annotation = next( + ( + annotation + for annotation in actual_annotations + if annotation.data == expected_annotation_data + and annotation.annotation_class.annotation_type == expected_annotation_type + ), + None, + ) + assert actual_annotation is not None, "Annotation not found in actual annotations" + return actual_annotation + - # Delete generated UUIDs as these will break asserting equality - for annotation in expected_annotations: - del [annotation.id] # type: ignore - if annotation.annotation_class.annotation_type == "raster_layer": - del [annotation.data["mask_annotation_ids_mapping"]] # type: ignore - for annotation in actual_annotations: - del [annotation.id] # type: ignore - if annotation.annotation_class.annotation_type == "raster_layer": - del [annotation.data["mask_annotation_ids_mapping"]] # type: ignore +def assert_same_annotation_data( + expected_annotation: dt.Annotation, actual_annotation: dt.Annotation +): + """ + Ensures that `expected_annotation.data` is equivalent to `actual_annotation.data` + """ + assert expected_annotation.data == actual_annotation.data - # Check that every expected annotation was imported - if appending: - assert len(actual_annotations) > len(expected_annotations) - else: - assert len(expected_annotations) == len(actual_annotations) - for expected_annotation in expected_annotations: - expected_annotation_data = expected_annotation.data - expected_annotation_type = ( - expected_annotation.annotation_class.annotation_type - ) - actual_annotation = next( - ( - annotation - for annotation in actual_annotations - if annotation.data == expected_annotation_data - and annotation.annotation_class.annotation_type - == expected_annotation_type - ), - None, - ) - assert ( - actual_annotation is not None - ), "Annotation not found in actual annotations" +def assert_same_annotation_properties( + expected_annotation: dt.Annotation, actual_annotation: dt.Annotation +): + """ + Ensures that `expected_annotation.properties` is equivalent to `actual_annotation.properties` + """ + if expected_annotation.properties: + expected_properties = expected_annotation.properties + actual_properties = actual_annotation.properties + assert actual_properties is not None + for expected_property in expected_properties: + assert expected_property in actual_properties # type : ignore - # Properties must be compared separately because the order of properties - # is a list with variable order. Differences in order will cause assertion failure - if expected_annotation.properties: - assert actual_annotation.properties is not None - expected_properties = expected_annotation.properties - del expected_annotation.properties - actual_properties = actual_annotation.properties - del actual_annotation.properties - for expected_property in expected_properties: - assert expected_property in actual_properties - assert expected_annotation == actual_annotation +def compare_annotations_export( + actual_annotations_dir: Path, + expected_annotations_dir: Path, +): + """ + Compares a set of downloaded annotation files with the imported files that resulted + in those annotations. Ensures equality + """ -def test_import_basic_annotations_to_images( + with zipfile.ZipFile(actual_annotations_dir / "dataset.zip") as z: + z.extractall(actual_annotations_dir) + + expected_annotation_files = { + file.name: str(file) + for file in expected_annotations_dir.iterdir() + if file.is_file() and not file.name.startswith(".") + } + actual_annotation_files = { + file.name: str(file) + for file in actual_annotations_dir.iterdir() + if file.is_file() and not file.name.startswith(".") + } + for file in expected_annotation_files: + assert file in actual_annotation_files + expected_annotations: List[dt.Annotation] = parse_darwin_json( + Path(expected_annotation_files[file]) + ).annotations # type: ignore + actual_annotations: List[dt.Annotation] = parse_darwin_json( + Path(actual_annotation_files[file]) + ).annotations # type: ignore + + assert len(expected_annotations) == len(actual_annotations) + + delete_annotation_uuids(expected_annotations) + delete_annotation_uuids(actual_annotations) + + for expected_annotation in expected_annotations: + actual_annotation = find_matching_actual_annotation( + expected_annotation, actual_annotations + ) + assert_same_annotation_data(actual_annotation, expected_annotation) + assert_same_annotation_properties(expected_annotation, actual_annotation) + + +def test_import_annotations_without_subtypes_to_images( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test importing a set of basic annotations (no sub-types or properties) to a set of pre-registered files in a dataset. + Test importing a set of basic annotations (no sub-types or properties) to a set of + pre-registered files in a dataset. """ local_dataset.register_read_only_items(config_values) - import_dir = ( - Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" ) result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir}" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" ) assert_cli(result, 0) with tempfile.TemporaryDirectory() as tmp_dir_str: - tmp_dir = Path(tmp_dir_str) - export_and_download_annotations(tmp_dir, local_dataset, config_values) - validate_downloaded_annotations(tmp_dir, import_dir) + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) def test_import_annotations_with_subtypes_to_images( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test importing a set of basic annotations includes subtypes & properties to a set of pre-registered files in a dataset. + Test importing a set of annotations that includes subtypes & properties to a set of + pre-registered files in a dataset. """ local_dataset.register_read_only_items(config_values) - import_dir = ( + expected_annotations_dir = ( Path(__file__).parents[1] / "data" / "import" / "image_annotations_with_subtypes" ) result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir}" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" ) assert_cli(result, 0) with tempfile.TemporaryDirectory() as tmp_dir_str: - tmp_dir = Path(tmp_dir_str) - export_and_download_annotations(tmp_dir, local_dataset, config_values) - validate_downloaded_annotations(tmp_dir, import_dir) - - -# TODO, implement video annotation import tests: -# test_import_basic_annotations_to_videos -# test_import_annotations_with_subtypes_to_videos + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) def test_annotation_classes_are_created_on_import( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test that importing non-existent annotation classes creates those classes in the target Darwin team + Test that importing non-existent annotation classes creates those classes in the + target Darwin team """ local_dataset.register_read_only_items(config_values) - import_dir = ( - Path(__file__).parents[1] / "data" / "import" / "image_new_basic_annotations" + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" ) result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir} --yes" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --yes" ) assert_cli(result, 0) with tempfile.TemporaryDirectory() as tmp_dir_str: - tmp_dir = Path(tmp_dir_str) - export_and_download_annotations(tmp_dir, local_dataset, config_values) - validate_downloaded_annotations(tmp_dir, import_dir) + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) def test_annotation_classes_are_created_with_properties_on_import( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test that importing non-existent annotation classes with properties creates those classes and properties in the target Darwin team + Test that importing non-existent annotation classes with properties creates those + classes and properties in the target Darwin team """ local_dataset.register_read_only_items(config_values) - import_dir = ( + expected_annotations_dir = ( Path(__file__).parents[1] / "data" / "import" / "image_new_annotations_with_properties" ) result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir} --yes" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --yes" ) assert_cli(result, 0) with tempfile.TemporaryDirectory() as tmp_dir_str: - tmp_dir = Path(tmp_dir_str) - export_and_download_annotations(tmp_dir, local_dataset, config_values) - validate_downloaded_annotations(tmp_dir, import_dir) + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) def test_appending_annotations( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test that appending annotations to an item with already existing annotations does not overwrite the original annotations + Test that appending annotations to an item with already existing annotations does + not overwrite the original annotations """ local_dataset.register_read_only_items(config_values) - import_dir = ( - Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_split_in_two_files" ) - # 1st import to create annotations result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir}" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" ) assert_cli(result, 0) - # 2nd import to append more annotations - result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir} --append" - ) assert_cli(result, 0) with tempfile.TemporaryDirectory() as tmp_dir_str: - tmp_dir = Path(tmp_dir_str) - export_and_download_annotations(tmp_dir, local_dataset, config_values) - validate_downloaded_annotations(tmp_dir, import_dir, appending=True) + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) def test_overwriting_annotations( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test that the `--overwrite` flag allows bypassing of the overwrite warning when importing to items with already existing annotations + Test that the `--overwrite` flag allows bypassing of the overwrite warning when + importing to items with already existing annotations """ local_dataset.register_read_only_items(config_values) - import_dir = ( - Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" ) # 1st import to create annotations result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir}" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" ) assert_cli(result, 0) # 2nd import to overwrite annotations result = run_cli_command( - f" darwin dataset import {local_dataset.name} darwin {import_dir} --overwrite" + f" darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --overwrite" ) assert_cli(result, 0) with tempfile.TemporaryDirectory() as tmp_dir_str: - tmp_dir = Path(tmp_dir_str) - export_and_download_annotations(tmp_dir, local_dataset, config_values) - validate_downloaded_annotations(tmp_dir, import_dir) + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) def test_annotation_overwrite_warning( local_dataset: E2EDataset, config_values: ConfigValues ) -> None: """ - Test that importing annotations to an item with already existing annotations throws a warning if not using the `--append` or `--overwrite` flags + Test that importing annotations to an item with already existing annotations throws + a warning if not using the `--append` or `--overwrite` flags """ local_dataset.register_read_only_items(config_values) - import_dir = ( - Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" ) # 1st import to create annotations result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir}" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" ) assert_cli(result, 0) # 2nd import to trigger overwrite warning result = run_cli_command( - f"darwin dataset import {local_dataset.name} darwin {import_dir}" + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" ) assert "will be overwritten" in result.stdout - - -# TODO -# def test_importing_coco_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# assert 1 == 2 -# """ -# Test that the coco annotation importer is working -# """ - - -# TODO -# def test_importing_csv_tags_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# assert 1 == 2 -# """ -# Test that the csv_tags annotation importer is working -# """ - - -# TODO: -# def test_importing_csv_tags_video_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# assert 1 == 2 -# """ -# Test that the csv_tags_video annotation importer is working -# """ - - -# TODO: -# def test_importing_dataloop_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# """ -# Test that the dataloop annotation importer is working -# """ - - -# TODO: -# def test_importing_labelbox_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# """ -# Test that the labelbox annotation importer is working -# """ - -# TODO -# This one is a bit more involved: We can only import NifTI annotations to certain filetypes, so how should we deal with this? -# def test_importing_nifti_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# """ -# Test that the nifti annotation importer is working -# """ - - -# TODO -# def test_importing_pascal_voc_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# """ -# Test that the pascal_voc annotation importer is working -# """ - - -# TODO -# def test_importing_superannotate_annotations( -# local_dataset: E2EDataset, config_values: ConfigValues -# ) -> None: -# """ -# Test that the superannotate annotation importer is working -# """ diff --git a/e2e_tests/cli/test_pull.py b/e2e_tests/cli/test_pull.py deleted file mode 100644 index 7c109f411..000000000 --- a/e2e_tests/cli/test_pull.py +++ /dev/null @@ -1,22 +0,0 @@ -# from e2e_tests.helpers import assert_cli, run_cli_command -# from e2e_tests.objects import E2EDataset - - -# def test_pull_data(local_dataset: E2EDataset) -> None: -# """ -# Test pulling a dataset release with default arguments. -# """ -# result = run_cli_command(f"darwin dataset pull {local_dataset.name}") -# assert_cli(result, 0) -# # Add validation logic here - - -# def test_pull_data_flat_structure(local_dataset: E2EDataset) -> None: -# """ -# Test pulling a dataset release with use_folders set to False. -# """ -# result = run_cli_command( -# f"darwin dataset pull {local_dataset.name} --use-folders False" -# ) -# assert_cli(result, 0) -# # Add validation logic here diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1.json new file mode 100644 index 000000000..42210df98 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_1", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-a549-6aa9-ae9f61c95747", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-a549-6aa9-ae9f61c95747" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/469c8a89-0557-42ea-a3a1-04f90d9f6b88/thumbnail", + "source_files": [ + { + "file_name": "image_1", + "storage_key": "darwin-py/images/image_1.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/144dc80d-6bec-4885-b5cb-a174f18000e2" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "5976dca9-ead0-4264-8ece-b6833c77dc4b", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2f75f5e6-1495-4fb1-b869-01882710d6ed", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "caac6cd7-698a-4821-8141-2f5a78a3022a", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "57d49f01-a072-4fcd-80cb-b14515fd50c7", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2.json new file mode 100644 index 000000000..1c75907d6 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_2", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-f0b7-9d92-ecc504bba55e", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-f0b7-9d92-ecc504bba55e" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/7ac2488d-df4e-42b1-bde2-86cbe22d526c/thumbnail", + "source_files": [ + { + "file_name": "image_2", + "storage_key": "darwin-py/images/image_2.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/3138e283-a72f-4232-be35-0826fcf2ab01" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "109f053c-e2fc-444a-b44f-acfdd8e59567", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "c9445045-0609-4240-9d1b-9079736490a0", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4efbed69-35d6-495e-ba2e-0537f8d257ee", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "3d9a8dc5-e3db-4572-9141-d3d99a713789", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3.json new file mode 100644 index 000000000..da4fe6aed --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_3", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-8c77-0a6f-6c06085e0352", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-8c77-0a6f-6c06085e0352" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/a8205e6b-e940-4bb1-b29d-846e78a89086/thumbnail", + "source_files": [ + { + "file_name": "image_3", + "storage_key": "darwin-py/images/image_3.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/07d711e4-cb84-4848-a188-9b9330ea1038" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "9bb6ac07-d7d4-4b6d-9fec-b3dc0e7f1f2a", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "c0e9781e-1474-45e3-88f3-137c3e00de24", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4bcfc9f4-e181-4558-b2e5-e46034646599", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "011dc8a9-2017-4959-8347-15cd4756f914", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4.json new file mode 100644 index 000000000..7d5f589b2 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_4", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-299c-e0c2-cb73dccf6d4f", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-299c-e0c2-cb73dccf6d4f" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/8f48ba52-eee7-457b-829c-01f4af25f20f/thumbnail", + "source_files": [ + { + "file_name": "image_4", + "storage_key": "darwin-py/images/image_4.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/d127dc20-a63f-492a-912a-f7d875c65251" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "03f7c08e-f80b-409e-a150-f8aa31bb7778", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "38426629-668e-4414-9b18-cd9df589ab82", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4d40d102-ba16-4e2a-bf3b-0ca1b6dede5b", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "3415fb30-7350-4298-8dbe-98ce3d7cccc9", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5.json new file mode 100644 index 000000000..568a33245 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_5", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-c805-c2f1-3368dcbaf9ca", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-c805-c2f1-3368dcbaf9ca" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/196805d6-f0da-447b-8b7b-153d20f2eeff/thumbnail", + "source_files": [ + { + "file_name": "image_5", + "storage_key": "darwin-py/images/image_5.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/6c852f65-79cb-413e-82be-6eefc01c783e" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "11380405-52f0-4162-9560-f030c84c260e", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "0a4317cb-1380-482f-bfd5-c0dea24eea3e", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "7aa8e3f3-8ff0-49e6-a3cf-9609d7921e0a", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "0c56ff38-9da5-49e9-83d2-9e94fc0c2ba7", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6.json new file mode 100644 index 000000000..9b6faaac8 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_6", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-075e-209f-c3f64d2bf0a8", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-075e-209f-c3f64d2bf0a8" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/e677b814-e6c4-4bf7-a5aa-e9883b612392/thumbnail", + "source_files": [ + { + "file_name": "image_6", + "storage_key": "darwin-py/images/image_6.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/77191998-6632-42f8-abe9-75df8304decb" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "d7eab132-5985-4975-8062-123f7cd2f673", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "204b7afe-657d-4876-b31d-d1deab0a603c", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4f5b5ce6-617d-46d4-9f88-6759b4f06ea8", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "eface510-b298-4d55-951c-2497b3032e2c", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7.json new file mode 100644 index 000000000..2f3814db7 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_7", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-98a3-3ee8-03efea8cff21", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-98a3-3ee8-03efea8cff21" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/39540d73-2de8-4bc8-8690-c1176f6de2e2/thumbnail", + "source_files": [ + { + "file_name": "image_7", + "storage_key": "darwin-py/images/image_7.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/1516bad4-ccd7-40fa-abbc-15a82c851f1f" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "2e4c2d4e-6df6-4a61-a73a-fa28285824d2", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "95843306-4945-4dfa-9fee-cd1134890836", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "bd60d76d-2e84-4a55-b3b3-d5e7756307e5", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "befbdb22-162c-4ac0-aba7-1fdb57e1d32e", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8.json new file mode 100644 index 000000000..175420028 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_8", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-3e01-10b9-73f2d06e2ae4", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-3e01-10b9-73f2d06e2ae4" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/52dcfc17-e1ec-45e8-af3a-924ae9764267/thumbnail", + "source_files": [ + { + "file_name": "image_8", + "storage_key": "darwin-py/images/image_8.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/45f8df38-3022-486f-88da-fa3da2c018e0" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "518596bb-bd5b-4db6-a029-5b2df0aa1fe2", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "b9497ec8-235d-43a4-86f7-286a5f9c38d8", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "ea70d102-57e5-406c-a29d-c324eb0b5fb6", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "17bd44c0-22df-4dd0-a9b2-c8da582e4d1b", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1.json new file mode 100644 index 000000000..ede4b571d --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1.json @@ -0,0 +1,236 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_1", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-a549-6aa9-ae9f61c95747", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-a549-6aa9-ae9f61c95747" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/469c8a89-0557-42ea-a3a1-04f90d9f6b88/thumbnail", + "source_files": [ + { + "file_name": "image_1", + "storage_key": "darwin-py/images/image_1.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/144dc80d-6bec-4885-b5cb-a174f18000e2" + } + ] + } + ] + }, + "annotations": [ + { + "id": "0e222acf-f31e-4391-a88d-19ba5006d76f", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "479a7c0e-c2b2-4ed2-865c-055c78d0ba55", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "8e1bee84-a3a7-43f5-9319-7bc142c3f154", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "01956301-606f-4785-a166-f63ce2721960", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "b5eaaef7-1136-4bc8-9875-5c728f1d7187", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 286374, + 1, + 5, + 0, + 1913, + 1, + 9, + 0, + 1911, + 1, + 9, + 0, + 1910, + 1, + 11, + 0, + 1908, + 1, + 12, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 14, + 0, + 1905, + 1, + 14, + 0, + 1904, + 1, + 16, + 0, + 1902, + 1, + 18, + 0, + 1901, + 1, + 20, + 0, + 1899, + 1, + 21, + 0, + 1899, + 1, + 21, + 0, + 1898, + 1, + 22, + 0, + 1896, + 1, + 23, + 0, + 1895, + 1, + 25, + 0, + 1893, + 1, + 25, + 0, + 1895, + 1, + 23, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 23, + 0, + 1897, + 1, + 23, + 0, + 1897, + 1, + 14, + 0, + 3, + 1, + 4, + 0, + 1899, + 1, + 14, + 0, + 1906, + 1, + 12, + 0, + 1909, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1914, + 1, + 4, + 0, + 1737320 + ], + "mask_annotation_ids_mapping": { + "8e1bee84-a3a7-43f5-9319-7bc142c3f154": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2.json new file mode 100644 index 000000000..04513a49c --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2.json @@ -0,0 +1,216 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_2", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-f0b7-9d92-ecc504bba55e", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-f0b7-9d92-ecc504bba55e" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/7ac2488d-df4e-42b1-bde2-86cbe22d526c/thumbnail", + "source_files": [ + { + "file_name": "image_2", + "storage_key": "darwin-py/images/image_2.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/3138e283-a72f-4232-be35-0826fcf2ab01" + } + ] + } + ] + }, + "annotations": [ + { + "id": "c6b5d839-6fcc-4415-8191-a6a4a702af66", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "7cf4be26-60a3-466f-8a1f-7029a341b506", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "b479c29b-dbe1-4a86-bd18-ed7011f1cc0a", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "271d85a9-2c7f-436a-b33c-6698a830a518", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "5f67127e-aa76-4550-b1fc-0cf6b6049ca0", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 278739, + 1, + 7, + 0, + 1911, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1908, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 16, + 0, + 1898, + 1, + 25, + 0, + 1893, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1890, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1890, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 26, + 0, + 1895, + 1, + 19, + 0, + 1902, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 14, + 0, + 1908, + 1, + 10, + 0, + 1912, + 1, + 4, + 0, + 1752619 + ], + "mask_annotation_ids_mapping": { + "b479c29b-dbe1-4a86-bd18-ed7011f1cc0a": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3.json new file mode 100644 index 000000000..b939b36a3 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3.json @@ -0,0 +1,328 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_3", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-8c77-0a6f-6c06085e0352", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-8c77-0a6f-6c06085e0352" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/a8205e6b-e940-4bb1-b29d-846e78a89086/thumbnail", + "source_files": [ + { + "file_name": "image_3", + "storage_key": "darwin-py/images/image_3.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/07d711e4-cb84-4848-a188-9b9330ea1038" + } + ] + } + ] + }, + "annotations": [ + { + "id": "9df469c0-4bc4-41bc-9c7d-3ec38f1cbcdd", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "a6caf48a-0279-4772-afba-6ab2c9a55f35", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "c5fb2e1b-34e8-4354-b5ae-9f76806b89c0", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "a300c6d4-3aa9-4356-b65c-a6177c223276", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "e9a438b5-446f-4ba5-bfa4-5c3db337891b", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 301775, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 11, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 11, + 0, + 10, + 1, + 4, + 0, + 1895, + 1, + 13, + 0, + 6, + 1, + 8, + 0, + 1893, + 1, + 13, + 0, + 1, + 1, + 4, + 0, + 1, + 1, + 8, + 0, + 1894, + 1, + 29, + 0, + 1892, + 1, + 30, + 0, + 1890, + 1, + 30, + 0, + 1891, + 1, + 30, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 30, + 0, + 1891, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1890, + 1, + 31, + 0, + 1890, + 1, + 30, + 0, + 1890, + 1, + 30, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1894, + 1, + 26, + 0, + 1897, + 1, + 23, + 0, + 1899, + 1, + 21, + 0, + 1902, + 1, + 17, + 0, + 1905, + 1, + 15, + 0, + 1908, + 1, + 10, + 0, + 1683471 + ], + "mask_annotation_ids_mapping": { + "c5fb2e1b-34e8-4354-b5ae-9f76806b89c0": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4.json new file mode 100644 index 000000000..b1e21ca65 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4.json @@ -0,0 +1,244 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_4", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-299c-e0c2-cb73dccf6d4f", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-299c-e0c2-cb73dccf6d4f" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/8f48ba52-eee7-457b-829c-01f4af25f20f/thumbnail", + "source_files": [ + { + "file_name": "image_4", + "storage_key": "darwin-py/images/image_4.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/d127dc20-a63f-492a-912a-f7d875c65251" + } + ] + } + ] + }, + "annotations": [ + { + "id": "efcd8a54-8986-4ed9-af45-2f63b7a26fbc", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "86d6aae0-cb45-472b-bf2e-624a3cf1fdb8", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "d1b06da1-8b6a-4ec3-9f6f-85d21277fef5", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "3b5f8a89-4be8-46ff-93bf-ea38562b1939", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "b2f3e27a-7802-49a9-9395-60535fedce86", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 345916, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1908, + 1, + 14, + 0, + 1906, + 1, + 16, + 0, + 1904, + 1, + 16, + 0, + 1904, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1903, + 1, + 18, + 0, + 1902, + 1, + 18, + 0, + 1902, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 18, + 0, + 1902, + 1, + 18, + 0, + 1903, + 1, + 8, + 0, + 3, + 1, + 4, + 0, + 1905, + 1, + 8, + 0, + 1914, + 1, + 4, + 0, + 1673922 + ], + "mask_annotation_ids_mapping": { + "d1b06da1-8b6a-4ec3-9f6f-85d21277fef5": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5.json new file mode 100644 index 000000000..d612dbf98 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5.json @@ -0,0 +1,288 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_5", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-c805-c2f1-3368dcbaf9ca", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-c805-c2f1-3368dcbaf9ca" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/196805d6-f0da-447b-8b7b-153d20f2eeff/thumbnail", + "source_files": [ + { + "file_name": "image_5", + "storage_key": "darwin-py/images/image_5.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/6c852f65-79cb-413e-82be-6eefc01c783e" + } + ] + } + ] + }, + "annotations": [ + { + "id": "1faf78c9-c917-4bea-9734-7f5b81bff160", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "9080db8e-08c0-4191-abd6-fab5c26407f8", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "6f315c87-559a-4f03-998b-ef9ad430af42", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4b7263f6-fe54-45a9-806f-efde911dd969", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "3562dbd6-46b5-4ee9-aa4d-b804c956f321", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 322890, + 1, + 6, + 0, + 1912, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1909, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1907, + 1, + 12, + 0, + 1908, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 16, + 0, + 1904, + 1, + 18, + 0, + 1902, + 1, + 18, + 0, + 1901, + 1, + 21, + 0, + 1899, + 1, + 23, + 0, + 1897, + 1, + 23, + 0, + 1897, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 23, + 0, + 1897, + 1, + 23, + 0, + 1897, + 1, + 21, + 0, + 1899, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1904, + 1, + 15, + 0, + 1905, + 1, + 15, + 0, + 1905, + 1, + 14, + 0, + 1907, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1673906 + ], + "mask_annotation_ids_mapping": { + "6f315c87-559a-4f03-998b-ef9ad430af42": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6.json new file mode 100644 index 000000000..7105d3f08 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6.json @@ -0,0 +1,280 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_6", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-075e-209f-c3f64d2bf0a8", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-075e-209f-c3f64d2bf0a8" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/e677b814-e6c4-4bf7-a5aa-e9883b612392/thumbnail", + "source_files": [ + { + "file_name": "image_6", + "storage_key": "darwin-py/images/image_6.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/77191998-6632-42f8-abe9-75df8304decb" + } + ] + } + ] + }, + "annotations": [ + { + "id": "ca07dc1a-f57e-4005-8f1b-799dd0070588", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "1f02444f-6848-44fa-a5f9-3bb0a910fea7", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "25d75ea3-3748-4ce4-8f09-6419e39aac05", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "866a3fe4-3353-40f2-9e80-64cb999b6187", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "50d4529c-5502-4f97-ad75-ba6c23cd3e1f", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 290243, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1909, + 1, + 11, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 15, + 0, + 1905, + 1, + 15, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1907, + 1, + 13, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1910, + 1, + 9, + 0, + 1912, + 1, + 8, + 0, + 1914, + 1, + 4, + 0, + 1710390 + ], + "mask_annotation_ids_mapping": { + "25d75ea3-3748-4ce4-8f09-6419e39aac05": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7.json new file mode 100644 index 000000000..3f3dacc62 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7.json @@ -0,0 +1,164 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_7", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-98a3-3ee8-03efea8cff21", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-98a3-3ee8-03efea8cff21" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/39540d73-2de8-4bc8-8690-c1176f6de2e2/thumbnail", + "source_files": [ + { + "file_name": "image_7", + "storage_key": "darwin-py/images/image_7.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/1516bad4-ccd7-40fa-abbc-15a82c851f1f" + } + ] + } + ] + }, + "annotations": [ + { + "id": "717b4fc6-eee2-430b-936b-61283c420f63", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "58686ca4-0b55-4333-95da-7f37c1b7c5e7", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "27063070-8cda-4f15-9ffb-763b9b10f628", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "51e4b516-3d38-46fc-8a66-3fca9a875e28", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "50175796-8371-44b3-a338-5d42f96df519", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 253651, + 1, + 5, + 0, + 1913, + 1, + 9, + 0, + 1911, + 1, + 9, + 0, + 1910, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1910, + 1, + 9, + 0, + 1911, + 1, + 9, + 0, + 1913, + 1, + 5, + 0, + 1802664 + ], + "mask_annotation_ids_mapping": { + "27063070-8cda-4f15-9ffb-763b9b10f628": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8.json new file mode 100644 index 000000000..053b5b58c --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8.json @@ -0,0 +1,304 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_8", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-3e01-10b9-73f2d06e2ae4", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-3e01-10b9-73f2d06e2ae4" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/52dcfc17-e1ec-45e8-af3a-924ae9764267/thumbnail", + "source_files": [ + { + "file_name": "image_8", + "storage_key": "darwin-py/images/image_8.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/45f8df38-3022-486f-88da-fa3da2c018e0" + } + ] + } + ] + }, + "annotations": [ + { + "id": "1cf95a4b-8437-47a5-8417-04ee06c83d37", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "52a18471-fe46-46c9-93d9-2894380333f2", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "6b23caf3-7ea6-4ea9-aea9-e57654489845", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "73396ad0-3ac6-4aef-a90a-94ca857ad6af", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "5eb8b1f3-ae55-43c4-a2d7-a7b510020d14", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 345921, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1909, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1912, + 1, + 6, + 0, + 1643193 + ], + "mask_annotation_ids_mapping": { + "6b23caf3-7ea6-4ea9-aea9-e57654489845": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_basic_annotations/image_1.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_1.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_1.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_1.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_2.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_2.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_2.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_2.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_3.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_3.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_3.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_3.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_4.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_4.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_4.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_4.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_5.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_5.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_5.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_5.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_6.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_6.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_6.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_6.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_7.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_7.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_7.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_7.json diff --git a/e2e_tests/data/import/image_basic_annotations/image_8.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_8.json similarity index 100% rename from e2e_tests/data/import/image_basic_annotations/image_8.json rename to e2e_tests/data/import/image_annotations_without_subtypes/image_8.json diff --git a/e2e_tests/helpers.py b/e2e_tests/helpers.py index c0ea22369..4e2cf7432 100644 --- a/e2e_tests/helpers.py +++ b/e2e_tests/helpers.py @@ -1,6 +1,6 @@ from subprocess import run from time import sleep -from typing import Optional +from typing import Optional, List from attr import dataclass from pathlib import Path @@ -14,6 +14,7 @@ import time from e2e_tests.objects import E2EDataset, ConfigValues from darwin.dataset.release import Release, ReleaseStatus +import darwin.datatypes as dt @dataclass @@ -193,11 +194,14 @@ def wait_until_items_processed( def export_and_download_annotations( - tmp_dir: Path, local_dataset: E2EDataset, config_values: ConfigValues + actual_annotations_dir: Path, + local_dataset: E2EDataset, + config_values: ConfigValues, ) -> None: """ Creates an export of all items in the given dataset. - Waits for the export to finish, then downloads and the annotation files to `tmp_dir` + Waits for the export to finish, then downloads and the annotation files to + `actual_annotations_dir` """ dataset_slug = local_dataset.slug team_slug = config_values.team_slug @@ -251,4 +255,16 @@ def export_and_download_annotations( latest=export_data["latest"], format=export_data.get("format", "json"), ) - release.download_zip(tmp_dir / "dataset.zip") + release.download_zip(actual_annotations_dir / "dataset.zip") + + +def delete_annotation_uuids(annotations: List[dt.Annotation]): + """ + Removes all UUIDs in the `data` field of an `Annotation` object. + + This allows for equality to be asserted with other annotations. + """ + for annotation in annotations: + del annotation.id + if annotation.annotation_class.annotation_type == "raster_layer": + del annotation.data["mask_annotation_ids_mapping"]