diff --git a/e2e_tests/cli/test_import.py b/e2e_tests/cli/test_import.py new file mode 100644 index 000000000..79ba83220 --- /dev/null +++ b/e2e_tests/cli/test_import.py @@ -0,0 +1,313 @@ +from pathlib import Path + +from e2e_tests.helpers import ( + assert_cli, + run_cli_command, + export_and_download_annotations, + delete_annotation_uuids, +) +from e2e_tests.objects import E2EDataset, ConfigValues +from darwin.utils.utils import parse_darwin_json +import tempfile +import zipfile +import darwin.datatypes as dt +from typing import List, Dict + + +def get_actual_annotation_filename( + expected_filename: str, actual_annotation_files: Dict[str, str] +) -> str: + """ + For a given expected annotation filename, return the name of the file that + corresponds to the correct actual annotation file + + These should always be the same unless the test involves appending. In these cases, + multiple annotation files have been imported (expected files), but only 1 has been + downloaded (actual files). The expected files cannot be identically named in the + `expected_annotation_files` dictionary, so this function returns the name of the + corresponding actual annotation file + """ + if expected_filename not in actual_annotation_files: + filename_split = expected_filename.split("-") + return filename_split[0] + ".json" + return expected_filename + + +def find_matching_actual_annotation( + expected_annotation: dt.Annotation, actual_annotations: List[dt.Annotation] +): + """ + For a given expected annotation, finds the corresponding actual annotation based on + the `data` field & the annotation class type + """ + expected_annotation_data = expected_annotation.data + expected_annotation_type = expected_annotation.annotation_class.annotation_type + actual_annotation = next( + ( + annotation + for annotation in actual_annotations + if annotation.data == expected_annotation_data + and annotation.annotation_class.annotation_type == expected_annotation_type + ), + None, + ) + assert actual_annotation is not None, "Annotation not found in actual annotations" + return actual_annotation + + +def assert_same_annotation_data( + expected_annotation: dt.Annotation, actual_annotation: dt.Annotation +): + """ + Ensures that `expected_annotation.data` is equivalent to `actual_annotation.data` + """ + assert expected_annotation.data == actual_annotation.data + + +def assert_same_annotation_properties( + expected_annotation: dt.Annotation, actual_annotation: dt.Annotation +): + """ + Ensures that `expected_annotation.properties` is equivalent to `actual_annotation.properties` + """ + if expected_annotation.properties: + expected_properties = expected_annotation.properties + actual_properties = actual_annotation.properties + assert actual_properties is not None + for expected_property in expected_properties: + assert expected_property in actual_properties # type : ignore + + +def compare_annotations_export( + actual_annotations_dir: Path, + expected_annotations_dir: Path, +): + """ + Compares a set of downloaded annotation files with the imported files that resulted + in those annotations. Ensures equality + """ + + with zipfile.ZipFile(actual_annotations_dir / "dataset.zip") as z: + z.extractall(actual_annotations_dir) + + file_prefixes_to_ignore = [".", "metadata.json"] + expected_annotation_files = { + file.name: str(file) + for file in expected_annotations_dir.rglob("*") + if file.is_file() + and not any(file.name.startswith(prefix) for prefix in file_prefixes_to_ignore) + } + actual_annotation_files = { + file.name: str(file) + for file in actual_annotations_dir.rglob("*") + if file.is_file() + and not any(file.name.startswith(prefix) for prefix in file_prefixes_to_ignore) + } + for expected_filename in expected_annotation_files: + actual_filename = get_actual_annotation_filename( + expected_filename, actual_annotation_files + ) + expected_annotations: List[dt.Annotation] = parse_darwin_json( + Path(expected_annotation_files[expected_filename]) + ).annotations # type: ignore + actual_annotations: List[dt.Annotation] = parse_darwin_json( + Path(actual_annotation_files[actual_filename]) + ).annotations # type: ignore + + delete_annotation_uuids(expected_annotations) + delete_annotation_uuids(actual_annotations) + + for expected_annotation in expected_annotations: + actual_annotation = find_matching_actual_annotation( + expected_annotation, actual_annotations + ) + assert_same_annotation_data(actual_annotation, expected_annotation) + assert_same_annotation_properties(expected_annotation, actual_annotation) + + +def test_import_annotations_without_subtypes_to_images( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test importing a set of basic annotations (no sub-types or properties) to a set of + pre-registered files in a dataset. + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" + ) + assert_cli(result, 0) + with tempfile.TemporaryDirectory() as tmp_dir_str: + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) + + +def test_import_annotations_with_subtypes_to_images( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test importing a set of annotations that includes subtypes & properties to a set of + pre-registered files in a dataset. + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_with_subtypes" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" + ) + assert_cli(result, 0) + with tempfile.TemporaryDirectory() as tmp_dir_str: + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) + + +def test_annotation_classes_are_created_on_import( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test that importing non-existent annotation classes creates those classes in the + target Darwin team + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --yes" + ) + assert_cli(result, 0) + with tempfile.TemporaryDirectory() as tmp_dir_str: + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) + + +def test_annotation_classes_are_created_with_properties_on_import( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test that importing non-existent annotation classes with properties creates those + classes and properties in the target Darwin team + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_new_annotations_with_properties" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --yes" + ) + assert_cli(result, 0) + with tempfile.TemporaryDirectory() as tmp_dir_str: + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) + + +def test_appending_annotations( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test that appending annotations to an item with already existing annotations does + not overwrite the original annotations + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_split_in_two_files" + ) + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --append" + ) + assert_cli(result, 0) + with tempfile.TemporaryDirectory() as tmp_dir_str: + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) + + +def test_overwriting_annotations( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test that the `--overwrite` flag allows bypassing of the overwrite warning when + importing to items with already existing annotations + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" + ) + # 1st import to create annotations + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" + ) + assert_cli(result, 0) + # 2nd import to overwrite annotations + result = run_cli_command( + f" darwin dataset import {local_dataset.name} darwin {expected_annotations_dir} --overwrite" + ) + assert_cli(result, 0) + with tempfile.TemporaryDirectory() as tmp_dir_str: + actual_annotations_dir = Path(tmp_dir_str) + export_and_download_annotations( + actual_annotations_dir, local_dataset, config_values + ) + compare_annotations_export(actual_annotations_dir, expected_annotations_dir) + + +def test_annotation_overwrite_warning( + local_dataset: E2EDataset, config_values: ConfigValues +) -> None: + """ + Test that importing annotations to an item with already existing annotations throws + a warning if not using the `--append` or `--overwrite` flags + """ + local_dataset.register_read_only_items(config_values) + expected_annotations_dir = ( + Path(__file__).parents[1] + / "data" + / "import" + / "image_annotations_without_subtypes" + ) + # 1st import to create annotations + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" + ) + assert_cli(result, 0) + # 2nd import to trigger overwrite warning + result = run_cli_command( + f"darwin dataset import {local_dataset.name} darwin {expected_annotations_dir}" + ) + assert "will be overwritten" in result.stdout 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_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..42210df98 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_1-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_1", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-a549-6aa9-ae9f61c95747", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-a549-6aa9-ae9f61c95747" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/469c8a89-0557-42ea-a3a1-04f90d9f6b88/thumbnail", + "source_files": [ + { + "file_name": "image_1", + "storage_key": "darwin-py/images/image_1.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/144dc80d-6bec-4885-b5cb-a174f18000e2" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "5976dca9-ead0-4264-8ece-b6833c77dc4b", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "2f75f5e6-1495-4fb1-b869-01882710d6ed", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "caac6cd7-698a-4821-8141-2f5a78a3022a", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "57d49f01-a072-4fcd-80cb-b14515fd50c7", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..1c75907d6 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_2-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_2", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-f0b7-9d92-ecc504bba55e", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-f0b7-9d92-ecc504bba55e" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/7ac2488d-df4e-42b1-bde2-86cbe22d526c/thumbnail", + "source_files": [ + { + "file_name": "image_2", + "storage_key": "darwin-py/images/image_2.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/3138e283-a72f-4232-be35-0826fcf2ab01" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "109f053c-e2fc-444a-b44f-acfdd8e59567", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "c9445045-0609-4240-9d1b-9079736490a0", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4efbed69-35d6-495e-ba2e-0537f8d257ee", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "3d9a8dc5-e3db-4572-9141-d3d99a713789", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..da4fe6aed --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_3-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_3", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-8c77-0a6f-6c06085e0352", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-8c77-0a6f-6c06085e0352" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/a8205e6b-e940-4bb1-b29d-846e78a89086/thumbnail", + "source_files": [ + { + "file_name": "image_3", + "storage_key": "darwin-py/images/image_3.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/07d711e4-cb84-4848-a188-9b9330ea1038" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "9bb6ac07-d7d4-4b6d-9fec-b3dc0e7f1f2a", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "c0e9781e-1474-45e3-88f3-137c3e00de24", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4bcfc9f4-e181-4558-b2e5-e46034646599", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "011dc8a9-2017-4959-8347-15cd4756f914", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..7d5f589b2 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_4-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_4", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-299c-e0c2-cb73dccf6d4f", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-299c-e0c2-cb73dccf6d4f" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/8f48ba52-eee7-457b-829c-01f4af25f20f/thumbnail", + "source_files": [ + { + "file_name": "image_4", + "storage_key": "darwin-py/images/image_4.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/d127dc20-a63f-492a-912a-f7d875c65251" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "03f7c08e-f80b-409e-a150-f8aa31bb7778", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "38426629-668e-4414-9b18-cd9df589ab82", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4d40d102-ba16-4e2a-bf3b-0ca1b6dede5b", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "3415fb30-7350-4298-8dbe-98ce3d7cccc9", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..568a33245 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_5-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_5", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-c805-c2f1-3368dcbaf9ca", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-c805-c2f1-3368dcbaf9ca" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/196805d6-f0da-447b-8b7b-153d20f2eeff/thumbnail", + "source_files": [ + { + "file_name": "image_5", + "storage_key": "darwin-py/images/image_5.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/6c852f65-79cb-413e-82be-6eefc01c783e" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "11380405-52f0-4162-9560-f030c84c260e", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "0a4317cb-1380-482f-bfd5-c0dea24eea3e", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "7aa8e3f3-8ff0-49e6-a3cf-9609d7921e0a", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "0c56ff38-9da5-49e9-83d2-9e94fc0c2ba7", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..9b6faaac8 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_6-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_6", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-075e-209f-c3f64d2bf0a8", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-075e-209f-c3f64d2bf0a8" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/e677b814-e6c4-4bf7-a5aa-e9883b612392/thumbnail", + "source_files": [ + { + "file_name": "image_6", + "storage_key": "darwin-py/images/image_6.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/77191998-6632-42f8-abe9-75df8304decb" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "d7eab132-5985-4975-8062-123f7cd2f673", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "204b7afe-657d-4876-b31d-d1deab0a603c", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "4f5b5ce6-617d-46d4-9f88-6759b4f06ea8", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "eface510-b298-4d55-951c-2497b3032e2c", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..2f3814db7 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_7-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_7", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-98a3-3ee8-03efea8cff21", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-98a3-3ee8-03efea8cff21" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/39540d73-2de8-4bc8-8690-c1176f6de2e2/thumbnail", + "source_files": [ + { + "file_name": "image_7", + "storage_key": "darwin-py/images/image_7.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/1516bad4-ccd7-40fa-abbc-15a82c851f1f" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "2e4c2d4e-6df6-4a61-a73a-fa28285824d2", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "95843306-4945-4dfa-9fee-cd1134890836", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "bd60d76d-2e84-4a55-b3b3-d5e7756307e5", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "befbdb22-162c-4ac0-aba7-1fdb57e1d32e", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8-keypoint_ellipse_polygon_bbox.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8-keypoint_ellipse_polygon_bbox.json new file mode 100644 index 000000000..175420028 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-keypoint_ellipse_polygon_bbox/image_8-keypoint_ellipse_polygon_bbox.json @@ -0,0 +1,121 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_8", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-3e01-10b9-73f2d06e2ae4", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-3e01-10b9-73f2d06e2ae4" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/52dcfc17-e1ec-45e8-af3a-924ae9764267/thumbnail", + "source_files": [ + { + "file_name": "image_8", + "storage_key": "darwin-py/images/image_8.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/45f8df38-3022-486f-88da-fa3da2c018e0" + } + ] + } + ] + }, + "annotations": [ + { + "bounding_box": { + "h": 72.809, + "w": 91.878, + "x": 18.6838, + "y": 135.2167 + }, + "id": "518596bb-bd5b-4db6-a029-5b2df0aa1fe2", + "name": "test_polygon_basic", + "polygon": { + "paths": [ + [ + { + "x": 86.2921, + "y": 135.2167 + }, + { + "x": 18.6838, + "y": 208.0257 + }, + { + "x": 110.5618, + "y": 208.0257 + }, + { + "x": 23.8844, + "y": 135.2167 + } + ] + ] + }, + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "b9497ec8-235d-43a4-86f7-286a5f9c38d8", + "keypoint": { + "x": 483.2745, + "y": 199.3579 + }, + "name": "test_keypoint_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "ellipse": { + "angle": 0.2004, + "center": { + "x": 214.5746, + "y": 259.1653 + }, + "radius": { + "x": 169.8191, + "y": 169.8191 + } + }, + "id": "ea70d102-57e5-406c-a29d-c324eb0b5fb6", + "name": "test_ellipse_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "bounding_box": { + "h": 38.138, + "w": 67.608, + "x": 36.019, + "y": 50.273 + }, + "id": "17bd44c0-22df-4dd0-a9b2-c8da582e4d1b", + "name": "test_bounding_box_basic", + "properties": [], + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1-tag_skeleton_mask_line.json new file mode 100644 index 000000000..ede4b571d --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_1-tag_skeleton_mask_line.json @@ -0,0 +1,236 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_1", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-a549-6aa9-ae9f61c95747", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-a549-6aa9-ae9f61c95747" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/469c8a89-0557-42ea-a3a1-04f90d9f6b88/thumbnail", + "source_files": [ + { + "file_name": "image_1", + "storage_key": "darwin-py/images/image_1.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/144dc80d-6bec-4885-b5cb-a174f18000e2" + } + ] + } + ] + }, + "annotations": [ + { + "id": "0e222acf-f31e-4391-a88d-19ba5006d76f", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "479a7c0e-c2b2-4ed2-865c-055c78d0ba55", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "8e1bee84-a3a7-43f5-9319-7bc142c3f154", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "01956301-606f-4785-a166-f63ce2721960", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "b5eaaef7-1136-4bc8-9875-5c728f1d7187", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 286374, + 1, + 5, + 0, + 1913, + 1, + 9, + 0, + 1911, + 1, + 9, + 0, + 1910, + 1, + 11, + 0, + 1908, + 1, + 12, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 14, + 0, + 1905, + 1, + 14, + 0, + 1904, + 1, + 16, + 0, + 1902, + 1, + 18, + 0, + 1901, + 1, + 20, + 0, + 1899, + 1, + 21, + 0, + 1899, + 1, + 21, + 0, + 1898, + 1, + 22, + 0, + 1896, + 1, + 23, + 0, + 1895, + 1, + 25, + 0, + 1893, + 1, + 25, + 0, + 1895, + 1, + 23, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 23, + 0, + 1897, + 1, + 23, + 0, + 1897, + 1, + 14, + 0, + 3, + 1, + 4, + 0, + 1899, + 1, + 14, + 0, + 1906, + 1, + 12, + 0, + 1909, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1914, + 1, + 4, + 0, + 1737320 + ], + "mask_annotation_ids_mapping": { + "8e1bee84-a3a7-43f5-9319-7bc142c3f154": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2-tag_skeleton_mask_line.json new file mode 100644 index 000000000..04513a49c --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_2-tag_skeleton_mask_line.json @@ -0,0 +1,216 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_2", + "path": "/", + "source_info": { + "item_id": "01922dc5-646b-f0b7-9d92-ecc504bba55e", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-f0b7-9d92-ecc504bba55e" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/7ac2488d-df4e-42b1-bde2-86cbe22d526c/thumbnail", + "source_files": [ + { + "file_name": "image_2", + "storage_key": "darwin-py/images/image_2.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/3138e283-a72f-4232-be35-0826fcf2ab01" + } + ] + } + ] + }, + "annotations": [ + { + "id": "c6b5d839-6fcc-4415-8191-a6a4a702af66", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "7cf4be26-60a3-466f-8a1f-7029a341b506", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "b479c29b-dbe1-4a86-bd18-ed7011f1cc0a", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "271d85a9-2c7f-436a-b33c-6698a830a518", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "5f67127e-aa76-4550-b1fc-0cf6b6049ca0", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 278739, + 1, + 7, + 0, + 1911, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1908, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 16, + 0, + 1898, + 1, + 25, + 0, + 1893, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1890, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1890, + 1, + 29, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 26, + 0, + 1895, + 1, + 19, + 0, + 1902, + 1, + 18, + 0, + 1903, + 1, + 16, + 0, + 1906, + 1, + 14, + 0, + 1908, + 1, + 10, + 0, + 1912, + 1, + 4, + 0, + 1752619 + ], + "mask_annotation_ids_mapping": { + "b479c29b-dbe1-4a86-bd18-ed7011f1cc0a": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3-tag_skeleton_mask_line.json new file mode 100644 index 000000000..b939b36a3 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_3-tag_skeleton_mask_line.json @@ -0,0 +1,328 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_3", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-8c77-0a6f-6c06085e0352", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-8c77-0a6f-6c06085e0352" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/a8205e6b-e940-4bb1-b29d-846e78a89086/thumbnail", + "source_files": [ + { + "file_name": "image_3", + "storage_key": "darwin-py/images/image_3.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/07d711e4-cb84-4848-a188-9b9330ea1038" + } + ] + } + ] + }, + "annotations": [ + { + "id": "9df469c0-4bc4-41bc-9c7d-3ec38f1cbcdd", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "a6caf48a-0279-4772-afba-6ab2c9a55f35", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "c5fb2e1b-34e8-4354-b5ae-9f76806b89c0", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "a300c6d4-3aa9-4356-b65c-a6177c223276", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "e9a438b5-446f-4ba5-bfa4-5c3db337891b", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 301775, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 11, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 11, + 0, + 10, + 1, + 4, + 0, + 1895, + 1, + 13, + 0, + 6, + 1, + 8, + 0, + 1893, + 1, + 13, + 0, + 1, + 1, + 4, + 0, + 1, + 1, + 8, + 0, + 1894, + 1, + 29, + 0, + 1892, + 1, + 30, + 0, + 1890, + 1, + 30, + 0, + 1891, + 1, + 30, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1892, + 1, + 30, + 0, + 1891, + 1, + 31, + 0, + 1889, + 1, + 31, + 0, + 1890, + 1, + 31, + 0, + 1890, + 1, + 30, + 0, + 1890, + 1, + 30, + 0, + 1891, + 1, + 29, + 0, + 1892, + 1, + 28, + 0, + 1894, + 1, + 26, + 0, + 1897, + 1, + 23, + 0, + 1899, + 1, + 21, + 0, + 1902, + 1, + 17, + 0, + 1905, + 1, + 15, + 0, + 1908, + 1, + 10, + 0, + 1683471 + ], + "mask_annotation_ids_mapping": { + "c5fb2e1b-34e8-4354-b5ae-9f76806b89c0": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4-tag_skeleton_mask_line.json new file mode 100644 index 000000000..b1e21ca65 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_4-tag_skeleton_mask_line.json @@ -0,0 +1,244 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_4", + "path": "/dir1", + "source_info": { + "item_id": "01922dc5-646b-299c-e0c2-cb73dccf6d4f", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646b-299c-e0c2-cb73dccf6d4f" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/8f48ba52-eee7-457b-829c-01f4af25f20f/thumbnail", + "source_files": [ + { + "file_name": "image_4", + "storage_key": "darwin-py/images/image_4.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/d127dc20-a63f-492a-912a-f7d875c65251" + } + ] + } + ] + }, + "annotations": [ + { + "id": "efcd8a54-8986-4ed9-af45-2f63b7a26fbc", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "86d6aae0-cb45-472b-bf2e-624a3cf1fdb8", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "d1b06da1-8b6a-4ec3-9f6f-85d21277fef5", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "3b5f8a89-4be8-46ff-93bf-ea38562b1939", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "b2f3e27a-7802-49a9-9395-60535fedce86", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 345916, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1908, + 1, + 14, + 0, + 1906, + 1, + 16, + 0, + 1904, + 1, + 16, + 0, + 1904, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1903, + 1, + 18, + 0, + 1902, + 1, + 18, + 0, + 1902, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 18, + 0, + 1902, + 1, + 18, + 0, + 1903, + 1, + 8, + 0, + 3, + 1, + 4, + 0, + 1905, + 1, + 8, + 0, + 1914, + 1, + 4, + 0, + 1673922 + ], + "mask_annotation_ids_mapping": { + "d1b06da1-8b6a-4ec3-9f6f-85d21277fef5": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5-tag_skeleton_mask_line.json new file mode 100644 index 000000000..d612dbf98 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_5-tag_skeleton_mask_line.json @@ -0,0 +1,288 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_5", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-c805-c2f1-3368dcbaf9ca", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-c805-c2f1-3368dcbaf9ca" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/196805d6-f0da-447b-8b7b-153d20f2eeff/thumbnail", + "source_files": [ + { + "file_name": "image_5", + "storage_key": "darwin-py/images/image_5.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/6c852f65-79cb-413e-82be-6eefc01c783e" + } + ] + } + ] + }, + "annotations": [ + { + "id": "1faf78c9-c917-4bea-9734-7f5b81bff160", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "9080db8e-08c0-4191-abd6-fab5c26407f8", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "6f315c87-559a-4f03-998b-ef9ad430af42", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "4b7263f6-fe54-45a9-806f-efde911dd969", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "3562dbd6-46b5-4ee9-aa4d-b804c956f321", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 322890, + 1, + 6, + 0, + 1912, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1909, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1906, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1907, + 1, + 12, + 0, + 1908, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 16, + 0, + 1904, + 1, + 18, + 0, + 1902, + 1, + 18, + 0, + 1901, + 1, + 21, + 0, + 1899, + 1, + 23, + 0, + 1897, + 1, + 23, + 0, + 1897, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 24, + 0, + 1896, + 1, + 23, + 0, + 1897, + 1, + 23, + 0, + 1897, + 1, + 21, + 0, + 1899, + 1, + 19, + 0, + 1901, + 1, + 19, + 0, + 1901, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1903, + 1, + 17, + 0, + 1904, + 1, + 15, + 0, + 1905, + 1, + 15, + 0, + 1905, + 1, + 14, + 0, + 1907, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1910, + 1, + 8, + 0, + 1673906 + ], + "mask_annotation_ids_mapping": { + "6f315c87-559a-4f03-998b-ef9ad430af42": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6-tag_skeleton_mask_line.json new file mode 100644 index 000000000..7105d3f08 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_6-tag_skeleton_mask_line.json @@ -0,0 +1,280 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_6", + "path": "/dir2", + "source_info": { + "item_id": "01922dc5-646c-075e-209f-c3f64d2bf0a8", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-075e-209f-c3f64d2bf0a8" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/e677b814-e6c4-4bf7-a5aa-e9883b612392/thumbnail", + "source_files": [ + { + "file_name": "image_6", + "storage_key": "darwin-py/images/image_6.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/77191998-6632-42f8-abe9-75df8304decb" + } + ] + } + ] + }, + "annotations": [ + { + "id": "ca07dc1a-f57e-4005-8f1b-799dd0070588", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "1f02444f-6848-44fa-a5f9-3bb0a910fea7", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "25d75ea3-3748-4ce4-8f09-6419e39aac05", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "866a3fe4-3353-40f2-9e80-64cb999b6187", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "50d4529c-5502-4f97-ad75-ba6c23cd3e1f", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 290243, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1909, + 1, + 11, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 15, + 0, + 1905, + 1, + 15, + 0, + 1906, + 1, + 14, + 0, + 1906, + 1, + 14, + 0, + 1907, + 1, + 13, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1910, + 1, + 9, + 0, + 1912, + 1, + 8, + 0, + 1914, + 1, + 4, + 0, + 1710390 + ], + "mask_annotation_ids_mapping": { + "25d75ea3-3748-4ce4-8f09-6419e39aac05": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7-tag_skeleton_mask_line.json new file mode 100644 index 000000000..3f3dacc62 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_7-tag_skeleton_mask_line.json @@ -0,0 +1,164 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_7", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-98a3-3ee8-03efea8cff21", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-98a3-3ee8-03efea8cff21" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/39540d73-2de8-4bc8-8690-c1176f6de2e2/thumbnail", + "source_files": [ + { + "file_name": "image_7", + "storage_key": "darwin-py/images/image_7.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/1516bad4-ccd7-40fa-abbc-15a82c851f1f" + } + ] + } + ] + }, + "annotations": [ + { + "id": "717b4fc6-eee2-430b-936b-61283c420f63", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "58686ca4-0b55-4333-95da-7f37c1b7c5e7", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "27063070-8cda-4f15-9ffb-763b9b10f628", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "51e4b516-3d38-46fc-8a66-3fca9a875e28", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "50175796-8371-44b3-a338-5d42f96df519", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 253651, + 1, + 5, + 0, + 1913, + 1, + 9, + 0, + 1911, + 1, + 9, + 0, + 1910, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1910, + 1, + 9, + 0, + 1911, + 1, + 9, + 0, + 1913, + 1, + 5, + 0, + 1802664 + ], + "mask_annotation_ids_mapping": { + "27063070-8cda-4f15-9ffb-763b9b10f628": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8-tag_skeleton_mask_line.json b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8-tag_skeleton_mask_line.json new file mode 100644 index 000000000..053b5b58c --- /dev/null +++ b/e2e_tests/data/import/image_annotations_split_in_two_files/annotations-tag_skeleton_mask_line/image_8-tag_skeleton_mask_line.json @@ -0,0 +1,304 @@ +{ + "version": "2.0", + "schema_ref": "https://darwin-public.s3.eu-west-1.amazonaws.com/darwin_json/2.0/schema.json", + "item": { + "name": "image_8", + "path": "/dir1/dir3", + "source_info": { + "item_id": "01922dc5-646c-3e01-10b9-73f2d06e2ae4", + "dataset": { + "name": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "slug": "test_dataset_854fe60f-7f49-43a7-9419-1b1986d42376", + "dataset_management_url": "https://staging.v7labs.com/datasets/357048/dataset-management" + }, + "team": { + "name": "E2E Testing", + "slug": "e2e-testing" + }, + "workview_url": "https://staging.v7labs.com/workview?dataset=357048&item=01922dc5-646c-3e01-10b9-73f2d06e2ae4" + }, + "slots": [ + { + "type": "image", + "slot_name": "0", + "width": 1920, + "height": 1080, + "thumbnail_url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/files/52dcfc17-e1ec-45e8-af3a-924ae9764267/thumbnail", + "source_files": [ + { + "file_name": "image_8", + "storage_key": "darwin-py/images/image_8.jpg", + "url": "https://staging.v7labs.com/api/v2/teams/e2e-testing/uploads/45f8df38-3022-486f-88da-fa3da2c018e0" + } + ] + } + ] + }, + "annotations": [ + { + "id": "1cf95a4b-8437-47a5-8417-04ee06c83d37", + "line": { + "path": [ + { + "x": 136.565, + "y": 353.6437 + }, + { + "x": 107.0947, + "y": 402.183 + }, + { + "x": 169.5024, + "y": 407.3836 + } + ] + }, + "name": "test_line_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "52a18471-fe46-46c9-93d9-2894380333f2", + "name": "test_skeleton_basic", + "properties": [], + "skeleton": { + "nodes": [ + { + "name": "node", + "occluded": false, + "x": 55.0883, + "y": 303.3708 + }, + { + "name": "2", + "occluded": false, + "x": 70.3435, + "y": 275.634 + } + ] + }, + "slot_names": [ + "0" + ] + }, + { + "id": "6b23caf3-7ea6-4ea9-aea9-e57654489845", + "mask": {}, + "name": "test_mask_basic", + "properties": [], + "slot_names": [ + "0" + ] + }, + { + "id": "73396ad0-3ac6-4aef-a90a-94ca857ad6af", + "name": "test_tag_basic", + "properties": [], + "slot_names": [ + "0" + ], + "tag": {} + }, + { + "id": "5eb8b1f3-ae55-43c4-a2d7-a7b510020d14", + "name": "__raster_layer__", + "properties": [], + "raster_layer": { + "dense_rle": [ + 0, + 345921, + 1, + 4, + 0, + 1914, + 1, + 8, + 0, + 1912, + 1, + 8, + 0, + 1911, + 1, + 10, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 11, + 0, + 1909, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1910, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1907, + 1, + 13, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1908, + 1, + 12, + 0, + 1909, + 1, + 10, + 0, + 1910, + 1, + 10, + 0, + 1912, + 1, + 6, + 0, + 1643193 + ], + "mask_annotation_ids_mapping": { + "6b23caf3-7ea6-4ea9-aea9-e57654489845": 1 + }, + "total_pixels": 2073600 + }, + "slot_names": [ + "0" + ] + } + ], + "properties": [] +} \ No newline at end of file diff --git a/e2e_tests/data/import/image_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_annotations_without_subtypes/image_1.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_1.json new file mode 100644 index 000000000..93c615805 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_2.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_2.json new file mode 100644 index 000000000..481e75cbc --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_3.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_3.json new file mode 100644 index 000000000..0099624fc --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_4.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_4.json new file mode 100644 index 000000000..327bbb96f --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_5.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_5.json new file mode 100644 index 000000000..536316bbd --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_6.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_6.json new file mode 100644 index 000000000..25679840b --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_7.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_7.json new file mode 100644 index 000000000..0a91f20d2 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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_annotations_without_subtypes/image_8.json b/e2e_tests/data/import/image_annotations_without_subtypes/image_8.json new file mode 100644 index 000000000..aaa83b842 --- /dev/null +++ b/e2e_tests/data/import/image_annotations_without_subtypes/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..6d0896e86 100644 --- a/e2e_tests/helpers.py +++ b/e2e_tests/helpers.py @@ -1,10 +1,20 @@ from subprocess import run from time import sleep -from typing import Optional +from typing import Optional, List from attr import dataclass - +from pathlib import Path from darwin.exceptions import DarwinException +import datetime +import json +import re +import uuid +import pytest +import requests +import time +from e2e_tests.objects import E2EDataset, ConfigValues +from darwin.dataset.release import Release, ReleaseStatus +import darwin.datatypes as dt @dataclass @@ -19,6 +29,21 @@ class CLIResult: SERVER_WAIT_TIME = 10 +@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 + + def run_cli_command( command: str, working_directory: Optional[str] = None, @@ -48,6 +73,9 @@ def run_cli_command( if yes: command = f"yes Y | {command}" + # Prefix the command with 'poetry run' to ensure it runs in the Poetry shell + command = f"poetry run {command}" + if working_directory: result = run( command, @@ -108,3 +136,134 @@ 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 export_and_download_annotations( + actual_annotations_dir: Path, + local_dataset: E2EDataset, + config_values: ConfigValues, +) -> None: + """ + Creates an export of all items in the given dataset. + Waits for the export to finish, then downloads and the annotation files to + `actual_annotations_dir` + """ + dataset_slug = local_dataset.slug + team_slug = config_values.team_slug + api_key = config_values.api_key + base_url = config_values.server + export_name = "all-files" + create_export_url = ( + f"{base_url}/api/v2/teams/{team_slug}/datasets/{dataset_slug}/exports" + ) + + payload = { + "filters": {"statuses": ["new", "annotate", "review", "complete"]}, + "include_authorship": False, + "include_export_token": False, + "name": f"{export_name}", + } + headers = { + "accept": "application/json", + "content-type": "application/json", + "Authorization": f"ApiKey {api_key}", + } + response = requests.post(create_export_url, json=payload, headers=headers) + list_export_url = ( + f"{base_url}/api/v2/teams/{team_slug}/datasets/{dataset_slug}/exports" + ) + ready = False + while not ready: + sleep(5) + print("Trying to get release...") + response = requests.get(list_export_url, headers=headers) + exports = response.json() + for export in exports: + if export["name"] == export_name and export["status"] == "complete": + export_data = export + ready = True + + release = Release( + dataset_slug=dataset_slug, + team_slug=team_slug, + version=export_data["version"], + name=export_data["name"], + status=ReleaseStatus.COMPLETE, + url=export_data["download_url"], + export_date=datetime.datetime.strptime( + export_data["inserted_at"], "%Y-%m-%dT%H:%M:%SZ" + ), + image_count=export_data["metadata"]["num_images"], + class_count=len(export_data["metadata"]["annotation_classes"]), + available=True, + latest=export_data["latest"], + format=export_data.get("format", "json"), + ) + release.download_zip(actual_annotations_dir / "dataset.zip") + + +def delete_annotation_uuids(annotations: List[dt.Annotation]): + """ + Removes all UUIDs in the `data` field of an `Annotation` object. + + This allows for equality to be asserted with other annotations. + """ + for annotation in annotations: + del annotation.id + if annotation.annotation_class.annotation_type == "raster_layer": + del annotation.data["mask_annotation_ids_mapping"] 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 diff --git a/poetry.lock b/poetry.lock index 2ba1b4dde..4fb0e6474 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,34 +2,33 @@ [[package]] name = "albucore" -version = "0.0.13" +version = "0.0.17" description = "A high-performance image processing library designed to optimize and extend the Albumentations library with specialized functions for advanced image transformations. Perfect for developers working in computer vision who require efficient and scalable image augmentation." optional = true python-versions = ">=3.8" files = [ - {file = "albucore-0.0.13-py3-none-any.whl", hash = "sha256:5a00c931ff80149726b80ad0c4c0a8327048463f14cbdf0ca5ff34a051700a84"}, - {file = "albucore-0.0.13.tar.gz", hash = "sha256:c36d0af878e06f6e97e7882731c5d29243e38c21caec2005ee420fe85db4a7bc"}, + {file = "albucore-0.0.17-py3-none-any.whl", hash = "sha256:751a6d219a0b5217b44168d5fae90c27eadfa5bc381cbb7cc74536e90aeeac5b"}, + {file = "albucore-0.0.17.tar.gz", hash = "sha256:e9956ac4debc47e804f0677ff4e23939ba322986eac16e801f8ea1c98269db65"}, ] [package.dependencies] -numpy = ">=1.24.4,<2" +numpy = ">=1.24" opencv-python-headless = ">=4.9.0.80" -tomli = ">=2.0.1" -typing-extensions = ">=4.9.0" +typing-extensions = {version = ">=4.9.0", markers = "python_version < \"3.10\""} [[package]] name = "albumentations" -version = "1.4.14" +version = "1.4.16" description = "An efficient library for image augmentation, providing extensive transformations to support machine learning and computer vision tasks." optional = true python-versions = ">=3.8" files = [ - {file = "albumentations-1.4.14-py3-none-any.whl", hash = "sha256:a550bc2e182e4092ab9d914febd9c82a75fed88f0152d077fb323216b0b7ed51"}, - {file = "albumentations-1.4.14.tar.gz", hash = "sha256:afc6caeba7eaf3c4e1128b2d9ff4475b03d1833f2f52f47a7e53a07afd5f72cc"}, + {file = "albumentations-1.4.16-py3-none-any.whl", hash = "sha256:a8e90f8d1500e82abf46dfa10f67a8662b335fbc90fccfaeb16a7d30c764b8db"}, + {file = "albumentations-1.4.16.tar.gz", hash = "sha256:d1b959ef0a20552226b7787529a29aab239ba71ef5024974082b1cd01bf424de"}, ] [package.dependencies] -albucore = ">=0.0.13" +albucore = "0.0.17" eval-type-backport = "*" numpy = ">=1.24.4" opencv-python-headless = ">=4.9.0.80" @@ -37,7 +36,7 @@ pydantic = ">=2.7.0" PyYAML = "*" scikit-image = ">=0.21.0" scipy = ">=1.10.0" -typing-extensions = ">=4.9.0" +typing-extensions = {version = ">=4.9.0", markers = "python_version < \"3.10\""} [package.extras] hub = ["huggingface-hub"] diff --git a/tests/e2e_test_internals/test_run_cli_command.py b/tests/e2e_test_internals/test_run_cli_command.py index 9504fc0b4..f4af36a7f 100644 --- a/tests/e2e_test_internals/test_run_cli_command.py +++ b/tests/e2e_test_internals/test_run_cli_command.py @@ -28,7 +28,7 @@ def test_passes_working_directory_to_run_cli_command( run_cli_command("darwin --help", "/usr/bin", server_wait=0) mock_subprocess_run.assert_called_once() - assert mock_subprocess_run.call_args[0][0] == "darwin --help" + assert mock_subprocess_run.call_args[0][0] == "poetry run darwin --help" assert mock_subprocess_run.call_args[1]["cwd"] == "/usr/bin" @@ -60,7 +60,7 @@ def test_does_not_pass_working_directory_to_run_cli_command( run_cli_command("darwin --help", server_wait=0) mock_subprocess_run.assert_called_once() - assert mock_subprocess_run.call_args[0][0] == "darwin --help" + assert mock_subprocess_run.call_args[0][0] == "poetry run darwin --help" assert "cwd" not in mock_subprocess_run.call_args[1]