diff --git a/e2e_tests/cli/test_convert.py b/e2e_tests/cli/test_convert.py new file mode 100644 index 000000000..f91be5e0a --- /dev/null +++ b/e2e_tests/cli/test_convert.py @@ -0,0 +1,33 @@ +# 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 new file mode 100644 index 000000000..0417be9aa --- /dev/null +++ b/e2e_tests/cli/test_import.py @@ -0,0 +1,397 @@ +from pathlib import Path + +from e2e_tests.helpers import ( + assert_cli, + run_cli_command, + normalize_expected_annotation, + normalize_actual_annotation, +) +from e2e_tests.objects import E2EDataset, ConfigValues +from typing import List, Dict +import json + + +def validate_annotations( + expected_item_names: List[str], + annotations: Dict[str, List], + import_dir: Path, + properties: Dict[str, List], + number_of_annotations: int, +): + """ + Compare the state of imported annotations against the files that were imported + """ + for item in expected_item_names: + item_annotations = annotations[item] + assert len(item_annotations) == number_of_annotations + with open(import_dir / Path(f"{item}.json"), "r") as file: + expected_item_annotations = json.load(file)["annotations"] + + # Normalize annotations for comparison + normalized_expected_annotations = [ + normalize_expected_annotation(annotation) + for annotation in expected_item_annotations + ] + normalized_actual_annotations = [ + normalize_actual_annotation(annotation, properties) for annotation in item_annotations # type: ignore + ] + + # Check if every expected annotation is in the actual annotations + for expected_annotation in normalized_expected_annotations: + assert ( + expected_annotation in normalized_actual_annotations + ), f"Expected annotation {expected_annotation} not found in actual annotations" + + +def validate_annotation_classes( + annotation_classes: Dict[str, List], expected_annotation_class_names: List[str] +): + """ + Compares the state of a team's annotation classes against an expected set of annotation class names + """ + annotation_class_names = [ + annotation_class["name"] + for annotation_class in annotation_classes["annotation_classes"] + ] + for expected_class_name in expected_annotation_class_names: + assert ( + expected_class_name in annotation_class_names + ), f"Expected annotation class name {expected_class_name} not found in actual annotation class names" + + +def test_import_basic_annotations_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. + """ + expected_item_names = [ + "image_1", + "image_2", + "image_3", + "image_4", + "image_4", + "image_5", + "image_6", + "image_7", + "image_8", + ] + number_of_annotations = 9 # One annotation of each type + local_dataset.register_read_only_items(config_values) + import_dir = ( + Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {import_dir}" + ) + assert_cli(result, 0) + annotations, annotation_classes, properties = local_dataset.get_annotation_data( + config_values + ) + validate_annotations( + expected_item_names, annotations, import_dir, properties, number_of_annotations + ) + + +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. + """ + expected_item_names = [ + "image_1", + "image_2", + "image_3", + "image_4", + "image_4", + "image_5", + "image_6", + "image_7", + "image_8", + ] + number_of_annotations = 9 # One annotation of each type + local_dataset.register_read_only_items(config_values) + import_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}" + ) + assert_cli(result, 0) + annotations, _, properties = local_dataset.get_annotation_data(config_values) + validate_annotations( + expected_item_names, annotations, import_dir, properties, number_of_annotations + ) + + +# TODO, implement video annotation import tests: +# test_import_basic_annotations_to_videos +# test_import_annotations_with_subtypes_to_videos + + +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 + """ + expected_item_names = [ + "image_1", + "image_2", + "image_3", + "image_4", + "image_4", + "image_5", + "image_6", + "image_7", + "image_8", + ] + expected_annotation_class_names = [ + "new_test_bounding_box_basic", + "new_test_ellipse_basic", + "new_test_keypoint_basic", + "new_test_line_basic", + "new_test_mask_basic", + "new_test_polygon_basic", + "new_test_tag_basic", + ] + number_of_annotations = 8 # One annotation of each type except skeletons, since these cannot be created during import + local_dataset.register_read_only_items(config_values) + import_dir = ( + Path(__file__).parents[1] / "data" / "import" / "image_new_basic_annotations" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {import_dir} --yes" + ) + assert_cli(result, 0) + annotations, annotation_classes, properties = local_dataset.get_annotation_data( + config_values + ) + validate_annotations( + expected_item_names, annotations, import_dir, properties, number_of_annotations + ) + validate_annotation_classes(annotation_classes, expected_annotation_class_names) + + +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 + """ + expected_item_names = [ + "image_1", + "image_2", + "image_3", + "image_4", + "image_4", + "image_5", + "image_6", + "image_7", + "image_8", + ] + expected_annotation_class_names = [ + "new_test_bounding_box_with_properties", + "new_test_ellipse_with_properties", + "new_test_keypoint_with_properties", + "new_test_line_with_properties", + "new_test_mask_with_properties", + "new_test_polygon_with_properties", + "new_test_tag_with_properties", + ] + number_of_annotations = 8 # One annotation of each type except skeletons, since these cannot be created during import + local_dataset.register_read_only_items(config_values) + import_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" + ) + assert_cli(result, 0) + annotations, annotation_classes, properties = local_dataset.get_annotation_data( + config_values + ) + validate_annotations( + expected_item_names, annotations, import_dir, properties, number_of_annotations + ) + validate_annotation_classes(annotation_classes, expected_annotation_class_names) + + +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 + """ + expected_item_names = [ + "image_1", + "image_2", + "image_3", + "image_4", + "image_4", + "image_5", + "image_6", + "image_7", + "image_8", + ] + local_dataset.register_read_only_items(config_values) + import_dir = ( + Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + ) + # 1st import to create annotations + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {import_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) + annotations, _, _ = local_dataset.get_annotation_data(config_values) + for expected_item_name in expected_item_names: + item_annotations = annotations[expected_item_name] + assert ( + len(item_annotations) == 15 + ) # 15 because tag, raster_layer, and mask are not added again during the 2nd import + + +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 + """ + expected_item_names = [ + "image_1", + "image_2", + "image_3", + "image_4", + "image_4", + "image_5", + "image_6", + "image_7", + "image_8", + ] + local_dataset.register_read_only_items(config_values) + import_dir = ( + Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + ) + # 1st import to create annotations + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {import_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" + ) + assert_cli(result, 0) + annotations, _, _ = local_dataset.get_annotation_data(config_values) + for expected_item_name in expected_item_names: + item_annotations = annotations[expected_item_name] + assert len(item_annotations) == 9 + + +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 + """ + local_dataset.register_read_only_items(config_values) + import_dir = ( + Path(__file__).parents[1] / "data" / "import" / "image_basic_annotations" + ) + # 1st import to create annotations + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {import_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}" + ) + 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 new file mode 100644 index 000000000..7c109f411 --- /dev/null +++ b/e2e_tests/cli/test_pull.py @@ -0,0 +1,22 @@ +# 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/cli/test_push.py b/e2e_tests/cli/test_push.py new file mode 100644 index 000000000..b53b569c2 --- /dev/null +++ b/e2e_tests/cli/test_push.py @@ -0,0 +1,112 @@ +from pathlib import Path + + +from e2e_tests.helpers import ( + assert_cli, + run_cli_command, + wait_until_items_processed, + list_items, +) +from e2e_tests.objects import E2EDataset, ConfigValues + +import tempfile +import zipfile + + +def test_push_mixed_filetypes( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test pushing a directory of files containing various fileytypes: + - .jpg + - .png + - .mp4 + - .dcm + - .pdf + """ + push_dir = Path(__file__).parents[1] / "data" / "push" / "mixed_filetypes.zip" + with tempfile.TemporaryDirectory() as tmp_dir_str: + tmp_dir = Path(tmp_dir_str) + with zipfile.ZipFile(push_dir) as z: + z.extractall(tmp_dir) + result = run_cli_command( + f"darwin dataset push {local_dataset.name} {tmp_dir}/mixed_filetypes" + ) + assert_cli(result, 0) + wait_until_items_processed(config_values, local_dataset.id) + items = list_items( + config_values.api_key, + local_dataset.id, + config_values.team_slug, + config_values.server, + ) + assert len(items) == 5 + + +def test_push_nested_directory_of_images( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test pushing a nested directory structure of some images with the `preserve_folders` flag. + """ + expected_paths = { + "image_1.jpg": "/dir1", + "image_2.jpg": "/dir1", + "image_3.jpg": "/dir2", + "image_4.jpg": "/dir2", + "image_5.jpg": "/dir1/dir3", + "image_6.jpg": "/dir1/dir3", + } + push_dir = ( + Path(__file__).parents[1] / "data" / "push" / "nested_directory_of_images.zip" + ) + with tempfile.TemporaryDirectory() as tmp_dir_str: + tmp_dir = Path(tmp_dir_str) + with zipfile.ZipFile(push_dir) as z: + z.extractall(tmp_dir) + result = run_cli_command( + f"darwin dataset push {local_dataset.name} {tmp_dir}/nested_directory_of_images --preserve-folders" + ) + assert_cli(result, 0) + wait_until_items_processed(config_values, local_dataset.id) + items = list_items( + config_values.api_key, + local_dataset.id, + config_values.team_slug, + config_values.server, + ) + assert len(items) == 6 + for item in items: + assert expected_paths[item["name"]] == item["path"] + + +def test_push_videos_with_non_native_fps( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test that if FPS is set, that the value is respected in the resulting dataset items + """ + push_dir = Path(__file__).parents[1] / "data" / "push" / "25_frame_video.zip" + fps = 5 + with tempfile.TemporaryDirectory() as tmp_dir_str: + tmp_dir = Path(tmp_dir_str) + with zipfile.ZipFile(push_dir) as z: + z.extractall(tmp_dir) + result = run_cli_command( + f"darwin dataset push {local_dataset.name} {tmp_dir}/25_frame_video --fps {fps}" + ) + assert_cli(result, 0) + wait_until_items_processed(config_values, local_dataset.id) + items = list_items( + config_values.api_key, + local_dataset.id, + config_values.team_slug, + config_values.server, + ) + video_metadata = items[0]["slots"][0]["metadata"] + assert len(items) == 1 + assert 1 == 1 + assert items[0]["slots"][0]["fps"] == fps + assert video_metadata["native_fps"] == 10 + assert video_metadata["frames_manifests"][0]["total_frames"] == 25 + assert video_metadata["frames_manifests"][0]["visible_frames"] == 13 diff --git a/e2e_tests/conftest.py b/e2e_tests/conftest.py index d4ebf9755..92af9f8f0 100644 --- a/e2e_tests/conftest.py +++ b/e2e_tests/conftest.py @@ -2,14 +2,16 @@ from os.path import dirname, join from pathlib import Path from time import sleep -from typing import List +from typing import List, Generator import dotenv import pytest +import tempfile from darwin.future.data_objects.typing import UnknownType from e2e_tests.exceptions import E2EEnvironmentVariableNotSet -from e2e_tests.objects import ConfigValues +from e2e_tests.objects import ConfigValues, E2EDataset +from e2e_tests.helpers import new_dataset # noqa: F401 from e2e_tests.setup_tests import ( setup_annotation_classes, setup_datasets, @@ -123,3 +125,12 @@ def config_values(request: UnknownType) -> ConfigValues: raise ValueError("E2E_TEAM is not set") return ConfigValues(server=server, api_key=api_key, team_slug=team) + + +@pytest.fixture +def local_dataset( + new_dataset: E2EDataset, # noqa: F811 +) -> Generator[E2EDataset, None, None]: + with tempfile.TemporaryDirectory() as temp_directory: + new_dataset.directory = temp_directory + yield new_dataset diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_1.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_1.json new file mode 100644 index 000000000..f9ded430f --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_1.json @@ -0,0 +1,582 @@ +{ + "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": "01920b92-1d5d-94a4-6fbe-8a4d7f9fa15d", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-94a4-6fbe-8a4d7f9fa15d" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/2ec69e41-91b2-4155-9b05-6ed995677b1e/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/9dfc5eac-bf16-4380-a148-9fff6e63b9f0" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "b92626e7-a1fd-4ecb-a418-31aa37069bc1", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "40288025-5eea-406c-95fb-fd335df117fe", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "de3a1fd0-bff9-4b4a-bffb-b6b92bff18a3", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "d078cdd0-7ff3-4835-9d5d-f4e0c6a31fa6", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "063cd083-e25a-4f0d-82d9-45d0b3c9dedd", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "a446a6dc-6427-413f-8f5d-5af0121f0923", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "e59b6d18-88dc-417a-a619-513c634e1402", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "4f58cca2-e174-4564-b242-1d17042f1b01", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "8596d3bd-d9f1-4663-8cc7-d444e97abb74", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 503228, + 1, + 8, + 0, + 21, + 1, + 10, + 0, + 1879, + 1, + 12, + 0, + 17, + 1, + 14, + 0, + 1875, + 1, + 16, + 0, + 13, + 1, + 18, + 0, + 1872, + 1, + 18, + 0, + 11, + 1, + 20, + 0, + 1870, + 1, + 20, + 0, + 9, + 1, + 22, + 0, + 7, + 1, + 11, + 0, + 1850, + 1, + 22, + 0, + 7, + 1, + 27, + 0, + 1, + 1, + 18, + 0, + 1845, + 1, + 22, + 0, + 7, + 1, + 48, + 0, + 1842, + 1, + 24, + 0, + 5, + 1, + 51, + 0, + 1840, + 1, + 24, + 0, + 5, + 1, + 52, + 0, + 1838, + 1, + 26, + 0, + 3, + 1, + 54, + 0, + 1837, + 1, + 26, + 0, + 3, + 1, + 55, + 0, + 1836, + 1, + 26, + 0, + 3, + 1, + 55, + 0, + 1836, + 1, + 26, + 0, + 3, + 1, + 56, + 0, + 1835, + 1, + 26, + 0, + 3, + 1, + 56, + 0, + 1835, + 1, + 26, + 0, + 3, + 1, + 57, + 0, + 1834, + 1, + 26, + 0, + 3, + 1, + 57, + 0, + 1834, + 1, + 26, + 0, + 3, + 1, + 57, + 0, + 1834, + 1, + 26, + 0, + 4, + 1, + 56, + 0, + 1834, + 1, + 26, + 0, + 4, + 1, + 56, + 0, + 1835, + 1, + 24, + 0, + 6, + 1, + 55, + 0, + 1835, + 1, + 24, + 0, + 6, + 1, + 55, + 0, + 1836, + 1, + 22, + 0, + 8, + 1, + 54, + 0, + 1836, + 1, + 22, + 0, + 9, + 1, + 52, + 0, + 1838, + 1, + 20, + 0, + 11, + 1, + 51, + 0, + 1839, + 1, + 18, + 0, + 14, + 1, + 48, + 0, + 1841, + 1, + 16, + 0, + 17, + 1, + 46, + 0, + 1843, + 1, + 12, + 0, + 23, + 1, + 41, + 0, + 1846, + 1, + 8, + 0, + 26, + 1, + 39, + 0, + 1882, + 1, + 37, + 0, + 1885, + 1, + 14, + 0, + 1, + 1, + 18, + 0, + 1889, + 1, + 10, + 0, + 8, + 1, + 11, + 0, + 1512704 + ], + "mask_annotation_ids_mapping": { + "4f58cca2-e174-4564-b242-1d17042f1b01": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_2.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_2.json new file mode 100644 index 000000000..c0340ee59 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_2.json @@ -0,0 +1,474 @@ +{ + "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": "01920b92-1d5d-ea77-8fa4-16378bafedb3", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-ea77-8fa4-16378bafedb3" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/5e0b3d9d-9bf8-4166-8949-6ab7392161ad/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/4920b12a-1706-47f1-b084-2d2234ed1151" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "81295639-1b29-4681-b3a8-53119bf49036", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "f3b20d5d-987a-44a4-94ac-41acf2ac14fd", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "1220a567-c329-4bca-b955-56387a3f50a2", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "3f01b473-f88f-4f3f-b6f6-559feff994f8", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "4c6e632c-f519-41ef-a918-462e1745f30e", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "d9d250a0-98b9-4b5e-85a2-c1ad7c0e4b2d", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "02d3df0e-8f01-4ba6-a790-954d3c892698", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "c389c7c5-0a92-48a0-b991-cf26b351111d", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "69c45b6b-83c1-4a0a-9210-03754a4e823e", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 470662, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1902, + 1, + 20, + 0, + 1899, + 1, + 22, + 0, + 1896, + 1, + 25, + 0, + 1893, + 1, + 28, + 0, + 1890, + 1, + 30, + 0, + 1888, + 1, + 33, + 0, + 1886, + 1, + 34, + 0, + 1885, + 1, + 36, + 0, + 1883, + 1, + 37, + 0, + 1883, + 1, + 37, + 0, + 1882, + 1, + 38, + 0, + 1881, + 1, + 39, + 0, + 1881, + 1, + 39, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1879, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1879, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 39, + 0, + 1881, + 1, + 38, + 0, + 1882, + 1, + 37, + 0, + 1883, + 1, + 35, + 0, + 1885, + 1, + 33, + 0, + 1887, + 1, + 31, + 0, + 1890, + 1, + 28, + 0, + 1892, + 1, + 25, + 0, + 1896, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1535742 + ], + "mask_annotation_ids_mapping": { + "c389c7c5-0a92-48a0-b991-cf26b351111d": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_3.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_3.json new file mode 100644 index 000000000..d81446088 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_3.json @@ -0,0 +1,518 @@ +{ + "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": "01920b92-1d5d-e8ad-986f-ad4942f1bbfc", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-e8ad-986f-ad4942f1bbfc" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/ddd13905-9bbb-4fab-9642-bf4604686fda/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/30ec0f13-caaa-4374-be5a-e90b3493fb73" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "6485cc18-0fc6-4a64-9794-474fd7040767", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "f133a6c1-8de2-47f8-a295-e1978e9fda05", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "3088bafc-a6b8-46e1-864a-ea49ce6d46c9", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "a6786798-3d81-4c72-adcb-34a4615c33ce", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "67eb19f3-66cb-4910-8314-8cfdd6bbf34e", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "77cb2ca5-c010-48c9-a68d-d3e08ed78eae", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "318737ce-0f94-40d8-96aa-a616c1e5999c", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "b92d8bad-ace9-4f73-b428-9505eb960016", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2234893b-eea8-4b90-a2d1-c0ddf32b2918", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 543631, + 1, + 8, + 0, + 1910, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1903, + 1, + 18, + 0, + 1901, + 1, + 20, + 0, + 1899, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1897, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1897, + 1, + 22, + 0, + 1897, + 1, + 22, + 0, + 1897, + 1, + 22, + 0, + 1897, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1897, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1441645 + ], + "mask_annotation_ids_mapping": { + "b92d8bad-ace9-4f73-b428-9505eb960016": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_4.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_4.json new file mode 100644 index 000000000..9e4d66c77 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_4.json @@ -0,0 +1,570 @@ +{ + "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": "01920b92-1d5d-8b50-17e9-c0f178e6eee6", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-8b50-17e9-c0f178e6eee6" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/3c731d84-7d7f-4ac8-bbd9-0d53f1d47195/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/609ba1a4-79da-4743-b331-e57ccd9ee518" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "c7ab6a60-d36d-4fb9-b95d-b46002093b5c", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "02f6e8c9-9ae4-4ff2-a4d2-1d8a15476c04", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "21b82723-e87c-43b5-8eaa-49f1933a6e1a", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "8a7e04f5-76b8-4996-a19e-a864122ad2a0", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "173e6ec8-53d9-4ae5-8a01-5278d4573662", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "2c851bb5-52f1-417b-8aac-23dc2083366f", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "02be609a-e456-4cbf-a704-875a2f0246e3", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "aa057965-2b8b-4c33-931e-3761eda459d6", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6660192e-76cb-412b-8f8d-fffef3cbb223", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 476334, + 1, + 9, + 0, + 6, + 1, + 8, + 0, + 1895, + 1, + 13, + 0, + 2, + 1, + 12, + 0, + 1891, + 1, + 31, + 0, + 1888, + 1, + 33, + 0, + 1886, + 1, + 35, + 0, + 1884, + 1, + 37, + 0, + 1883, + 1, + 37, + 0, + 1882, + 1, + 39, + 0, + 1881, + 1, + 39, + 0, + 1880, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1881, + 1, + 38, + 0, + 1882, + 1, + 38, + 0, + 1883, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1885, + 1, + 34, + 0, + 23, + 1, + 8, + 0, + 1856, + 1, + 32, + 0, + 22, + 1, + 12, + 0, + 1855, + 1, + 30, + 0, + 21, + 1, + 16, + 0, + 1855, + 1, + 12, + 0, + 2, + 1, + 12, + 0, + 22, + 1, + 18, + 0, + 1856, + 1, + 8, + 0, + 6, + 1, + 8, + 0, + 23, + 1, + 21, + 0, + 1898, + 1, + 23, + 0, + 1897, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 27, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1904, + 1, + 14, + 0, + 1908, + 1, + 10, + 0, + 1501203 + ], + "mask_annotation_ids_mapping": { + "aa057965-2b8b-4c33-931e-3761eda459d6": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_5.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_5.json new file mode 100644 index 000000000..9097e7e6b --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_5.json @@ -0,0 +1,442 @@ +{ + "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": "01920b92-1d5d-55bf-d705-8b39dea7fde6", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-55bf-d705-8b39dea7fde6" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/8f95e81c-def7-4973-9152-6d0fc39e1473/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/08448a07-4e23-41f9-abbd-0dc149ef2be4" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "0d920fcc-5ec8-4760-8322-61e4de28aa3e", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "e0d23fd6-2a77-4d14-b178-b42a082cf54d", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "5faa5611-59ba-4d1b-8a1d-e6a451ab5506", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "aa95ba32-2374-4981-93c7-7447d846ca03", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "64d2a78a-0cb7-4849-9202-0901e78caedc", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "657d85c4-7c2a-4874-bcbf-bb15db32aee9", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "a9bf3ac0-8742-43e9-aa7f-46b9618d3cec", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "11cff11e-43a7-4b31-83ab-720fdcc84dd7", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "d07c5cf8-3b3f-489e-be44-927f8c98c7df", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 497558, + 1, + 9, + 0, + 1, + 1, + 8, + 0, + 1900, + 1, + 22, + 0, + 1896, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1891, + 1, + 30, + 0, + 1889, + 1, + 32, + 0, + 1888, + 1, + 32, + 0, + 1887, + 1, + 34, + 0, + 1886, + 1, + 34, + 0, + 1885, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1885, + 1, + 35, + 0, + 1885, + 1, + 34, + 0, + 1887, + 1, + 33, + 0, + 1887, + 1, + 32, + 0, + 1889, + 1, + 31, + 0, + 1890, + 1, + 29, + 0, + 1892, + 1, + 27, + 0, + 1895, + 1, + 24, + 0, + 1898, + 1, + 20, + 0, + 1910, + 1, + 8, + 0, + 1526104 + ], + "mask_annotation_ids_mapping": { + "11cff11e-43a7-4b31-83ab-720fdcc84dd7": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_6.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_6.json new file mode 100644 index 000000000..52f4666d6 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_6.json @@ -0,0 +1,454 @@ +{ + "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": "01920b92-1d5d-1832-3a09-1f38557c57b4", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-1832-3a09-1f38557c57b4" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/4950b608-00a1-4e73-b746-bfe1ea0a1ab6/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/9e070e8c-03b3-40b7-a3cb-6da6bcc8d4ed" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "8a9dcdc5-e584-45f2-bf71-2f143d11632b", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "cda6055b-cddc-49bb-a322-7a687855518f", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "6f090adc-ecc7-4d01-98c7-89ca688b57f9", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "8f37515b-6cad-4c3e-895b-951431348986", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "4fd320f4-745b-479f-9641-b091f983c393", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "c2a937af-c277-4e80-851b-34c314019aed", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "2f398d01-4099-4b6a-887d-3ac850fd33d9", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "108f0fd2-f6ea-4659-9aa4-1038a8c473ec", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "3334b185-2c1a-4af2-a3eb-619a542c17fe", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 462946, + 1, + 8, + 0, + 1910, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1903, + 1, + 18, + 0, + 1898, + 1, + 27, + 0, + 1891, + 1, + 31, + 0, + 1887, + 1, + 35, + 0, + 1884, + 1, + 37, + 0, + 1882, + 1, + 39, + 0, + 1880, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1878, + 1, + 43, + 0, + 1877, + 1, + 43, + 0, + 1876, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1876, + 1, + 43, + 0, + 1877, + 1, + 43, + 0, + 1878, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1880, + 1, + 39, + 0, + 1882, + 1, + 37, + 0, + 1884, + 1, + 35, + 0, + 1887, + 1, + 31, + 0, + 1891, + 1, + 17, + 0, + 2, + 1, + 8, + 0, + 1554956 + ], + "mask_annotation_ids_mapping": { + "108f0fd2-f6ea-4659-9aa4-1038a8c473ec": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_7.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_7.json new file mode 100644 index 000000000..22cd4093c --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_7.json @@ -0,0 +1,494 @@ +{ + "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": "01920b92-1d5d-46ee-5117-53ba0d29d1b0", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-46ee-5117-53ba0d29d1b0" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/1e2f63eb-b7fc-482f-91f3-8caa242e63cb/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/20de7c08-20dc-4f16-b559-bbcce2f7b319" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "0a662491-8524-460c-b0a1-463e3def1ce2", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "45b1762d-261b-4af4-a7b3-9250354fbb44", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "5a7b975a-64a6-4eba-89c7-4be161477807", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "0cbe2fe4-989d-420d-a96a-00586ee930dc", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "4024a7ec-a372-48d7-a9ee-604be710548c", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "b76613e5-72ba-4f2b-8bb7-4cfbd8a1b816", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "3b4dc955-bd5e-43d9-bd73-bfcb16e8d5dc", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "d830153a-94e4-434f-8cd1-cbd6c4a717da", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "ccde37ee-00af-4a85-a4ff-0fe8bde1b89b", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 447629, + 1, + 8, + 0, + 1905, + 1, + 17, + 0, + 1901, + 1, + 21, + 0, + 1897, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 30, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 32, + 0, + 1879, + 1, + 41, + 0, + 1877, + 1, + 43, + 0, + 1875, + 1, + 45, + 0, + 1874, + 1, + 46, + 0, + 1873, + 1, + 47, + 0, + 1872, + 1, + 48, + 0, + 1872, + 1, + 48, + 0, + 1871, + 1, + 49, + 0, + 1871, + 1, + 48, + 0, + 1871, + 1, + 49, + 0, + 1871, + 1, + 48, + 0, + 1872, + 1, + 48, + 0, + 1872, + 1, + 47, + 0, + 1873, + 1, + 46, + 0, + 1874, + 1, + 45, + 0, + 1875, + 1, + 43, + 0, + 1877, + 1, + 41, + 0, + 1880, + 1, + 35, + 0, + 1885, + 1, + 33, + 0, + 1887, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1549186 + ], + "mask_annotation_ids_mapping": { + "d830153a-94e4-434f-8cd1-cbd6c4a717da": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_with_subtypes/image_8.json b/e2e_tests/data/import/image_annotations_with_subtypes/image_8.json new file mode 100644 index 000000000..1fe063631 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_with_subtypes/image_8.json @@ -0,0 +1,470 @@ +{ + "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": "01920b92-1d5e-908e-7b24-3d339ea72237", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5e-908e-7b24-3d339ea72237" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/ace6c9a2-d39a-43df-9fd2-9f124176810a/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/141cdb56-2494-4052-bce2-b22673e6ad68" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "be4fc02d-10ae-489c-871e-15558f1ac58d", + "instance_id": { + "value": 2 + }, + "name": "test_bounding_box_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "29c145f2-1ec7-46fd-9bdf-fd68dd82c48b", + "instance_id": { + "value": 3 + }, + "name": "test_ellipse_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "a32b40ec-258e-47ba-b1c5-7508853df665", + "instance_id": { + "value": 4 + }, + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "test_keypoint_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "6d4c8c85-827e-49df-b992-c286b2c2a544", + "instance_id": { + "value": 5 + }, + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "test_line_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "directional_vector": { + "angle": -1.6494, + "length": 118.3181 + }, + "id": "e54c1454-2347-4a16-8303-8ee5c40071df", + "instance_id": { + "value": 6 + }, + "name": "test_polygon_with_subtypes_and_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "d9eb4c46-e7ac-4f48-8a2c-04677a761d3f", + "instance_id": { + "value": 7 + }, + "name": "test_skeleton_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + } + ], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 301.369, + "y": 175.5217 + }, + { + "name": "2", + "occluded": false, + "x": 341.4465, + "y": 161.2866 + } + ] + }, + "slot_names": [ + "0" + ], + "text": { + "text": "test_text" + } + }, + { + "id": "b347d4e5-6914-42c5-9e5a-479afc198671", + "name": "test_tag_with_subtypes_and_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {}, + "text": { + "text": "test_text" + } + }, + { + "id": "edacf579-187e-4e66-9187-b04579475d0e", + "mask": {}, + "name": "test_mask_with_subtypes_and_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "567ee389-d874-4606-83c9-49af6eb030a7", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 505214, + 1, + 8, + 0, + 1910, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1903, + 1, + 18, + 0, + 1901, + 1, + 20, + 0, + 1899, + 1, + 22, + 0, + 5, + 1, + 8, + 0, + 1885, + 1, + 22, + 0, + 3, + 1, + 12, + 0, + 1882, + 1, + 40, + 0, + 1880, + 1, + 41, + 0, + 1878, + 1, + 43, + 0, + 1877, + 1, + 44, + 0, + 1876, + 1, + 44, + 0, + 1876, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 46, + 0, + 1874, + 1, + 46, + 0, + 1874, + 1, + 46, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1876, + 1, + 44, + 0, + 1876, + 1, + 44, + 0, + 1877, + 1, + 43, + 0, + 1878, + 1, + 41, + 0, + 1880, + 1, + 40, + 0, + 1882, + 1, + 12, + 0, + 3, + 1, + 22, + 0, + 1885, + 1, + 8, + 0, + 5, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1510758 + ], + "mask_annotation_ids_mapping": { + "edacf579-187e-4e66-9187-b04579475d0e": 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_basic_annotations/image_1.json new file mode 100644 index 000000000..93c615805 --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_1.json @@ -0,0 +1,317 @@ +{ + "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": "01920b88-51e0-ce68-bf91-a1bab42246e0", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-ce68-bf91-a1bab42246e0" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/b03a6b21-a3f8-492b-999f-62fbd15b444b/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/c2248b2e-9ae6-4db3-97ae-2bb6a0ab2380" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "5f545fca-1fe9-408b-a715-9ef0e56cfeba", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "d260483b-3bf6-4e43-85b5-2b38ca4ebd84", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4e5e1fc4-ee95-4da5-bb69-d10f1a743f6e", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "9cc99669-f6e5-4d6e-88cd-f87e85060321", + "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": "6597df19-d711-4f89-b031-f167af3fdb5e", + "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": "e716185a-bb70-4118-bf70-0be7d41551fa", + "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": "97fce761-d432-4968-88b4-70a25a50796c", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c5dd19cf-3473-4a9b-ae56-eff81130504a", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "e0c12ded-5d4f-45e7-8e00-52358e264d4b", + "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": { + "c5dd19cf-3473-4a9b-ae56-eff81130504a": 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_2.json b/e2e_tests/data/import/image_basic_annotations/image_2.json new file mode 100644 index 000000000..481e75cbc --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_2.json @@ -0,0 +1,297 @@ +{ + "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": "01920b88-51e0-850c-fc38-74479d6aad3e", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-850c-fc38-74479d6aad3e" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/5562f5ff-9ea4-43a8-8838-d5e800faea01/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/ce018659-b1b9-465b-bba7-70d894014610" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "4cfcfbf6-f4d8-488a-971e-c580b52c4977", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "5b3ce3f4-e482-4fee-8df6-78fa28e4ecf5", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "74be1e13-89c8-4884-981f-a42ead674d2d", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "4db09862-3f41-45ca-a3c9-a6bc6a09c6b4", + "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": "bcd34162-c3ee-4914-9e6d-5744190d68b3", + "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": "8c1c7d28-529b-4862-9330-15dab4bd1f1a", + "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": "56a4ac8d-ed1a-4e8f-90a9-0f6b77de9a83", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c7fb2f73-5524-4c46-b7e3-80dac048df13", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "dcfe76bc-2518-418d-9a75-5b38baa02db7", + "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": { + "c7fb2f73-5524-4c46-b7e3-80dac048df13": 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_3.json b/e2e_tests/data/import/image_basic_annotations/image_3.json new file mode 100644 index 000000000..0099624fc --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_3.json @@ -0,0 +1,409 @@ +{ + "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": "01920b88-51e0-741b-a23a-168903e65d33", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-741b-a23a-168903e65d33" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/e7bc0204-5818-4d91-9455-975d2be5cd46/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/9e3bfc17-0bae-45d5-9190-59d9caef55fa" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "adce54ea-6abe-426d-93d0-f03902845831", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "6e77f7f1-9980-4b06-95e4-5972df202a09", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4fd45ba5-e8e0-4a37-ad0b-32391b06e52b", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "8de8e41b-0e83-47c9-b6b8-aaf41a62ce60", + "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": "ac1eb7de-7003-44b1-88f4-108f0166e2a9", + "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": "24a15a17-964b-49b9-930f-c58d0f54ebfc", + "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": "2353d32b-ba84-4ff9-8a03-60acc036152f", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "3fc409df-3c62-4c3a-b942-a5a2b5c675c1", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6952da44-cea8-4441-b133-fff9584497a1", + "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": { + "3fc409df-3c62-4c3a-b942-a5a2b5c675c1": 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_4.json b/e2e_tests/data/import/image_basic_annotations/image_4.json new file mode 100644 index 000000000..327bbb96f --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_4.json @@ -0,0 +1,325 @@ +{ + "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": "01920b88-51e0-304e-9e0b-dfb9287c1df7", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-304e-9e0b-dfb9287c1df7" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/aed10b03-2237-4cad-8a86-8b1c658d2409/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/2212b5a1-0dfd-427f-ae60-bc2c8a55884b" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "c6b1f752-5a30-408f-8f2d-32823bcfed96", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "c2bf9ab2-4861-417c-95fc-34d851980484", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "71ab4ef4-e014-46d6-8e56-971f69a021bc", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "4bc01445-fc05-4eae-b3e6-1d89a82fc941", + "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": "61cb6aaa-11ce-4004-ab3a-5ca89d59180a", + "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": "0ca8ddda-b52e-4d67-b80b-a04f98ca5595", + "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": "abd4cd0f-a64e-4e88-8dd3-60b22cf3083c", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "d2ff122c-2c4f-4158-8ab3-5a660e4137f7", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "c35b932c-a593-4063-a083-5b3e985635fa", + "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": { + "d2ff122c-2c4f-4158-8ab3-5a660e4137f7": 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_5.json b/e2e_tests/data/import/image_basic_annotations/image_5.json new file mode 100644 index 000000000..536316bbd --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_5.json @@ -0,0 +1,369 @@ +{ + "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": "01920b88-51e0-30eb-618d-9a8f3679edb3", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-30eb-618d-9a8f3679edb3" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/72e84b0f-4474-43f6-89e9-78f56665e9cd/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/37c060b2-b114-4af1-9d8a-46ef1900877e" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "047ed9e8-27cd-4809-9ad9-3fc566fab086", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "41c2402e-c4a0-49cb-a2ba-03d551df8cd0", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "a70842c8-eca4-4091-aced-802793a65038", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "b42f2409-feed-47fc-935c-ce10db9eab54", + "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": "1575cf2d-4c80-4f73-ab30-bed32764f784", + "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": "0c4fb76b-402b-424e-9406-91139ce842eb", + "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": "4b56c891-95c3-438e-8e80-7f29bb6f8593", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "499731b1-5885-460e-bf4c-1a5f81634545", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "bd963672-e400-4c8f-8504-49096325d9a6", + "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": { + "499731b1-5885-460e-bf4c-1a5f81634545": 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_6.json b/e2e_tests/data/import/image_basic_annotations/image_6.json new file mode 100644 index 000000000..25679840b --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_6.json @@ -0,0 +1,361 @@ +{ + "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": "01920b88-51e0-299f-d91b-ef85ec1507c3", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-299f-d91b-ef85ec1507c3" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/3867bff6-7cb8-4083-83b7-7c74188eb621/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/4910e491-2191-43b0-8c3f-cc4240457e0e" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "1da823b4-eddb-49b3-aa01-90ff84ebfa46", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "08e44f5b-61d8-4023-816a-42d246749907", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "9ae92e99-fa0b-4d24-9bda-38a485d538f5", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "7d3d984c-099e-4b59-a53d-c3e0467e3fc9", + "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": "a6d75c80-e1ad-4721-b702-ba14757834e9", + "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": "883f884f-f617-4a96-8874-54a2eba0a464", + "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": "446c259e-78f3-4f5e-a9f2-ad441a91e5eb", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "82f068db-0781-44cf-8207-3a119f2e8fc2", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "182ce0cd-375e-42ed-96b8-93dc9a326411", + "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": { + "82f068db-0781-44cf-8207-3a119f2e8fc2": 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_7.json b/e2e_tests/data/import/image_basic_annotations/image_7.json new file mode 100644 index 000000000..0a91f20d2 --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_7.json @@ -0,0 +1,245 @@ +{ + "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": "01920b88-51e0-a0ea-7996-c7856e06e238", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-a0ea-7996-c7856e06e238" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/18110321-6229-4f5a-89db-3ca1e3d2a39d/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/d033e648-80a7-4e51-ae34-4a904a7dfc9b" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "d874ccb2-d2c4-4847-af78-f6d3dd2e5300", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "a3ccd0cc-3b2b-48d7-8ee9-139b953bb2dd", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "ac69bc21-d802-43c9-9b90-5f7caac5d98a", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "eb86579d-ca6f-4c74-9a1d-fdf12f5e19ca", + "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": "d47006b1-5b12-4398-b1a7-57f43e7e4f9a", + "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": "b274a449-098a-49e3-8091-846720b5c880", + "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": "5fe86f0c-f337-4d0e-b146-c30a533cf354", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "29b23515-6a9f-4886-9117-a15b07e0ea05", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6f0e0d25-4e49-4989-8444-8ee19459369c", + "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": { + "29b23515-6a9f-4886-9117-a15b07e0ea05": 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_8.json b/e2e_tests/data/import/image_basic_annotations/image_8.json new file mode 100644 index 000000000..aaa83b842 --- /dev/null +++ b/e2e_tests/data/import/image_basic_annotations/image_8.json @@ -0,0 +1,385 @@ +{ + "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": "01920b88-51e0-1bd8-4aea-602e6a733d30", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-1bd8-4aea-602e6a733d30" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/75abc84b-25d1-4e68-b6d7-c455a242a8da/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/403aa7ed-25db-47e8-b871-6926e1c5a0b2" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "1c22588e-f006-4bff-9842-d6690cd743db", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "bd7896fb-3635-4c3e-a417-7a005b29bb78", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6fd4261b-0aca-4d31-9f02-fa0461e4c6d6", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "8c91c90f-3744-4b72-85aa-938c862189ae", + "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": "c37bc7ac-0d5c-45c7-8e9c-bcff3df871be", + "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": "53d52c56-ca8d-4869-b72e-8c02c8018f17", + "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": "2d5279e7-eb36-4a61-a33b-4d1e57ffc8de", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c9a8e156-b9aa-4a99-9219-e9046b28ecd4", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2810456f-eda2-4fd2-b1a3-130983972290", + "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": { + "c9a8e156-b9aa-4a99-9219-e9046b28ecd4": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/.v7/metadata.json b/e2e_tests/data/import/image_new_annotations_with_properties/.v7/metadata.json new file mode 100644 index 000000000..8205569ad --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/.v7/metadata.json @@ -0,0 +1,430 @@ +{ + "version": "1.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/metadata/1.0/schema.json", + "classes": [ + { + "name": "__raster_layer__", + "type": "raster_layer", + "description": "System class for all team's annotations with raster_layer type", + "color": "rgba(0,0,0,1.0)", + "sub_types": [], + "properties": [], + "sub_types_settings": {} + }, + { + "name": "new_test_bounding_box_with_properties", + "type": "bounding_box", + "description": null, + "color": "rgba(255,255,0,1.0)", + "sub_types": [ + "directional_vector", + "attributes", + "text", + "instance_id", + "inference" + ], + "properties": [ + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(0,170,255,1.0)" + }, + { + "value": "1", + "color": "rgba(255,255,0,1.0)" + } + ] + }, + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(255,0,170,1.0)" + }, + { + "value": "1", + "color": "rgba(170,0,255,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "directional_vector": {}, + "inference": {}, + "instance_id": {}, + "text": {} + } + }, + { + "name": "new_test_polygon_with_properties", + "type": "polygon", + "description": null, + "color": "rgba(85,255,0,1.0)", + "sub_types": [ + "directional_vector", + "attributes", + "text", + "instance_id", + "inference" + ], + "properties": [ + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "1", + "color": "rgba(0,0,255,1.0)" + }, + { + "value": "2", + "color": "rgba(0,255,170,1.0)" + } + ] + }, + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(255,0,85,1.0)" + }, + { + "value": "1", + "color": "rgba(0,255,85,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "directional_vector": {}, + "inference": {}, + "instance_id": {}, + "text": {} + } + }, + { + "name": "new_test_ellipse_with_properties", + "type": "ellipse", + "description": null, + "color": "rgba(0,255,170,1.0)", + "sub_types": [ + "attributes", + "text", + "instance_id", + "inference" + ], + "properties": [ + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "1", + "color": "rgba(255,0,0,1.0)" + }, + { + "value": "2", + "color": "rgba(170,255,0,1.0)" + } + ] + }, + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(255,0,170,1.0)" + }, + { + "value": "1", + "color": "rgba(0,255,0,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "inference": {}, + "instance_id": {}, + "text": {} + } + }, + { + "name": "new_test_keypoint_with_properties", + "type": "keypoint", + "description": null, + "color": "rgba(0,255,0,1.0)", + "sub_types": [ + "attributes", + "text", + "instance_id", + "inference" + ], + "properties": [ + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "1", + "color": "rgba(170,0,255,1.0)" + }, + { + "value": "2", + "color": "rgba(255,85,0,1.0)" + } + ] + }, + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(255,255,0,1.0)" + }, + { + "value": "1", + "color": "rgba(255,85,0,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "inference": {}, + "instance_id": {}, + "text": {} + } + }, + { + "name": "new_test_line_with_properties", + "type": "line", + "description": null, + "color": "rgba(0,0,255,1.0)", + "sub_types": [ + "attributes", + "text", + "instance_id", + "inference" + ], + "properties": [ + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(0,170,255,1.0)" + }, + { + "value": "1", + "color": "rgba(85,255,0,1.0)" + } + ] + }, + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "1", + "color": "rgba(255,85,0,1.0)" + }, + { + "value": "2", + "color": "rgba(0,255,255,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "inference": {}, + "instance_id": {}, + "text": {} + } + }, + { + "name": "new_test_mask_with_properties", + "type": "mask", + "description": null, + "color": "rgba(0,255,85,1.0)", + "sub_types": [ + "attributes", + "text" + ], + "properties": [ + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(0,255,85,1.0)" + }, + { + "value": "1", + "color": "rgba(0,85,255,1.0)" + } + ] + }, + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(255,170,0,1.0)" + }, + { + "value": "1", + "color": "rgba(255,0,170,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "text": {} + } + }, + { + "name": "new_test_skeleton_with_properties", + "type": "skeleton", + "description": null, + "color": "rgba(255,85,0,1.0)", + "sub_types": [ + "attributes", + "text", + "instance_id", + "inference" + ], + "properties": [ + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(0,0,255,1.0)" + }, + { + "value": "1", + "color": "rgba(255,0,85,1.0)" + } + ] + }, + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "1", + "color": "rgba(170,0,255,1.0)" + }, + { + "value": "2", + "color": "rgba(0,0,255,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "inference": {}, + "instance_id": {}, + "text": {} + } + }, + { + "name": "new_test_tag_with_properties", + "type": "tag", + "description": null, + "color": "rgba(255,0,0,1.0)", + "sub_types": [ + "attributes", + "text", + "inference" + ], + "properties": [ + { + "name": "multi_select-1", + "type": "multi_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(255,0,85,1.0)" + }, + { + "value": "1", + "color": "rgba(255,170,0,1.0)" + } + ] + }, + { + "name": "single_select-1", + "type": "single_select", + "description": "", + "required": false, + "property_values": [ + { + "value": "2", + "color": "rgba(0,85,255,1.0)" + }, + { + "value": "1", + "color": "rgba(0,255,85,1.0)" + } + ] + } + ], + "sub_types_settings": { + "attributes": {}, + "inference": {}, + "text": {} + } + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_1.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_1.json new file mode 100644 index 000000000..9388f7b20 --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_1.json @@ -0,0 +1,504 @@ +{ + "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": "01920b92-1d5d-94a4-6fbe-8a4d7f9fa15d", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-94a4-6fbe-8a4d7f9fa15d" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/2ec69e41-91b2-4155-9b05-6ed995677b1e/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/9dfc5eac-bf16-4380-a148-9fff6e63b9f0" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "b92626e7-a1fd-4ecb-a418-31aa37069bc1", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "40288025-5eea-406c-95fb-fd335df117fe", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "de3a1fd0-bff9-4b4a-bffb-b6b92bff18a3", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "d078cdd0-7ff3-4835-9d5d-f4e0c6a31fa6", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "063cd083-e25a-4f0d-82d9-45d0b3c9dedd", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "e59b6d18-88dc-417a-a619-513c634e1402", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "4f58cca2-e174-4564-b242-1d17042f1b01", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "8596d3bd-d9f1-4663-8cc7-d444e97abb74", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 503228, + 1, + 8, + 0, + 21, + 1, + 10, + 0, + 1879, + 1, + 12, + 0, + 17, + 1, + 14, + 0, + 1875, + 1, + 16, + 0, + 13, + 1, + 18, + 0, + 1872, + 1, + 18, + 0, + 11, + 1, + 20, + 0, + 1870, + 1, + 20, + 0, + 9, + 1, + 22, + 0, + 7, + 1, + 11, + 0, + 1850, + 1, + 22, + 0, + 7, + 1, + 27, + 0, + 1, + 1, + 18, + 0, + 1845, + 1, + 22, + 0, + 7, + 1, + 48, + 0, + 1842, + 1, + 24, + 0, + 5, + 1, + 51, + 0, + 1840, + 1, + 24, + 0, + 5, + 1, + 52, + 0, + 1838, + 1, + 26, + 0, + 3, + 1, + 54, + 0, + 1837, + 1, + 26, + 0, + 3, + 1, + 55, + 0, + 1836, + 1, + 26, + 0, + 3, + 1, + 55, + 0, + 1836, + 1, + 26, + 0, + 3, + 1, + 56, + 0, + 1835, + 1, + 26, + 0, + 3, + 1, + 56, + 0, + 1835, + 1, + 26, + 0, + 3, + 1, + 57, + 0, + 1834, + 1, + 26, + 0, + 3, + 1, + 57, + 0, + 1834, + 1, + 26, + 0, + 3, + 1, + 57, + 0, + 1834, + 1, + 26, + 0, + 4, + 1, + 56, + 0, + 1834, + 1, + 26, + 0, + 4, + 1, + 56, + 0, + 1835, + 1, + 24, + 0, + 6, + 1, + 55, + 0, + 1835, + 1, + 24, + 0, + 6, + 1, + 55, + 0, + 1836, + 1, + 22, + 0, + 8, + 1, + 54, + 0, + 1836, + 1, + 22, + 0, + 9, + 1, + 52, + 0, + 1838, + 1, + 20, + 0, + 11, + 1, + 51, + 0, + 1839, + 1, + 18, + 0, + 14, + 1, + 48, + 0, + 1841, + 1, + 16, + 0, + 17, + 1, + 46, + 0, + 1843, + 1, + 12, + 0, + 23, + 1, + 41, + 0, + 1846, + 1, + 8, + 0, + 26, + 1, + 39, + 0, + 1882, + 1, + 37, + 0, + 1885, + 1, + 14, + 0, + 1, + 1, + 18, + 0, + 1889, + 1, + 10, + 0, + 8, + 1, + 11, + 0, + 1512704 + ], + "mask_annotation_ids_mapping": { + "4f58cca2-e174-4564-b242-1d17042f1b01": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_2.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_2.json new file mode 100644 index 000000000..047ccf7d0 --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_2.json @@ -0,0 +1,396 @@ +{ + "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": "01920b92-1d5d-ea77-8fa4-16378bafedb3", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-ea77-8fa4-16378bafedb3" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/5e0b3d9d-9bf8-4166-8949-6ab7392161ad/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/4920b12a-1706-47f1-b084-2d2234ed1151" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "81295639-1b29-4681-b3a8-53119bf49036", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "f3b20d5d-987a-44a4-94ac-41acf2ac14fd", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "1220a567-c329-4bca-b955-56387a3f50a2", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "3f01b473-f88f-4f3f-b6f6-559feff994f8", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "4c6e632c-f519-41ef-a918-462e1745f30e", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "02d3df0e-8f01-4ba6-a790-954d3c892698", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c389c7c5-0a92-48a0-b991-cf26b351111d", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "69c45b6b-83c1-4a0a-9210-03754a4e823e", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 470662, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1902, + 1, + 20, + 0, + 1899, + 1, + 22, + 0, + 1896, + 1, + 25, + 0, + 1893, + 1, + 28, + 0, + 1890, + 1, + 30, + 0, + 1888, + 1, + 33, + 0, + 1886, + 1, + 34, + 0, + 1885, + 1, + 36, + 0, + 1883, + 1, + 37, + 0, + 1883, + 1, + 37, + 0, + 1882, + 1, + 38, + 0, + 1881, + 1, + 39, + 0, + 1881, + 1, + 39, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1879, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1879, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 39, + 0, + 1881, + 1, + 38, + 0, + 1882, + 1, + 37, + 0, + 1883, + 1, + 35, + 0, + 1885, + 1, + 33, + 0, + 1887, + 1, + 31, + 0, + 1890, + 1, + 28, + 0, + 1892, + 1, + 25, + 0, + 1896, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1535742 + ], + "mask_annotation_ids_mapping": { + "c389c7c5-0a92-48a0-b991-cf26b351111d": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_3.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_3.json new file mode 100644 index 000000000..acf1ee737 --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_3.json @@ -0,0 +1,492 @@ +{ + "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": "01920b92-1d5d-e8ad-986f-ad4942f1bbfc", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-e8ad-986f-ad4942f1bbfc" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/ddd13905-9bbb-4fab-9642-bf4604686fda/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/30ec0f13-caaa-4374-be5a-e90b3493fb73" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "6485cc18-0fc6-4a64-9794-474fd7040767", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "f133a6c1-8de2-47f8-a295-e1978e9fda05", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "3088bafc-a6b8-46e1-864a-ea49ce6d46c9", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "a6786798-3d81-4c72-adcb-34a4615c33ce", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "67eb19f3-66cb-4910-8314-8cfdd6bbf34e", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "318737ce-0f94-40d8-96aa-a616c1e5999c", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "b92d8bad-ace9-4f73-b428-9505eb960016", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2234893b-eea8-4b90-a2d1-c0ddf32b2918", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 476334, + 1, + 9, + 0, + 6, + 1, + 8, + 0, + 1895, + 1, + 13, + 0, + 2, + 1, + 12, + 0, + 1891, + 1, + 31, + 0, + 1888, + 1, + 33, + 0, + 1886, + 1, + 35, + 0, + 1884, + 1, + 37, + 0, + 1883, + 1, + 37, + 0, + 1882, + 1, + 39, + 0, + 1881, + 1, + 39, + 0, + 1880, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1881, + 1, + 38, + 0, + 1882, + 1, + 38, + 0, + 1883, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1885, + 1, + 34, + 0, + 23, + 1, + 8, + 0, + 1856, + 1, + 32, + 0, + 22, + 1, + 12, + 0, + 1855, + 1, + 30, + 0, + 21, + 1, + 16, + 0, + 1855, + 1, + 12, + 0, + 2, + 1, + 12, + 0, + 22, + 1, + 18, + 0, + 1856, + 1, + 8, + 0, + 6, + 1, + 8, + 0, + 23, + 1, + 21, + 0, + 1898, + 1, + 23, + 0, + 1897, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 27, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1904, + 1, + 14, + 0, + 1908, + 1, + 10, + 0, + 1501203 + ], + "mask_annotation_ids_mapping": { + "b92d8bad-ace9-4f73-b428-9505eb960016": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_4.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_4.json new file mode 100644 index 000000000..5466811d6 --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_4.json @@ -0,0 +1,492 @@ +{ + "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": "01920b92-1d5d-8b50-17e9-c0f178e6eee6", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-8b50-17e9-c0f178e6eee6" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/3c731d84-7d7f-4ac8-bbd9-0d53f1d47195/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/609ba1a4-79da-4743-b331-e57ccd9ee518" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "c7ab6a60-d36d-4fb9-b95d-b46002093b5c", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "02f6e8c9-9ae4-4ff2-a4d2-1d8a15476c04", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "21b82723-e87c-43b5-8eaa-49f1933a6e1a", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "8a7e04f5-76b8-4996-a19e-a864122ad2a0", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "173e6ec8-53d9-4ae5-8a01-5278d4573662", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "02be609a-e456-4cbf-a704-875a2f0246e3", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "aa057965-2b8b-4c33-931e-3761eda459d6", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6660192e-76cb-412b-8f8d-fffef3cbb223", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 476334, + 1, + 9, + 0, + 6, + 1, + 8, + 0, + 1895, + 1, + 13, + 0, + 2, + 1, + 12, + 0, + 1891, + 1, + 31, + 0, + 1888, + 1, + 33, + 0, + 1886, + 1, + 35, + 0, + 1884, + 1, + 37, + 0, + 1883, + 1, + 37, + 0, + 1882, + 1, + 39, + 0, + 1881, + 1, + 39, + 0, + 1880, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1880, + 1, + 40, + 0, + 1880, + 1, + 40, + 0, + 1881, + 1, + 38, + 0, + 1882, + 1, + 38, + 0, + 1883, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1885, + 1, + 34, + 0, + 23, + 1, + 8, + 0, + 1856, + 1, + 32, + 0, + 22, + 1, + 12, + 0, + 1855, + 1, + 30, + 0, + 21, + 1, + 16, + 0, + 1855, + 1, + 12, + 0, + 2, + 1, + 12, + 0, + 22, + 1, + 18, + 0, + 1856, + 1, + 8, + 0, + 6, + 1, + 8, + 0, + 23, + 1, + 21, + 0, + 1898, + 1, + 23, + 0, + 1897, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 27, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1904, + 1, + 14, + 0, + 1908, + 1, + 10, + 0, + 1501203 + ], + "mask_annotation_ids_mapping": { + "aa057965-2b8b-4c33-931e-3761eda459d6": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_5.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_5.json new file mode 100644 index 000000000..46ea3cb8b --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_5.json @@ -0,0 +1,364 @@ +{ + "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": "01920b92-1d5d-55bf-d705-8b39dea7fde6", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-55bf-d705-8b39dea7fde6" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/8f95e81c-def7-4973-9152-6d0fc39e1473/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/08448a07-4e23-41f9-abbd-0dc149ef2be4" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "0d920fcc-5ec8-4760-8322-61e4de28aa3e", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "e0d23fd6-2a77-4d14-b178-b42a082cf54d", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "5faa5611-59ba-4d1b-8a1d-e6a451ab5506", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "aa95ba32-2374-4981-93c7-7447d846ca03", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "64d2a78a-0cb7-4849-9202-0901e78caedc", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "a9bf3ac0-8742-43e9-aa7f-46b9618d3cec", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "11cff11e-43a7-4b31-83ab-720fdcc84dd7", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "d07c5cf8-3b3f-489e-be44-927f8c98c7df", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 497558, + 1, + 9, + 0, + 1, + 1, + 8, + 0, + 1900, + 1, + 22, + 0, + 1896, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1891, + 1, + 30, + 0, + 1889, + 1, + 32, + 0, + 1888, + 1, + 32, + 0, + 1887, + 1, + 34, + 0, + 1886, + 1, + 34, + 0, + 1885, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1884, + 1, + 36, + 0, + 1885, + 1, + 35, + 0, + 1885, + 1, + 34, + 0, + 1887, + 1, + 33, + 0, + 1887, + 1, + 32, + 0, + 1889, + 1, + 31, + 0, + 1890, + 1, + 29, + 0, + 1892, + 1, + 27, + 0, + 1895, + 1, + 24, + 0, + 1898, + 1, + 20, + 0, + 1910, + 1, + 8, + 0, + 1526104 + ], + "mask_annotation_ids_mapping": { + "11cff11e-43a7-4b31-83ab-720fdcc84dd7": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_6.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_6.json new file mode 100644 index 000000000..9c707e0c9 --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_6.json @@ -0,0 +1,376 @@ +{ + "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": "01920b92-1d5d-1832-3a09-1f38557c57b4", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-1832-3a09-1f38557c57b4" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/4950b608-00a1-4e73-b746-bfe1ea0a1ab6/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/9e070e8c-03b3-40b7-a3cb-6da6bcc8d4ed" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "8a9dcdc5-e584-45f2-bf71-2f143d11632b", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "cda6055b-cddc-49bb-a322-7a687855518f", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "6f090adc-ecc7-4d01-98c7-89ca688b57f9", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "8f37515b-6cad-4c3e-895b-951431348986", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "4fd320f4-745b-479f-9641-b091f983c393", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "2f398d01-4099-4b6a-887d-3ac850fd33d9", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "108f0fd2-f6ea-4659-9aa4-1038a8c473ec", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "3334b185-2c1a-4af2-a3eb-619a542c17fe", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 462946, + 1, + 8, + 0, + 1910, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1903, + 1, + 18, + 0, + 1898, + 1, + 27, + 0, + 1891, + 1, + 31, + 0, + 1887, + 1, + 35, + 0, + 1884, + 1, + 37, + 0, + 1882, + 1, + 39, + 0, + 1880, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1878, + 1, + 43, + 0, + 1877, + 1, + 43, + 0, + 1876, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1876, + 1, + 43, + 0, + 1877, + 1, + 43, + 0, + 1878, + 1, + 41, + 0, + 1879, + 1, + 41, + 0, + 1880, + 1, + 39, + 0, + 1882, + 1, + 37, + 0, + 1884, + 1, + 35, + 0, + 1887, + 1, + 31, + 0, + 1891, + 1, + 17, + 0, + 2, + 1, + 8, + 0, + 1554956 + ], + "mask_annotation_ids_mapping": { + "108f0fd2-f6ea-4659-9aa4-1038a8c473ec": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_7.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_7.json new file mode 100644 index 000000000..44f1c246e --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_7.json @@ -0,0 +1,416 @@ +{ + "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": "01920b92-1d5d-46ee-5117-53ba0d29d1b0", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5d-46ee-5117-53ba0d29d1b0" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/1e2f63eb-b7fc-482f-91f3-8caa242e63cb/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/20de7c08-20dc-4f16-b559-bbcce2f7b319" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "0a662491-8524-460c-b0a1-463e3def1ce2", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "45b1762d-261b-4af4-a7b3-9250354fbb44", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "5a7b975a-64a6-4eba-89c7-4be161477807", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "0cbe2fe4-989d-420d-a96a-00586ee930dc", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "4024a7ec-a372-48d7-a9ee-604be710548c", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "3b4dc955-bd5e-43d9-bd73-bfcb16e8d5dc", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "d830153a-94e4-434f-8cd1-cbd6c4a717da", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "ccde37ee-00af-4a85-a4ff-0fe8bde1b89b", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 447629, + 1, + 8, + 0, + 1905, + 1, + 17, + 0, + 1901, + 1, + 21, + 0, + 1897, + 1, + 24, + 0, + 1895, + 1, + 26, + 0, + 1893, + 1, + 28, + 0, + 1891, + 1, + 29, + 0, + 1891, + 1, + 30, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 32, + 0, + 1879, + 1, + 41, + 0, + 1877, + 1, + 43, + 0, + 1875, + 1, + 45, + 0, + 1874, + 1, + 46, + 0, + 1873, + 1, + 47, + 0, + 1872, + 1, + 48, + 0, + 1872, + 1, + 48, + 0, + 1871, + 1, + 49, + 0, + 1871, + 1, + 48, + 0, + 1871, + 1, + 49, + 0, + 1871, + 1, + 48, + 0, + 1872, + 1, + 48, + 0, + 1872, + 1, + 47, + 0, + 1873, + 1, + 46, + 0, + 1874, + 1, + 45, + 0, + 1875, + 1, + 43, + 0, + 1877, + 1, + 41, + 0, + 1880, + 1, + 35, + 0, + 1885, + 1, + 33, + 0, + 1887, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1894, + 1, + 26, + 0, + 1895, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1897, + 1, + 22, + 0, + 1898, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1549186 + ], + "mask_annotation_ids_mapping": { + "d830153a-94e4-434f-8cd1-cbd6c4a717da": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_annotations_with_properties/image_8.json b/e2e_tests/data/import/image_new_annotations_with_properties/image_8.json new file mode 100644 index 000000000..16e03b845 --- /dev/null +++ b/e2e_tests/data/import/image_new_annotations_with_properties/image_8.json @@ -0,0 +1,392 @@ +{ + "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": "01920b92-1d5e-908e-7b24-3d339ea72237", + "dataset": { + "name": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "slug": "test_dataset_2edf4430-1a35-45a2-8c45-b0325968bee2", + "dataset_management_url": "https://staging.v7labs.com/datasets/339501/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339501&item=01920b92-1d5e-908e-7b24-3d339ea72237" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/ace6c9a2-d39a-43df-9fd2-9f124176810a/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/141cdb56-2494-4052-bce2-b22673e6ad68" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 58.941, + "w": 216.693, + "x": 280.449, + "y": 173.355 + }, + "id": "be4fc02d-10ae-489c-871e-15558f1ac58d", + "name": "new_test_bounding_box_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.3985, + "center": { + "x": 133.4425, + "y": 69.1719 + }, + "radius": { + "x": 18.3176, + "y": 18.3176 + } + }, + "id": "29c145f2-1ec7-46fd-9bdf-fd68dd82c48b", + "name": "new_test_ellipse_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "a32b40ec-258e-47ba-b1c5-7508853df665", + "keypoint": { + "x": 49.6239, + "y": 173.4268 + }, + "name": "new_test_keypoint_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "6d4c8c85-827e-49df-b992-c286b2c2a544", + "line": { + "path": [ + { + "x": 142.624, + "y": -0.1339 + }, + { + "x": 171.0572, + "y": -45.1531 + }, + { + "x": 199.4903, + "y": 0.4584 + } + ] + }, + "name": "new_test_line_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 35.85509999999999, + "w": 108.1345, + "x": 275.1268, + "y": 30.7501 + }, + "id": "e54c1454-2347-4a16-8303-8ee5c40071df", + "name": "new_test_polygon_with_properties", + "polygon": { + "paths": [ + [ + { + "x": 336.0236, + "y": 30.7501 + }, + { + "x": 304.7215, + "y": 64.8979 + }, + { + "x": 383.2613, + "y": 66.6052 + }, + { + "x": 275.1268, + "y": 34.734 + } + ] + ] + }, + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "2" + } + ], + "slot_names": [ + "0" + ] + }, + { + "id": "b347d4e5-6914-42c5-9e5a-479afc198671", + "name": "new_test_tag_with_properties", + "properties": [ + { + "frame_index": 0, + "name": "multi_select-1", + "value": "1" + }, + { + "frame_index": 0, + "name": "multi_select-1", + "value": "2" + }, + { + "frame_index": 0, + "name": "single_select-1", + "value": "1" + } + ], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "edacf579-187e-4e66-9187-b04579475d0e", + "mask": {}, + "name": "new_test_mask_with_properties", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "567ee389-d874-4606-83c9-49af6eb030a7", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 505214, + 1, + 8, + 0, + 1910, + 1, + 12, + 0, + 1906, + 1, + 16, + 0, + 1903, + 1, + 18, + 0, + 1901, + 1, + 20, + 0, + 1899, + 1, + 22, + 0, + 5, + 1, + 8, + 0, + 1885, + 1, + 22, + 0, + 3, + 1, + 12, + 0, + 1882, + 1, + 40, + 0, + 1880, + 1, + 41, + 0, + 1878, + 1, + 43, + 0, + 1877, + 1, + 44, + 0, + 1876, + 1, + 44, + 0, + 1876, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 46, + 0, + 1874, + 1, + 46, + 0, + 1874, + 1, + 46, + 0, + 1875, + 1, + 45, + 0, + 1875, + 1, + 45, + 0, + 1876, + 1, + 44, + 0, + 1876, + 1, + 44, + 0, + 1877, + 1, + 43, + 0, + 1878, + 1, + 41, + 0, + 1880, + 1, + 40, + 0, + 1882, + 1, + 12, + 0, + 3, + 1, + 22, + 0, + 1885, + 1, + 8, + 0, + 5, + 1, + 22, + 0, + 1899, + 1, + 20, + 0, + 1901, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1510758 + ], + "mask_annotation_ids_mapping": { + "edacf579-187e-4e66-9187-b04579475d0e": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_1.json b/e2e_tests/data/import/image_new_basic_annotations/image_1.json new file mode 100644 index 000000000..c35c9c871 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_1.json @@ -0,0 +1,293 @@ +{ + "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": "01920b88-51e0-ce68-bf91-a1bab42246e0", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-ce68-bf91-a1bab42246e0" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/b03a6b21-a3f8-492b-999f-62fbd15b444b/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/c2248b2e-9ae6-4db3-97ae-2bb6a0ab2380" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "5f545fca-1fe9-408b-a715-9ef0e56cfeba", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "d260483b-3bf6-4e43-85b5-2b38ca4ebd84", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4e5e1fc4-ee95-4da5-bb69-d10f1a743f6e", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "9cc99669-f6e5-4d6e-88cd-f87e85060321", + "name": "new_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": "e716185a-bb70-4118-bf70-0be7d41551fa", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "97fce761-d432-4968-88b4-70a25a50796c", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c5dd19cf-3473-4a9b-ae56-eff81130504a", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "e0c12ded-5d4f-45e7-8e00-52358e264d4b", + "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": { + "c5dd19cf-3473-4a9b-ae56-eff81130504a": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_2.json b/e2e_tests/data/import/image_new_basic_annotations/image_2.json new file mode 100644 index 000000000..58f01c0b7 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_2.json @@ -0,0 +1,273 @@ +{ + "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": "01920b88-51e0-850c-fc38-74479d6aad3e", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-850c-fc38-74479d6aad3e" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/5562f5ff-9ea4-43a8-8838-d5e800faea01/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/ce018659-b1b9-465b-bba7-70d894014610" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "4cfcfbf6-f4d8-488a-971e-c580b52c4977", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "5b3ce3f4-e482-4fee-8df6-78fa28e4ecf5", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "74be1e13-89c8-4884-981f-a42ead674d2d", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "4db09862-3f41-45ca-a3c9-a6bc6a09c6b4", + "name": "new_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": "8c1c7d28-529b-4862-9330-15dab4bd1f1a", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "56a4ac8d-ed1a-4e8f-90a9-0f6b77de9a83", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c7fb2f73-5524-4c46-b7e3-80dac048df13", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "dcfe76bc-2518-418d-9a75-5b38baa02db7", + "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": { + "c7fb2f73-5524-4c46-b7e3-80dac048df13": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_3.json b/e2e_tests/data/import/image_new_basic_annotations/image_3.json new file mode 100644 index 000000000..f73ac8f17 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_3.json @@ -0,0 +1,385 @@ +{ + "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": "01920b88-51e0-741b-a23a-168903e65d33", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-741b-a23a-168903e65d33" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/e7bc0204-5818-4d91-9455-975d2be5cd46/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/9e3bfc17-0bae-45d5-9190-59d9caef55fa" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "adce54ea-6abe-426d-93d0-f03902845831", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "6e77f7f1-9980-4b06-95e4-5972df202a09", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4fd45ba5-e8e0-4a37-ad0b-32391b06e52b", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "8de8e41b-0e83-47c9-b6b8-aaf41a62ce60", + "name": "new_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": "24a15a17-964b-49b9-930f-c58d0f54ebfc", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2353d32b-ba84-4ff9-8a03-60acc036152f", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "3fc409df-3c62-4c3a-b942-a5a2b5c675c1", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6952da44-cea8-4441-b133-fff9584497a1", + "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": { + "3fc409df-3c62-4c3a-b942-a5a2b5c675c1": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_4.json b/e2e_tests/data/import/image_new_basic_annotations/image_4.json new file mode 100644 index 000000000..dd8377785 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_4.json @@ -0,0 +1,301 @@ +{ + "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": "01920b88-51e0-304e-9e0b-dfb9287c1df7", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-304e-9e0b-dfb9287c1df7" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/aed10b03-2237-4cad-8a86-8b1c658d2409/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/2212b5a1-0dfd-427f-ae60-bc2c8a55884b" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "c6b1f752-5a30-408f-8f2d-32823bcfed96", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "c2bf9ab2-4861-417c-95fc-34d851980484", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "71ab4ef4-e014-46d6-8e56-971f69a021bc", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "4bc01445-fc05-4eae-b3e6-1d89a82fc941", + "name": "new_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": "0ca8ddda-b52e-4d67-b80b-a04f98ca5595", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "abd4cd0f-a64e-4e88-8dd3-60b22cf3083c", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "d2ff122c-2c4f-4158-8ab3-5a660e4137f7", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "c35b932c-a593-4063-a083-5b3e985635fa", + "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": { + "d2ff122c-2c4f-4158-8ab3-5a660e4137f7": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_5.json b/e2e_tests/data/import/image_new_basic_annotations/image_5.json new file mode 100644 index 000000000..e4281e572 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_5.json @@ -0,0 +1,345 @@ +{ + "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": "01920b88-51e0-30eb-618d-9a8f3679edb3", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-30eb-618d-9a8f3679edb3" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/72e84b0f-4474-43f6-89e9-78f56665e9cd/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/37c060b2-b114-4af1-9d8a-46ef1900877e" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "047ed9e8-27cd-4809-9ad9-3fc566fab086", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "41c2402e-c4a0-49cb-a2ba-03d551df8cd0", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "a70842c8-eca4-4091-aced-802793a65038", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "b42f2409-feed-47fc-935c-ce10db9eab54", + "name": "new_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": "0c4fb76b-402b-424e-9406-91139ce842eb", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4b56c891-95c3-438e-8e80-7f29bb6f8593", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "499731b1-5885-460e-bf4c-1a5f81634545", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "bd963672-e400-4c8f-8504-49096325d9a6", + "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": { + "499731b1-5885-460e-bf4c-1a5f81634545": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_6.json b/e2e_tests/data/import/image_new_basic_annotations/image_6.json new file mode 100644 index 000000000..44a2fe297 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_6.json @@ -0,0 +1,337 @@ +{ + "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": "01920b88-51e0-299f-d91b-ef85ec1507c3", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-299f-d91b-ef85ec1507c3" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/3867bff6-7cb8-4083-83b7-7c74188eb621/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/4910e491-2191-43b0-8c3f-cc4240457e0e" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "1da823b4-eddb-49b3-aa01-90ff84ebfa46", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "08e44f5b-61d8-4023-816a-42d246749907", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "9ae92e99-fa0b-4d24-9bda-38a485d538f5", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "7d3d984c-099e-4b59-a53d-c3e0467e3fc9", + "name": "new_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": "883f884f-f617-4a96-8874-54a2eba0a464", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "446c259e-78f3-4f5e-a9f2-ad441a91e5eb", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "82f068db-0781-44cf-8207-3a119f2e8fc2", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "182ce0cd-375e-42ed-96b8-93dc9a326411", + "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": { + "82f068db-0781-44cf-8207-3a119f2e8fc2": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_7.json b/e2e_tests/data/import/image_new_basic_annotations/image_7.json new file mode 100644 index 000000000..3cfc7e80c --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_7.json @@ -0,0 +1,221 @@ +{ + "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": "01920b88-51e0-a0ea-7996-c7856e06e238", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-a0ea-7996-c7856e06e238" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/18110321-6229-4f5a-89db-3ca1e3d2a39d/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/d033e648-80a7-4e51-ae34-4a904a7dfc9b" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "d874ccb2-d2c4-4847-af78-f6d3dd2e5300", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "a3ccd0cc-3b2b-48d7-8ee9-139b953bb2dd", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "ac69bc21-d802-43c9-9b90-5f7caac5d98a", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "eb86579d-ca6f-4c74-9a1d-fdf12f5e19ca", + "name": "new_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": "b274a449-098a-49e3-8091-846720b5c880", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "5fe86f0c-f337-4d0e-b146-c30a533cf354", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "29b23515-6a9f-4886-9117-a15b07e0ea05", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6f0e0d25-4e49-4989-8444-8ee19459369c", + "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": { + "29b23515-6a9f-4886-9117-a15b07e0ea05": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_new_basic_annotations/image_8.json b/e2e_tests/data/import/image_new_basic_annotations/image_8.json new file mode 100644 index 000000000..48f1314d6 --- /dev/null +++ b/e2e_tests/data/import/image_new_basic_annotations/image_8.json @@ -0,0 +1,361 @@ +{ + "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": "01920b88-51e0-1bd8-4aea-602e6a733d30", + "dataset": { + "name": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "slug": "test_dataset_27f8e6a7-ed01-4282-bb48-96d8088d619f", + "dataset_management_url": "https://staging.v7labs.com/datasets/339222/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=339222&item=01920b88-51e0-1bd8-4aea-602e6a733d30" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/75abc84b-25d1-4e68-b6d7-c455a242a8da/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/403aa7ed-25db-47e8-b871-6926e1c5a0b2" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "1c22588e-f006-4bff-9842-d6690cd743db", + "name": "new_test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "bd7896fb-3635-4c3e-a417-7a005b29bb78", + "name": "new_test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "6fd4261b-0aca-4d31-9f02-fa0461e4c6d6", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "new_test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "8c91c90f-3744-4b72-85aa-938c862189ae", + "name": "new_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": "53d52c56-ca8d-4869-b72e-8c02c8018f17", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "new_test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2d5279e7-eb36-4a61-a33b-4d1e57ffc8de", + "name": "new_test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "c9a8e156-b9aa-4a99-9219-e9046b28ecd4", + "mask": {}, + "name": "new_test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2810456f-eda2-4fd2-b1a3-130983972290", + "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": { + "c9a8e156-b9aa-4a99-9219-e9046b28ecd4": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/push/25_frame_video.zip b/e2e_tests/data/push/25_frame_video.zip new file mode 100644 index 000000000..0d49062b4 Binary files /dev/null and b/e2e_tests/data/push/25_frame_video.zip differ diff --git a/e2e_tests/data/push/mixed_filetypes.zip b/e2e_tests/data/push/mixed_filetypes.zip new file mode 100644 index 000000000..a104b9b80 Binary files /dev/null and b/e2e_tests/data/push/mixed_filetypes.zip differ diff --git a/e2e_tests/data/push/nested_directory_of_images.zip b/e2e_tests/data/push/nested_directory_of_images.zip new file mode 100644 index 000000000..015685d66 Binary files /dev/null and b/e2e_tests/data/push/nested_directory_of_images.zip differ diff --git a/e2e_tests/helpers.py b/e2e_tests/helpers.py index 7e345a3da..98ed525be 100644 --- a/e2e_tests/helpers.py +++ b/e2e_tests/helpers.py @@ -1,11 +1,21 @@ from subprocess import run from time import sleep -from typing import Optional +from typing import Optional, Dict, Any, Tuple, List from attr import dataclass from darwin.exceptions import DarwinException +import json +import re +import tempfile +import uuid +from typing import Generator +import pytest +import requests +import time +from e2e_tests.objects import E2EDataset, ConfigValues + @dataclass class CLIResult: @@ -108,3 +118,257 @@ def assert_cli( assert result.stdout != expected_stdout, format_cli_output(result) if expected_stderr: assert result.stderr != expected_stderr, format_cli_output(result) + + +def list_items(api_key, dataset_id, team_slug, base_url): + """ + List items in Darwin dataset, handling pagination. + """ + url = f"{base_url}/api/v2/teams/{team_slug}/items?dataset_ids={dataset_id}" + headers = {"accept": "application/json", "Authorization": f"ApiKey {api_key}"} + items = [] + + while url: + response = requests.get(url, headers=headers) + if response.ok: + data = json.loads(response.text) + items.extend(data["items"]) + next_page = data.get("page", {}).get("next") + if next_page: + url = f"{base_url}/{team_slug}/items?dataset_ids={dataset_id}&page[from]={next_page}" + else: + url = None + else: + raise requests.exceptions.HTTPError( + f"GET request failed with status code {response.status_code}." + ) + + return items + + +def wait_until_items_processed( + config_values: ConfigValues, dataset_id: int, timeout: int = 600 +): + """ + Waits until all items in a dataset have finished processing before attempting to upload annotations. + Raises a `TimeoutError` if the process takes longer than the specified timeout. + """ + sleep_duration = 10 + api_key = config_values.api_key + team_slug = config_values.team_slug + base_url = config_values.server + elapsed_time = 0 + + while elapsed_time < timeout: + items = list_items(api_key, dataset_id, team_slug, base_url) + if not items: + return + if all(item["processing_status"] != "processing" for item in items): + break + print(f"Waiting {sleep_duration} seconds for items to finish processing...") + time.sleep(sleep_duration) + elapsed_time += sleep_duration + + if elapsed_time >= timeout: + raise TimeoutError( + f"Processing items took longer than the specified timeout of {timeout} seconds." + ) + + +def normalize_expected_annotation( + annotation: Dict[str, Any] +) -> Tuple[Dict[str, Any], Dict[str, Any], List[Dict[str, Any]]]: + """ + Returns a single read-in Darwin JSON 2.0 annotation into a structure for comparison + with other annotations, rounding coordinates to the 3rd decimal place where applicable. + + This is necessary because the `/annotations` endpoint only records coordinates to the + 3rd decimal place. If we don't round to 3dp, assertions comparing annotations will fail + + If sub-annotations or properties are present, these are also returned + """ + + def round_coordinates(data: Any) -> Any: + if isinstance(data, dict): + for key, value in data.items(): + data[key] = round_coordinates(value) + elif isinstance(data, list): + for i in range(len(data)): + data[i] = round_coordinates(data[i]) + elif isinstance(data, (int, float)): + data = round(data, 3) + return data + + # Check for subtypes + subtypes = {} + if "instance_id" in annotation: + subtypes["instance_id"] = annotation["instance_id"] + if "text" in annotation: + subtypes["text"] = annotation["text"] + if "attributes" in annotation: + subtypes["attributes"] = annotation["attributes"] + if "directional_vector" in annotation: + subtypes["directional_vector"] = round_coordinates( + annotation["directional_vector"] + ) + + # Check for properties + annotation_properties = [] + if "properties" in annotation: + annotation_properties = sorted( + annotation["properties"], key=lambda x: (x["name"], x["value"]) + ) + + # Check for main type + if "polygon" in annotation: + annotation = { + "polygon": {"paths": round_coordinates(annotation["polygon"]["paths"])} + } + if "bounding_box" in annotation: + annotation = {"bounding_box": round_coordinates(annotation["bounding_box"])} + if "ellipse" in annotation: + annotation = {"ellipse": round_coordinates(annotation["ellipse"])} + if "keypoint" in annotation: + annotation = {"keypoint": round_coordinates(annotation["keypoint"])} + if "skeleton" in annotation: + annotation = {"skeleton": round_coordinates(annotation["skeleton"])} + if "line" in annotation: + annotation = {"line": round_coordinates(annotation["line"])} + if "tag" in annotation: + annotation = {"tag": annotation["tag"]} + if "mask" in annotation: + annotation = {"mask": annotation["mask"]} + if "raster_layer" in annotation: + annotation = { + "dense_rle": annotation["raster_layer"]["dense_rle"], + "total_pixels": annotation["raster_layer"]["total_pixels"], + } + return annotation, subtypes, annotation_properties + + +def normalize_actual_annotation( + annotation: Dict[str, Any], properties: Dict[str, List] +) -> Tuple[Dict[str, Any], Dict[str, Any], List[Dict[str, Any]]]: + """ + Converts a single annotation into a structure for comparison with other annotations, + rounding coordinates to the 3rd decimal place where applicable. + + This is necessary because the `/annotations` endpoint only records coordinates to the + 3rd decimal place. If we don't round to 3dp, assertions comparing annotations will fail + + If sub-annotations or properties are present, these are also returned + """ + + def round_coordinates(data: Any) -> Any: + if isinstance(data, dict): + for key, value in data.items(): + data[key] = round_coordinates(value) + elif isinstance(data, list): + for i in range(len(data)): + data[i] = round_coordinates(data[i]) + elif isinstance(data, (int, float)): + data = round(data, 3) + return data + + annotation_data = annotation["data"] + + # Check for subtypes + subtypes = {} + if "instance_id" in annotation_data: + subtypes["instance_id"] = annotation_data["instance_id"] + if "text" in annotation_data: + subtypes["text"] = annotation_data["text"] + if "attributes" in annotation_data: + subtypes["attributes"] = annotation_data["attributes"] + if "directional_vector" in annotation_data: + subtypes["directional_vector"] = round_coordinates( + annotation_data["directional_vector"] + ) + + # Check for properties + annotation_properties = [] + if "properties" in annotation: + for frame_index, props in annotation["properties"].items(): + for property_id, property_value_ids in props.items(): + team_prop = next( + ( + prop + for prop in properties["properties"] + if property_id == prop["id"] + ) + ) + property_name = team_prop["name"] + for property_value_id in property_value_ids: + property_value = next( + prop_val["value"] + for prop_val in team_prop["property_values"] + if property_value_id == prop_val["id"] + ) + annotation_properties.append( + { + "frame_index": int(frame_index), + "name": property_name, + "value": property_value, + } + ) + + if "polygon" in annotation_data: + # The `/annotations` endpoint reports polygon paths in `path` + # This must be converted to `paths` for consistency with exports + if "path" in annotation_data["polygon"]: + annotation_data = { + "polygon": { + "paths": round_coordinates([annotation_data["polygon"]["path"]]) + } + } + annotation_data = { + "polygon": {"paths": round_coordinates(annotation_data["polygon"]["paths"])} + } + if "bounding_box" in annotation_data: + annotation_data = { + "bounding_box": round_coordinates(annotation_data["bounding_box"]) + } + if "ellipse" in annotation_data: + annotation_data = {"ellipse": round_coordinates(annotation_data["ellipse"])} + if "keypoint" in annotation_data: + annotation_data = {"keypoint": round_coordinates(annotation_data["keypoint"])} + if "skeleton" in annotation_data: + annotation_data = {"skeleton": round_coordinates(annotation_data["skeleton"])} + if "line" in annotation_data: + annotation_data = {"line": round_coordinates(annotation_data["line"])} + if "tag" in annotation_data: + annotation_data = {"tag": annotation_data["tag"]} + if "mask" in annotation_data: + annotation_data = {"mask": annotation_data["mask"]} + if "raster_layer" in annotation_data: + annotation_data = { + "dense_rle": annotation_data["raster_layer"]["dense_rle"], + "total_pixels": annotation_data["raster_layer"]["total_pixels"], + } + return ( + annotation_data, + subtypes, + sorted(annotation_properties, key=lambda x: (x["name"], x["value"])), + ) + + +@pytest.fixture +def new_dataset() -> E2EDataset: + """Create a new dataset via darwin cli and return the dataset object, complete with teardown""" + uuid_str = str(uuid.uuid4()) + new_dataset_name = "test_dataset_" + uuid_str + result = run_cli_command(f"darwin dataset create {new_dataset_name}") + assert_cli(result, 0) + id_raw = re.findall(r"datasets[/\\+](\d+)", result.stdout) + assert id_raw is not None and len(id_raw) == 1 + id = int(id_raw[0]) + teardown_dataset = E2EDataset(id, new_dataset_name, None) + pytest.datasets.append(teardown_dataset) # type: ignore + return teardown_dataset + + +@pytest.fixture +def local_dataset(new_dataset: E2EDataset) -> Generator[E2EDataset, None, None]: + with tempfile.TemporaryDirectory() as temp_directory: + new_dataset.directory = temp_directory + yield new_dataset diff --git a/e2e_tests/objects.py b/e2e_tests/objects.py index 24c48f29c..a10c978c6 100644 --- a/e2e_tests/objects.py +++ b/e2e_tests/objects.py @@ -1,9 +1,11 @@ from collections import namedtuple from dataclasses import dataclass -from typing import List, Literal, Optional +from typing import List, Literal, Optional, Tuple, Dict from uuid import UUID from darwin.datatypes import JSONType +import requests +import json ConfigValues = namedtuple("ConfigValues", ["server", "api_key", "team_slug"]) @@ -53,6 +55,153 @@ def __init__( def add_item(self, item: E2EItem) -> None: self.items.append(item) + def register_read_only_items(self, config_values: ConfigValues) -> None: + """ + Registers a set of images from an external bucket in the dataset in a read-only fashion: + + Useful for creating dataset to test `pull` or `import` operations on without having to wait for items to finish processing + """ + api_key = config_values.api_key + payload = { + "items": [ + { + "path": "/", + "type": "image", + "storage_key": "darwin-py/images/image_1.jpg", + "storage_thumbnail_key": "darwin-py/images/image_1_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_1", + }, + { + "path": "/", + "type": "image", + "storage_key": "darwin-py/images/image_2.jpg", + "storage_thumbnail_key": "darwin-py/images/image_2_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_2", + }, + { + "path": "dir1", + "type": "image", + "storage_key": "darwin-py/images/image_3.jpg", + "storage_thumbnail_key": "darwin-py/images/image_3_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_3", + }, + { + "path": "dir1", + "type": "image", + "storage_key": "darwin-py/images/image_4.jpg", + "storage_thumbnail_key": "darwin-py/images/image_4_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_4", + }, + { + "path": "dir2", + "type": "image", + "storage_key": "darwin-py/images/image_5.jpg", + "storage_thumbnail_key": "darwin-py/images/image_5_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_5", + }, + { + "path": "dir2", + "type": "image", + "storage_key": "darwin-py/images/image_6.jpg", + "storage_thumbnail_key": "darwin-py/images/image_6_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_6", + }, + { + "path": "dir1/dir3", + "type": "image", + "storage_key": "darwin-py/images/image_7.jpg", + "storage_thumbnail_key": "darwin-py/images/image_7_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_7", + }, + { + "path": "dir1/dir3", + "type": "image", + "storage_key": "darwin-py/images/image_8.jpg", + "storage_thumbnail_key": "darwin-py/images/image_8_thumbnail.jpg", + "height": 1080, + "width": 1920, + "name": "image_8", + }, + ], + "dataset_slug": self.slug, + "storage_slug": "darwin-e2e-data", + } + headers = { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": f"ApiKey {api_key}", + } + response = requests.post( + f"{config_values.server}/api/v2/teams/{config_values.team_slug}/items/register_existing_readonly", + headers=headers, + json=payload, + ) + response.raise_for_status() + for item in json.loads(response.text)["items"]: + self.add_item( + E2EItem( + name=item["name"], + id=item["id"], + path=item["path"], + file_name=item["name"], + slot_name=item["slots"][0]["file_name"], + annotations=[], + ) + ) + + def get_annotation_data( + self, config_values: ConfigValues + ) -> Tuple[Dict[str, List], Dict[str, List], Dict[str, List]]: + """ + Returns the state of the following: + - 1: The annotations present on each item in the dataset + - 2: The annotation classes present in the team + - 3: The properties & property values present in the team + """ + # 1: Get state of annotations for each item + headers = { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": f"ApiKey {config_values.api_key}", + } + item_annotations = {} + for item in self.items: + response = requests.get( + f"{config_values.server}/api/v2/teams/{config_values.team_slug}/items/{item.id}/annotations", + headers=headers, + ) + item_annotations[item.name] = json.loads(response.text) + + # 2: Get state of annotation classes + response = requests.get( + f"{config_values.server}/api/teams/{config_values.team_slug}/annotation_classes", + headers=headers, + ) + annotation_classes = json.loads(response.text) + + # 3: Get state of properties + response = requests.get( + f"{config_values.server}/api/v2/teams/{config_values.team_slug}/properties?include_values=true", + headers=headers, + ) + properties = json.loads(response.text) + + return item_annotations, annotation_classes, properties + @dataclass class E2ETestRunInfo: diff --git a/e2e_tests/setup_tests.py b/e2e_tests/setup_tests.py index b454c5149..fd45d6f11 100644 --- a/e2e_tests/setup_tests.py +++ b/e2e_tests/setup_tests.py @@ -3,7 +3,7 @@ import string from pathlib import Path from tempfile import TemporaryDirectory -from typing import List, Literal, Optional +from typing import List, Literal, Optional, Dict import numpy as np import pytest @@ -49,6 +49,62 @@ def api_call( return response +def get_available_annotation_subtypes(annotation_type: str) -> List[str]: + """ + Returns a list of possible subtypes including the main type for a given annotation class type + """ + annotation_class_subtypes = { + "bounding_box": [ + "bounding_box", + "text", + "attributes", + "instance_id", + "directional_vector", + ], + "ellipse": ["ellipse", "text", "attributes", "instance_id"], + "keypoint": ["keypoint", "text", "attributes", "instance_id"], + "line": ["line", "text", "attributes", "instance_id"], + "mask": ["mask", "text", "attributes"], + "polygon": [ + "polygon", + "text", + "attributes", + "instance_id", + "directional_vector", + ], + "skeleton": ["skeleton", "text", "attributes", "instance_id"], + "tag": ["tag", "text", "attributes"], + } + return annotation_class_subtypes[annotation_type] + + +def add_properties_to_class( + annotation_class_info: Dict[str, str], config: ConfigValues +) -> None: + """ + Adds a single-select & a mulit-select property to the given class, each with two values + """ + url = f"{config.server}/api/v2/teams/{config.team_slug}/properties" + + headers = { + "accept": "application/json", + "content-type": "application/json", + "Authorization": f"ApiKey {config.api_key}", + } + for property_type in ["single_select", "multi_select"]: + payload = { + "required": False, + "type": property_type, + "name": f"{property_type}-1", + "property_values": [ + {"type": "string", "value": "1", "color": "auto"}, + {"type": "string", "value": "2", "color": "auto"}, + ], + "annotation_class_id": annotation_class_info["id"], + } + requests.post(url, json=payload, headers=headers) + + def generate_random_string( length: int = 6, alphabet: str = (string.ascii_lowercase + string.digits) ) -> str: @@ -119,6 +175,8 @@ def create_annotation_class( annotation_type: str, config: ConfigValues, fixed_name: bool = False, + subtypes: bool = False, + properties: bool = False, ) -> E2EAnnotationClass: """ Create a randomised new annotation class, and return its minimal info for reference @@ -129,7 +187,12 @@ def create_annotation_class( The name of the annotation class annotation_type : str The type of the annotation class - + fixed_name : bool + Whether or not to include a random string in the class name + subtypes : bool + Whether or not to enable all possible sub-annotation types for the class + properties : bool + Whether ot not to add single & multi-select properties to the class with some values Returns ------- E2EAnnotationClass @@ -141,19 +204,35 @@ def create_annotation_class( name = f"{name}_{generate_random_string(4)}_annotation_class" host, api_key = config.server, config.api_key url = f"{host}/api/teams/{team_slug}/annotation_classes" + annotation_types = ( + get_available_annotation_subtypes(annotation_type) + if subtypes + else [annotation_type] + ) + metadata = {"_color": "auto"} + if annotation_type == "skeleton": + metadata["skeleton"] = { # type: ignore + "edges": [{"from": "2", "to": "node"}], + "nodes": [ + {"name": "node", "x": 0.5, "y": 0.5}, + {"name": "2", "x": 0.1, "y": 0.1}, + ], + } response = api_call( "post", url, { "name": name, - "annotation_types": [annotation_type], - "metadata": {"_color": "auto"}, + "annotation_types": annotation_types, + "metadata": metadata, }, api_key, ) if response.ok: annotation_class_info = response.json() + if properties: + add_properties_to_class(annotation_class_info, config) return E2EAnnotationClass( id=annotation_class_info["id"], name=annotation_class_info["name"], @@ -376,17 +455,38 @@ def setup_annotation_classes(config: ConfigValues) -> List[E2EAnnotationClass]: annotation_classes: List[E2EAnnotationClass] = [] print("Setting up annotation classes") - set_types = [("bb", "bounding_box"), ("poly", "polygon"), ("ellipse", "ellipse")] + annotation_class_types = [ + "bounding_box", + "polygon", + "ellipse", + "keypoint", + "line", + "mask", + "skeleton", + "tag", + ] try: - for annotation_type, annotation_type_name in set_types: + for annotation_class_type in annotation_class_types: + try: + basic_annotation_class = create_annotation_class( + f"test_{annotation_class_type}_basic", + annotation_class_type, + config, + fixed_name=True, + ) + annotation_classes.append(basic_annotation_class) + except DataAlreadyExists: + pass try: - annotation_class = create_annotation_class( - f"test_{annotation_type}", - annotation_type_name, + annotation_class_with_subtypes_and_properties = create_annotation_class( + f"test_{annotation_class_type}_with_subtypes_and_properties", + annotation_class_type, config, fixed_name=True, + subtypes=True, + properties=True, ) - annotation_classes.append(annotation_class) + annotation_classes.append(annotation_class_with_subtypes_and_properties) except DataAlreadyExists: pass except E2EException as e: @@ -530,5 +630,7 @@ def teardown_annotation_classes( ) all_annotations = response.json()["annotation_classes"] for annotation_class in all_annotations: - if annotation_class["name"].startswith("test_"): + if annotation_class["name"].startswith("test_") or annotation_class[ + "name" + ].startswith("new_"): delete_annotation_class(annotation_class["id"], config) diff --git a/e2e_tests/test_darwin.py b/e2e_tests/test_darwin.py index b2ec66dfd..4731dc860 100644 --- a/e2e_tests/test_darwin.py +++ b/e2e_tests/test_darwin.py @@ -1,6 +1,5 @@ import json import os -import re import tempfile import uuid from pathlib import Path @@ -8,30 +7,15 @@ import pytest -from e2e_tests.helpers import assert_cli, run_cli_command +from e2e_tests.helpers import assert_cli, run_cli_command, new_dataset # noqa: F401 from e2e_tests.objects import ConfigValues, E2EDataset, E2EItem from e2e_tests.setup_tests import api_call, create_random_image @pytest.fixture -def new_dataset() -> E2EDataset: - """Create a new dataset via darwin cli and return the dataset object, complete with teardown""" - uuid_str = str(uuid.uuid4()) - new_dataset_name = "test_dataset_" + uuid_str - result = run_cli_command(f"darwin dataset create {new_dataset_name}") - assert_cli(result, 0) - id_raw = re.findall(r"datasets[/\\+](\d+)", result.stdout) - assert id_raw is not None and len(id_raw) == 1 - id = int(id_raw[0]) - teardown_dataset = E2EDataset(id, new_dataset_name, None) - - # Add the teardown dataset to the pytest object to ensure it gets deleted when pytest is done - pytest.datasets.append(teardown_dataset) # type: ignore - return teardown_dataset - - -@pytest.fixture -def local_dataset(new_dataset: E2EDataset) -> Generator[E2EDataset, None, None]: +def local_dataset( + new_dataset: E2EDataset, # noqa: F811 +) -> Generator[E2EDataset, None, None]: with tempfile.TemporaryDirectory() as temp_directory: new_dataset.directory = temp_directory yield new_dataset