diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e9014a..25301862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - SDK section in docs () - An env variable to enable or disable host certificate checking in CLI () +- REST API tests with skeletons () ### Changed - `api/docs`, `api/swagger`, `api/schema` endpoints now allow unauthorized access () @@ -25,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 non-ascii paths while adding files from "Connected file share" (issue #4428) - Removed unnecessary volumes defined in docker-compose.serverless.yml () -- Project import with skeletons (, +- Project import/export with skeletons (, ) ### Security diff --git a/tests/python/rest_api/test_jobs.py b/tests/python/rest_api/test_jobs.py index 508b245c..880feba7 100644 --- a/tests/python/rest_api/test_jobs.py +++ b/tests/python/rest_api/test_jobs.py @@ -241,7 +241,7 @@ class TestPatchJobAnnotations: users = find_users(role=role, org=org) jobs = jobs_by_org[org] filtered_jobs = filter_jobs_with_shapes(jobs) - username, jid = find_job_staff_user(filtered_jobs, users, job_staff) + username, jid = find_job_staff_user(filtered_jobs, users, job_staff, [18]) data = request_data(jid) self._check_respone(username, jid, expect_success, data, org=org) @@ -255,7 +255,7 @@ class TestPatchJobAnnotations: users = find_users(privilege=privilege, exclude_org=org) jobs = jobs_by_org[org] filtered_jobs = filter_jobs_with_shapes(jobs) - username, jid = find_job_staff_user(filtered_jobs, users, False) + username, jid = find_job_staff_user(filtered_jobs, users, False, [18]) data = request_data(jid) self._check_respone(username, jid, expect_success, data, org=org) diff --git a/tests/python/rest_api/test_projects.py b/tests/python/rest_api/test_projects.py index ab260295..dfce180a 100644 --- a/tests/python/rest_api/test_projects.py +++ b/tests/python/rest_api/test_projects.py @@ -349,16 +349,91 @@ class TestImportExportDatasetProject: self._test_import_project(admin_user, project_id, 'CVAT 1.1', import_data) + def test_can_export_and_import_dataset_with_skeletons_coco_keypoints(self, admin_user): + project_id = 5 + + response = self._test_export_project(admin_user, project_id, 'COCO Keypoints 1.0') + + tmp_file = io.BytesIO(response.data) + tmp_file.name = 'dataset.zip' + import_data = { + 'dataset_file': tmp_file, + } + + self._test_import_project(admin_user, project_id, 'COCO Keypoints 1.0', import_data) + + def test_can_export_and_import_dataset_with_skeletons_cvat_for_images(self, admin_user): + project_id = 5 + + response = self._test_export_project(admin_user, project_id, 'CVAT for images 1.1') + + tmp_file = io.BytesIO(response.data) + tmp_file.name = 'dataset.zip' + import_data = { + 'dataset_file': tmp_file, + } + + self._test_import_project(admin_user, project_id, 'CVAT 1.1', import_data) + + def test_can_export_and_import_dataset_with_skeletons_cvat_for_video(self, admin_user): + project_id = 5 + + response = self._test_export_project(admin_user, project_id, 'CVAT for video 1.1') + + tmp_file = io.BytesIO(response.data) + tmp_file.name = 'dataset.zip' + import_data = { + 'dataset_file': tmp_file, + } + + self._test_import_project(admin_user, project_id, 'CVAT 1.1', import_data) + + def _test_can_get_project_backup(self, username, pid, **kwargs): + for _ in range(30): + response = get_method(username, f"projects/{pid}/backup", **kwargs) + response.raise_for_status() + if response.status_code == HTTPStatus.CREATED: + break + sleep(1) + response = get_method(username, f"projects/{pid}/backup", action="download", **kwargs) + assert response.status_code == HTTPStatus.OK + return response + + def test_admin_can_get_project_backup_and_create_project_by_backup(self, admin_user): + project_id = 5 + response = self._test_can_get_project_backup(admin_user, project_id) + + tmp_file = io.BytesIO(response.content) + tmp_file.name = 'dataset.zip' + + import_data = { + 'project_file': tmp_file, + } + + with make_api_client(admin_user) as api_client: + (_, response) = api_client.projects_api.create_backup( + backup_write_request=deepcopy(import_data), + _content_type="multipart/form-data") + assert response.status == HTTPStatus.ACCEPTED + @pytest.mark.usefixtures('changedb') class TestPatchProjectLabel: def test_admin_can_delete_label(self, projects): - project = deepcopy(list(projects)[0]) + project = deepcopy(list(projects)[1]) labels = project['labels'][0] labels.update({'deleted': True}) response = patch_method('admin1', f'/projects/{project["id"]}', {'labels': [labels]}) assert response.status_code == HTTPStatus.OK assert len(response.json()['labels']) == len(project['labels']) - 1 + def test_admin_can_delete_skeleton_label(self, projects): + project = deepcopy(list(projects)[0]) + labels = project['labels'][0] + labels.update({'deleted': True}) + response = patch_method('admin1', f'/projects/{project["id"]}', {'labels': [labels]}) + assert response.status_code == HTTPStatus.OK + assert len(response.json()['labels']) == len(project['labels']) - 4 + def test_admin_can_rename_label(self, projects): project = deepcopy(list(projects)[0]) labels = project['labels'][0] diff --git a/tests/python/rest_api/test_tasks.py b/tests/python/rest_api/test_tasks.py index 9ce80a14..4f017e18 100644 --- a/tests/python/rest_api/test_tasks.py +++ b/tests/python/rest_api/test_tasks.py @@ -157,6 +157,77 @@ class TestPostTasks: users = find_users(org=org['id'], role=role) self._test_users_to_create_task_in_project(project_id, users, is_staff, is_allow, is_project_staff, org=org['slug']) + def test_can_create_task_with_skeleton(self): + username = "admin1" + + spec = { + "name": f'test admin1 to create a task with skeleton', + "labels": [ + { + "name": "s1", + "color": "#5c5eba", + "attributes": [ + { + "name": "color", + "mutable": False, + "input_type": "select", + "default_value": "white", + "values": [ + "white", + "black" + ] + } + ], + "type": "skeleton", + "sublabels": [ + { + "name": "1", + "color": "#d53957", + "attributes": [ + { + "id": 23, + "name": "attr", + "mutable": False, + "input_type": "select", + "default_value": "val1", + "values": [ + "val1", + "val2" + ] + } + ], + "type": "points" + }, + { + "name": "2", + "color": "#4925ec", + "attributes": [], + "type": "points" + }, + { + "name": "3", + "color": "#59a8fe", + "attributes": [], + "type": "points" + } + ], + "svg": "" \ + "" \ + "" \ + "" \ + "" + } + ] + } + + self._test_create_task_201(username, spec) + + @pytest.mark.usefixtures('dontchangedb') class TestGetData: _USERNAME = 'user1' @@ -226,7 +297,7 @@ class TestPatchTaskAnnotations: find_task_staff_user, find_users, tasks_by_org, request_data): users = find_users(role=role, org=org) tasks = tasks_by_org[org] - username, tid = find_task_staff_user(tasks, users, task_staff) + username, tid = find_task_staff_user(tasks, users, task_staff, [14]) data = request_data(tid) with make_api_client(username) as api_client: diff --git a/tests/python/sdk/test_jobs.py b/tests/python/sdk/test_jobs.py index 42923683..4b009333 100644 --- a/tests/python/sdk/test_jobs.py +++ b/tests/python/sdk/test_jobs.py @@ -105,7 +105,8 @@ class TestJobUsecases: task_id = fxt_new_task.id path = str(self.tmp_path / f"task_{task_id}-cvat.zip") - job = self.client.jobs.retrieve(task_id) + job_id = fxt_new_task.get_jobs()[0].id + job = self.client.jobs.retrieve(job_id) job.export_dataset( format_name="CVAT for images 1.1", filename=path, diff --git a/tests/python/shared/assets/annotations.json b/tests/python/shared/assets/annotations.json index 837f107f..36df0104 100644 --- a/tests/python/shared/assets/annotations.json +++ b/tests/python/shared/assets/annotations.json @@ -364,6 +364,293 @@ "tags": [], "tracks": [], "version": 0 + }, + "18": { + "shapes": [ + { + "attributes": [ + { + "spec_id": 2, + "value": "white" + } + ], + "elements": [ + { + "attributes": [ + { + "spec_id": 3, + "value": "val1" + } + ], + "frame": 0, + "group": 0, + "id": 39, + "label_id": 25, + "occluded": false, + "outside": false, + "points": [ + 259.91862203681984, + 67.8260869565238 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 40, + "label_id": 26, + "occluded": false, + "outside": false, + "points": [ + 283.65217391304554, + 276.52173913043686 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 37, + "label_id": 23, + "occluded": false, + "outside": false, + "points": [ + 135.8260869565238, + 118.10276296228554 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 38, + "label_id": 24, + "occluded": false, + "outside": false, + "points": [ + 172.10450871201368, + 274.6245183225243 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + } + ], + "frame": 0, + "group": 0, + "id": 36, + "label_id": 22, + "occluded": false, + "outside": false, + "points": [], + "rotation": 0.0, + "source": "manual", + "type": "skeleton", + "z_order": 0 + } + ], + "tags": [], + "tracks": [ + { + "attributes": [ + { + "spec_id": 2, + "value": "white" + } + ], + "elements": [ + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 2, + "label_id": 23, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 2, + "occluded": false, + "outside": false, + "points": [ + 381.9130434782637, + 355.0592829431864 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 6, + "occluded": false, + "outside": false, + "points": [ + 137.0966796875, + 156.11214469590232 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 3, + "label_id": 24, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 3, + "occluded": false, + "outside": false, + "points": [ + 461.9389738212561, + 583.320176176868 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 7, + "occluded": false, + "outside": false, + "points": [ + 217.12261003049207, + 384.3730379295848 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + }, + { + "attributes": [ + { + "spec_id": 3, + "value": "val1" + } + ], + "frame": 0, + "group": 0, + "id": 4, + "label_id": 25, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 4, + "occluded": false, + "outside": false, + "points": [ + 655.6465767436227, + 281.7391304347839 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 8, + "occluded": false, + "outside": false, + "points": [ + 410.83021295285835, + 82.7919921875 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 5, + "label_id": 26, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 5, + "occluded": false, + "outside": false, + "points": [ + 708.000000000003, + 586.0869565217404 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 9, + "occluded": false, + "outside": false, + "points": [ + 463.1836362092399, + 387.13981827445605 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + } + ], + "frame": 0, + "group": 0, + "id": 1, + "label_id": 22, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 1, + "occluded": false, + "outside": false, + "points": [], + "rotation": 0.0, + "type": "skeleton", + "z_order": 0 + } + ], + "source": "manual" + } + ], + "version": 0 } }, "task": { @@ -719,6 +1006,293 @@ "tags": [], "tracks": [], "version": 0 + }, + "14": { + "shapes": [ + { + "attributes": [ + { + "spec_id": 2, + "value": "white" + } + ], + "elements": [ + { + "attributes": [ + { + "spec_id": 3, + "value": "val1" + } + ], + "frame": 0, + "group": 0, + "id": 39, + "label_id": 25, + "occluded": false, + "outside": false, + "points": [ + 259.91862203681984, + 67.8260869565238 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 40, + "label_id": 26, + "occluded": false, + "outside": false, + "points": [ + 283.65217391304554, + 276.52173913043686 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 37, + "label_id": 23, + "occluded": false, + "outside": false, + "points": [ + 135.8260869565238, + 118.10276296228554 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 38, + "label_id": 24, + "occluded": false, + "outside": false, + "points": [ + 172.10450871201368, + 274.6245183225243 + ], + "rotation": 0.0, + "source": "manual", + "type": "points", + "z_order": 0 + } + ], + "frame": 0, + "group": 0, + "id": 36, + "label_id": 22, + "occluded": false, + "outside": false, + "points": [], + "rotation": 0.0, + "source": "manual", + "type": "skeleton", + "z_order": 0 + } + ], + "tags": [], + "tracks": [ + { + "attributes": [ + { + "spec_id": 2, + "value": "white" + } + ], + "elements": [ + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 2, + "label_id": 23, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 2, + "occluded": false, + "outside": false, + "points": [ + 381.9130434782637, + 355.0592829431864 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 6, + "occluded": false, + "outside": false, + "points": [ + 137.0966796875, + 156.11214469590232 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 3, + "label_id": 24, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 3, + "occluded": false, + "outside": false, + "points": [ + 461.9389738212561, + 583.320176176868 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 7, + "occluded": false, + "outside": false, + "points": [ + 217.12261003049207, + 384.3730379295848 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + }, + { + "attributes": [ + { + "spec_id": 3, + "value": "val1" + } + ], + "frame": 0, + "group": 0, + "id": 4, + "label_id": 25, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 4, + "occluded": false, + "outside": false, + "points": [ + 655.6465767436227, + 281.7391304347839 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 8, + "occluded": false, + "outside": false, + "points": [ + 410.83021295285835, + 82.7919921875 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + }, + { + "attributes": [], + "frame": 0, + "group": 0, + "id": 5, + "label_id": 26, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 5, + "occluded": false, + "outside": false, + "points": [ + 708.000000000003, + 586.0869565217404 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + }, + { + "attributes": [], + "frame": 3, + "id": 9, + "occluded": false, + "outside": false, + "points": [ + 463.1836362092399, + 387.13981827445605 + ], + "rotation": 0.0, + "type": "points", + "z_order": 0 + } + ], + "source": "manual" + } + ], + "frame": 0, + "group": 0, + "id": 1, + "label_id": 22, + "shapes": [ + { + "attributes": [], + "frame": 0, + "id": 1, + "occluded": false, + "outside": false, + "points": [], + "rotation": 0.0, + "type": "skeleton", + "z_order": 0 + } + ], + "source": "manual" + } + ], + "version": 0 } } } \ No newline at end of file diff --git a/tests/python/shared/assets/cvat_db/cvat_data.tar.bz2 b/tests/python/shared/assets/cvat_db/cvat_data.tar.bz2 index 57363779..d28c66e0 100644 Binary files a/tests/python/shared/assets/cvat_db/cvat_data.tar.bz2 and b/tests/python/shared/assets/cvat_db/cvat_data.tar.bz2 differ diff --git a/tests/python/shared/assets/cvat_db/data.json b/tests/python/shared/assets/cvat_db/data.json index 635db39f..49ca0424 100644 --- a/tests/python/shared/assets/cvat_db/data.json +++ b/tests/python/shared/assets/cvat_db/data.json @@ -36,7 +36,7 @@ "pk": 1, "fields": { "password": "pbkdf2_sha256$260000$DevmxlmLwciP1P6sZs2Qag$U9DFtjTWx96Sk95qY6UXVcvpdQEP2LcoFBftk5D2RKY=", - "last_login": "2022-07-19T14:27:42.006Z", + "last_login": "2022-09-22T14:21:28.429Z", "is_superuser": true, "username": "admin1", "first_name": "Admin", @@ -487,6 +487,14 @@ "expire_date": "2022-06-22T08:32:30.157Z" } }, +{ + "model": "sessions.session", + "pk": "g7a60a11wtv3gyf63z38yo9dynrriy2o", + "fields": { + "session_data": ".eJxVjMEOwiAQRP-FsyG7oSB49O43kF22SNVAUtqT8d9tkx70Mod5b-atIq1LiWsf5ziJuihUp9-OKT3HugN5UL03nVpd5on1ruiDdn1rMr6uh_t3UKiXbZ1BbEggBBCyMwSC6PEsgBzYoM0pgHUAnvwQjOFsrDM-DVsIA7H6fAHNgTcq:1obN4y:bkeYqNAs8mjLT_JEXhoEQ5K5wMW1KiEr72ahxoqc1SA", + "expire_date": "2022-10-06T14:21:28.474Z" + } +}, { "model": "sessions.session", "pk": "gcz795933839j3g0t3rjgmikzkzlwse3", @@ -1065,6 +1073,25 @@ "deleted_frames": "[]" } }, +{ + "model": "engine.data", + "pk": 13, + "fields": { + "chunk_size": 72, + "size": 8, + "image_quality": 70, + "start_frame": 0, + "stop_frame": 7, + "frame_filter": "", + "compressed_chunk_type": "imageset", + "original_chunk_type": "imageset", + "storage_method": "cache", + "storage": "local", + "cloud_storage": null, + "sorting_method": "lexicographical", + "deleted_frames": "[]" + } +}, { "model": "engine.video", "pk": 1, @@ -2010,6 +2037,94 @@ "height": 483 } }, +{ + "model": "engine.image", + "pk": 433, + "fields": { + "data": 13, + "path": "1.png", + "frame": 0, + "width": 783, + "height": 760 + } +}, +{ + "model": "engine.image", + "pk": 434, + "fields": { + "data": 13, + "path": "2.png", + "frame": 1, + "width": 528, + "height": 458 + } +}, +{ + "model": "engine.image", + "pk": 435, + "fields": { + "data": 13, + "path": "3.png", + "frame": 2, + "width": 520, + "height": 350 + } +}, +{ + "model": "engine.image", + "pk": 436, + "fields": { + "data": 13, + "path": "4.png", + "frame": 3, + "width": 569, + "height": 483 + } +}, +{ + "model": "engine.image", + "pk": 437, + "fields": { + "data": 13, + "path": "5.png", + "frame": 4, + "width": 514, + "height": 935 + } +}, +{ + "model": "engine.image", + "pk": 438, + "fields": { + "data": 13, + "path": "6.png", + "frame": 5, + "width": 502, + "height": 705 + } +}, +{ + "model": "engine.image", + "pk": 439, + "fields": { + "data": 13, + "path": "7.png", + "frame": 6, + "width": 541, + "height": 825 + } +}, +{ + "model": "engine.image", + "pk": 440, + "fields": { + "data": 13, + "path": "8.png", + "frame": 7, + "width": 883, + "height": 208 + } +}, { "model": "engine.project", "pk": 1, @@ -2088,6 +2203,24 @@ "target_storage": null } }, +{ + "model": "engine.project", + "pk": 5, + "fields": { + "name": "project5", + "owner": [ + "admin1" + ], + "assignee": null, + "bug_tracker": "", + "created_date": "2022-09-22T14:21:53.791Z", + "updated_date": "2022-09-23T11:57:02.088Z", + "status": "annotation", + "organization": 2, + "source_storage": 5, + "target_storage": 6 + } +}, { "model": "engine.task", "pk": 2, @@ -2325,6 +2458,31 @@ "target_storage": null } }, +{ + "model": "engine.task", + "pk": 14, + "fields": { + "project": 5, + "name": "task1 in project5", + "mode": "annotation", + "owner": [ + "admin1" + ], + "assignee": null, + "bug_tracker": "", + "created_date": "2022-09-22T14:22:25.820Z", + "updated_date": "2022-09-23T11:57:02.300Z", + "overlap": 0, + "segment_size": 8, + "status": "annotation", + "data": 13, + "dimension": "2d", + "subset": "", + "organization": 2, + "source_storage": 7, + "target_storage": 8 + } +}, { "model": "engine.clientfile", "pk": 131, @@ -3013,6 +3171,70 @@ "file": "/home/django/data/data/12/raw/2.png" } }, +{ + "model": "engine.clientfile", + "pk": 434, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/6.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 435, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/4.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 436, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/7.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 437, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/1.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 438, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/3.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 439, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/8.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 440, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/5.png" + } +}, +{ + "model": "engine.clientfile", + "pk": 441, + "fields": { + "data": 13, + "file": "/home/django/data/data/13/raw/2.png" + } +}, { "model": "engine.relatedfile", "pk": 1, @@ -3121,6 +3343,15 @@ "stop_frame": 4 } }, +{ + "model": "engine.segment", + "pk": 18, + "fields": { + "task": 14, + "start_frame": 0, + "stop_frame": 7 + } +}, { "model": "engine.job", "pk": 2, @@ -3263,6 +3494,18 @@ "state": "in progress" } }, +{ + "model": "engine.job", + "pk": 18, + "fields": { + "segment": 18, + "assignee": null, + "updated_date": "2022-09-23T11:57:02.302Z", + "status": "annotation", + "stage": "annotation", + "state": "in progress" + } +}, { "model": "engine.label", "pk": 3, @@ -3270,7 +3513,9 @@ "task": 2, "project": null, "name": "car", - "color": "#2080c0" + "color": "#2080c0", + "type": "any", + "parent": null } }, { @@ -3280,7 +3525,9 @@ "task": 2, "project": null, "name": "person", - "color": "#c06060" + "color": "#c06060", + "type": "any", + "parent": null } }, { @@ -3290,7 +3537,9 @@ "task": null, "project": 1, "name": "car", - "color": "#2080c0" + "color": "#2080c0", + "type": "any", + "parent": null } }, { @@ -3300,7 +3549,9 @@ "task": null, "project": 1, "name": "person", - "color": "#c06060" + "color": "#c06060", + "type": "any", + "parent": null } }, { @@ -3310,7 +3561,9 @@ "task": null, "project": 2, "name": "cat", - "color": "#6080c0" + "color": "#6080c0", + "type": "any", + "parent": null } }, { @@ -3320,7 +3573,9 @@ "task": null, "project": 2, "name": "dog", - "color": "#406040" + "color": "#406040", + "type": "any", + "parent": null } }, { @@ -3330,7 +3585,9 @@ "task": 5, "project": null, "name": "car", - "color": "#2080c0" + "color": "#2080c0", + "type": "any", + "parent": null } }, { @@ -3340,7 +3597,9 @@ "task": 6, "project": null, "name": "car", - "color": "#2080c0" + "color": "#2080c0", + "type": "any", + "parent": null } }, { @@ -3350,7 +3609,9 @@ "task": 7, "project": null, "name": "cat", - "color": "#6080c0" + "color": "#6080c0", + "type": "any", + "parent": null } }, { @@ -3360,7 +3621,9 @@ "task": 7, "project": null, "name": "dog", - "color": "#406040" + "color": "#406040", + "type": "any", + "parent": null } }, { @@ -3370,7 +3633,9 @@ "task": 8, "project": null, "name": "cat", - "color": "#6080c0" + "color": "#6080c0", + "type": "any", + "parent": null } }, { @@ -3380,7 +3645,9 @@ "task": 8, "project": null, "name": "dog", - "color": "#406040" + "color": "#406040", + "type": "any", + "parent": null } }, { @@ -3390,7 +3657,9 @@ "task": 12, "project": null, "name": "Car", - "color": "#2080c0" + "color": "#2080c0", + "type": "any", + "parent": null } }, { @@ -3400,7 +3669,9 @@ "task": null, "project": 4, "name": "cat", - "color": "#6080c0" + "color": "#6080c0", + "type": "any", + "parent": null } }, { @@ -3410,94 +3681,244 @@ "task": null, "project": 4, "name": "dog", - "color": "#406040" + "color": "#406040", + "type": "any", + "parent": null } }, { - "model": "engine.attributespec", - "pk": 1, + "model": "engine.label", + "pk": 18, "fields": { - "label": 5, - "name": "model", - "mutable": false, - "input_type": "select", - "default_value": "mazda", - "values": "mazda\nvolvo\nbmw" + "task": null, + "project": 5, + "name": "s1", + "color": "#5c5eba", + "type": "skeleton", + "parent": null } }, { - "model": "engine.jobcommit", - "pk": 1, + "model": "engine.label", + "pk": 19, "fields": { - "scope": "", - "owner": null, - "timestamp": "2021-12-22T07:14:15.237Z", - "data": {}, - "job": 2 + "task": null, + "project": 5, + "name": "1", + "color": "#d12345", + "type": "points", + "parent": 18 } }, { - "model": "engine.jobcommit", - "pk": 2, + "model": "engine.label", + "pk": 20, "fields": { - "scope": "", - "owner": null, - "timestamp": "2021-12-22T07:14:15.268Z", - "data": {}, - "job": 2 + "task": null, + "project": 5, + "name": "2", + "color": "#350dea", + "type": "points", + "parent": 18 } }, { - "model": "engine.jobcommit", - "pk": 3, + "model": "engine.label", + "pk": 21, "fields": { - "scope": "", - "owner": null, - "timestamp": "2021-12-22T07:14:15.298Z", - "data": {}, - "job": 2 + "task": null, + "project": 5, + "name": "3", + "color": "#479ffe", + "type": "points", + "parent": 18 } }, { - "model": "engine.jobcommit", - "pk": 16, + "model": "engine.label", + "pk": 22, "fields": { - "scope": "", - "owner": null, - "timestamp": "2022-02-21T10:32:04.068Z", - "data": {}, - "job": 9 + "task": null, + "project": 5, + "name": "s2", + "color": "#0c81b5", + "type": "skeleton", + "parent": null } }, { - "model": "engine.jobcommit", - "pk": 17, + "model": "engine.label", + "pk": 23, "fields": { - "scope": "", - "owner": null, - "timestamp": "2022-02-21T10:32:04.169Z", - "data": {}, - "job": 9 + "task": null, + "project": 5, + "name": "1", + "color": "#d53957", + "type": "points", + "parent": 22 } }, { - "model": "engine.jobcommit", - "pk": 18, + "model": "engine.label", + "pk": 24, "fields": { - "scope": "", - "owner": null, - "timestamp": "2022-02-21T10:32:04.256Z", - "data": {}, - "job": 9 + "task": null, + "project": 5, + "name": "2", + "color": "#4925ec", + "type": "points", + "parent": 22 } }, { - "model": "engine.jobcommit", + "model": "engine.label", "pk": 25, "fields": { - "scope": "", - "owner": null, - "timestamp": "2022-02-21T10:40:21.267Z", + "task": null, + "project": 5, + "name": "3", + "color": "#59a8fe", + "type": "points", + "parent": 22 + } +}, +{ + "model": "engine.label", + "pk": 26, + "fields": { + "task": null, + "project": 5, + "name": "4", + "color": "#4a649f", + "type": "points", + "parent": 22 + } +}, +{ + "model": "engine.skeleton", + "pk": 1, + "fields": { + "root": 18, + "svg": "" + } +}, +{ + "model": "engine.skeleton", + "pk": 2, + "fields": { + "root": 22, + "svg": "" + } +}, +{ + "model": "engine.attributespec", + "pk": 1, + "fields": { + "label": 5, + "name": "model", + "mutable": false, + "input_type": "select", + "default_value": "mazda", + "values": "mazda\nvolvo\nbmw" + } +}, +{ + "model": "engine.attributespec", + "pk": 2, + "fields": { + "label": 22, + "name": "color", + "mutable": false, + "input_type": "select", + "default_value": "white", + "values": "white\nblack" + } +}, +{ + "model": "engine.attributespec", + "pk": 3, + "fields": { + "label": 25, + "name": "attr", + "mutable": false, + "input_type": "select", + "default_value": "val1", + "values": "val1\nval2" + } +}, +{ + "model": "engine.jobcommit", + "pk": 1, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2021-12-22T07:14:15.237Z", + "data": {}, + "job": 2 + } +}, +{ + "model": "engine.jobcommit", + "pk": 2, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2021-12-22T07:14:15.268Z", + "data": {}, + "job": 2 + } +}, +{ + "model": "engine.jobcommit", + "pk": 3, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2021-12-22T07:14:15.298Z", + "data": {}, + "job": 2 + } +}, +{ + "model": "engine.jobcommit", + "pk": 16, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2022-02-21T10:32:04.068Z", + "data": {}, + "job": 9 + } +}, +{ + "model": "engine.jobcommit", + "pk": 17, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2022-02-21T10:32:04.169Z", + "data": {}, + "job": 9 + } +}, +{ + "model": "engine.jobcommit", + "pk": 18, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2022-02-21T10:32:04.256Z", + "data": {}, + "job": 9 + } +}, +{ + "model": "engine.jobcommit", + "pk": 25, + "fields": { + "scope": "", + "owner": null, + "timestamp": "2022-02-21T10:40:21.267Z", "data": {}, "job": 7 } @@ -4095,6 +4516,106 @@ "job": 17 } }, +{ + "model": "engine.jobcommit", + "pk": 67, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-09-22T14:22:26.222Z", + "data": { + "stage": "annotation", + "state": "new", + "assignee": null + }, + "job": 18 + } +}, +{ + "model": "engine.jobcommit", + "pk": 68, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-09-23T11:56:30.270Z", + "data": { + "stage": "annotation", + "state": "new", + "assignee": null + }, + "job": 18 + } +}, +{ + "model": "engine.jobcommit", + "pk": 69, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-09-23T11:56:30.533Z", + "data": { + "stage": "annotation", + "state": "in progress", + "assignee": null + }, + "job": 18 + } +}, +{ + "model": "engine.jobcommit", + "pk": 70, + "fields": { + "scope": "update", + "owner": [ + "admin1" + ], + "timestamp": "2022-09-23T11:56:30.535Z", + "data": { + "state": "in progress" + }, + "job": 18 + } +}, +{ + "model": "engine.jobcommit", + "pk": 71, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-09-23T11:56:45.344Z", + "data": { + "stage": "annotation", + "state": "in progress", + "assignee": null + }, + "job": 18 + } +}, +{ + "model": "engine.jobcommit", + "pk": 72, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-09-23T11:57:02.307Z", + "data": { + "stage": "annotation", + "state": "in progress", + "assignee": null + }, + "job": 18 + } +}, { "model": "engine.labeledshape", "pk": 1, @@ -4106,9 +4627,11 @@ "source": "manual", "type": "rectangle", "occluded": false, + "outside": false, "z_order": 0, "points": "[223.39453125, 226.0751953125, 513.7663269042969, 377.9619903564453]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4122,9 +4645,11 @@ "source": "manual", "type": "polygon", "occluded": false, + "outside": false, "z_order": 0, "points": "[63.0791015625, 139.75390625, 132.19337349397574, 112.3867469879533, 189.71144578313397, 159.23614457831354, 191.1030120481937, 246.9048192771097, 86.73554216867524, 335.5012048192784, 32.00060240964012, 250.15180722891637]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4138,9 +4663,11 @@ "source": "manual", "type": "polygon", "occluded": false, + "outside": false, "z_order": 0, "points": "[83.0244140625, 216.75390625, 112.24759036144678, 162.48313253012202, 167.44638554216908, 183.35662650602535, 149.35602409638705, 252.0072289156633, 84.41626506024113, 292.8265060240974, 72.81987951807241, 258.9650602409638]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4154,9 +4681,11 @@ "source": "manual", "type": "polyline", "occluded": false, + "outside": false, "z_order": 0, "points": "[24.443359375, 107.2275390625, 84.91109877913368, 61.125083240844106, 169.4316315205324, 75.1561598224198, 226.5581576026634, 113.90865704772477, 240.5892341842391, 205.77880133185317, 210.52264150943483, 270.9230854605994]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4170,9 +4699,11 @@ "source": "manual", "type": "points", "occluded": false, + "outside": false, "z_order": 0, "points": "[148.94921875, 285.6865234375, 313.515094339622, 400.32830188679145, 217.36415094339463, 585.2339622641503, 64.81698113207494, 499.25283018867776]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4186,9 +4717,11 @@ "source": "manual", "type": "polygon", "occluded": false, + "outside": false, "z_order": 0, "points": "[448.3779296875, 356.4892578125, 438.2558352402775, 761.3861556064112, 744.1780320366161, 319.37356979405195, 446.1288329519466, 163.03832951945333]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4202,9 +4735,11 @@ "source": "manual", "type": "polygon", "occluded": false, + "outside": false, "z_order": 0, "points": "[364.0361328125, 528.87890625, 609.5286041189956, 586.544622425632, 835.2494279176244, 360.0000000000018, 543.6247139588122, 175.4691075514893, 326.9656750572103, 192.76887871853796, 244.58581235698148, 319.63386727689067]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4218,9 +4753,11 @@ "source": "manual", "type": "polygon", "occluded": false, + "outside": false, "z_order": 0, "points": "[440.0439453125, 84.0791015625, 71.83311938382576, 249.81514762516053, 380.4441591784325, 526.585365853658, 677.6251604621302, 260.42875481386363, 629.4557124518615, 127.35044929396645]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4234,9 +4771,11 @@ "source": "manual", "type": "rectangle", "occluded": false, + "outside": false, "z_order": 0, "points": "[65.6189987163034, 100.96585365853753, 142.12734274711147, 362.6243902439037]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4250,9 +4789,11 @@ "source": "manual", "type": "polyline", "occluded": false, + "outside": false, "z_order": 0, "points": "[100.14453125, 246.03515625, 408.8692551505537, 327.5483359746413, 588.5839936608554, 289.0380348652925, 623.8851030110927, 183.77654516640177, 329.2812995245622, 71.45483359746322]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4266,9 +4807,11 @@ "source": "manual", "type": "rectangle", "occluded": false, + "outside": false, "z_order": 0, "points": "[106.36066411239153, 85.1515964240134, 240.08352490421748, 241.26526181354166]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null } }, { @@ -4282,9 +4825,323 @@ "source": "manual", "type": "rectangle", "occluded": false, + "outside": false, "z_order": 0, "points": "[414.29522752496996, 124.8035516093205, 522.2641509433943, 286.75693673695605]", - "rotation": 0.0 + "rotation": 0.0, + "parent": null + } +}, +{ + "model": "engine.labeledshape", + "pk": 36, + "fields": { + "job": 18, + "label": 22, + "frame": 0, + "group": 0, + "source": "manual", + "type": "skeleton", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[]", + "rotation": 0.0, + "parent": null + } +}, +{ + "model": "engine.labeledshape", + "pk": 37, + "fields": { + "job": 18, + "label": 23, + "frame": 0, + "group": 0, + "source": "manual", + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[135.8260869565238, 118.10276296228554]", + "rotation": 0.0, + "parent": 36 + } +}, +{ + "model": "engine.labeledshape", + "pk": 38, + "fields": { + "job": 18, + "label": 24, + "frame": 0, + "group": 0, + "source": "manual", + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[172.10450871201368, 274.6245183225243]", + "rotation": 0.0, + "parent": 36 + } +}, +{ + "model": "engine.labeledshape", + "pk": 39, + "fields": { + "job": 18, + "label": 25, + "frame": 0, + "group": 0, + "source": "manual", + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[259.91862203681984, 67.8260869565238]", + "rotation": 0.0, + "parent": 36 + } +}, +{ + "model": "engine.labeledshape", + "pk": 40, + "fields": { + "job": 18, + "label": 26, + "frame": 0, + "group": 0, + "source": "manual", + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[283.65217391304554, 276.52173913043686]", + "rotation": 0.0, + "parent": 36 + } +}, +{ + "model": "engine.labeledshapeattributeval", + "pk": 1, + "fields": { + "spec": 2, + "value": "white", + "shape": 36 + } +}, +{ + "model": "engine.labeledshapeattributeval", + "pk": 2, + "fields": { + "spec": 3, + "value": "val1", + "shape": 39 + } +}, +{ + "model": "engine.labeledtrack", + "pk": 1, + "fields": { + "job": 18, + "label": 22, + "frame": 0, + "group": 0, + "source": "manual", + "parent": null + } +}, +{ + "model": "engine.labeledtrack", + "pk": 2, + "fields": { + "job": 18, + "label": 23, + "frame": 0, + "group": 0, + "source": "manual", + "parent": 1 + } +}, +{ + "model": "engine.labeledtrack", + "pk": 3, + "fields": { + "job": 18, + "label": 24, + "frame": 0, + "group": 0, + "source": "manual", + "parent": 1 + } +}, +{ + "model": "engine.labeledtrack", + "pk": 4, + "fields": { + "job": 18, + "label": 25, + "frame": 0, + "group": 0, + "source": "manual", + "parent": 1 + } +}, +{ + "model": "engine.labeledtrack", + "pk": 5, + "fields": { + "job": 18, + "label": 26, + "frame": 0, + "group": 0, + "source": "manual", + "parent": 1 + } +}, +{ + "model": "engine.labeledtrackattributeval", + "pk": 3, + "fields": { + "spec": 2, + "value": "white", + "track": 1 + } +}, +{ + "model": "engine.labeledtrackattributeval", + "pk": 4, + "fields": { + "spec": 3, + "value": "val1", + "track": 4 + } +}, +{ + "model": "engine.trackedshape", + "pk": 1, + "fields": { + "type": "skeleton", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[]", + "rotation": 0.0, + "track": 1, + "frame": 0 + } +}, +{ + "model": "engine.trackedshape", + "pk": 2, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[381.9130434782637, 355.0592829431864]", + "rotation": 0.0, + "track": 2, + "frame": 0 + } +}, +{ + "model": "engine.trackedshape", + "pk": 3, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[461.9389738212561, 583.320176176868]", + "rotation": 0.0, + "track": 3, + "frame": 0 + } +}, +{ + "model": "engine.trackedshape", + "pk": 4, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[655.6465767436227, 281.7391304347839]", + "rotation": 0.0, + "track": 4, + "frame": 0 + } +}, +{ + "model": "engine.trackedshape", + "pk": 5, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[708.000000000003, 586.0869565217404]", + "rotation": 0.0, + "track": 5, + "frame": 0 + } +}, +{ + "model": "engine.trackedshape", + "pk": 6, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[137.0966796875, 156.11214469590232]", + "rotation": 0.0, + "track": 2, + "frame": 3 + } +}, +{ + "model": "engine.trackedshape", + "pk": 7, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[217.12261003049207, 384.3730379295848]", + "rotation": 0.0, + "track": 3, + "frame": 3 + } +}, +{ + "model": "engine.trackedshape", + "pk": 8, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[410.83021295285835, 82.7919921875]", + "rotation": 0.0, + "track": 4, + "frame": 3 + } +}, +{ + "model": "engine.trackedshape", + "pk": 9, + "fields": { + "type": "points", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[463.1836362092399, 387.13981827445605]", + "rotation": 0.0, + "track": 5, + "frame": 3 } }, { @@ -4758,6 +5615,38 @@ "cloud_storage_id": 2 } }, +{ + "model": "engine.storage", + "pk": 5, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, +{ + "model": "engine.storage", + "pk": 6, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, +{ + "model": "engine.storage", + "pk": 7, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, +{ + "model": "engine.storage", + "pk": 8, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, { "model": "admin.logentry", "pk": 1, diff --git a/tests/python/shared/assets/jobs.json b/tests/python/shared/assets/jobs.json index bbe10473..6155e897 100644 --- a/tests/python/shared/assets/jobs.json +++ b/tests/python/shared/assets/jobs.json @@ -1,8 +1,205 @@ { - "count": 11, + "count": 12, "next": null, "previous": null, "results": [ + { + "assignee": null, + "bug_tracker": "", + "data_chunk_size": 72, + "data_compressed_chunk_type": "imageset", + "dimension": "2d", + "id": 18, + "labels": [ + { + "attributes": [], + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "sublabels": [], + "type": "points" + }, + { + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", + "has_parent": true, + "id": 25, + "name": "3", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#d53957", + "has_parent": true, + "id": 23, + "name": "1", + "sublabels": [], + "type": "points" + }, + { + "attributes": [ + { + "default_value": "white", + "id": 2, + "input_type": "select", + "mutable": false, + "name": "color", + "values": [ + "white", + "black" + ] + } + ], + "color": "#0c81b5", + "has_parent": false, + "id": 22, + "name": "s2", + "sublabels": [ + { + "attributes": [], + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "type": "points" + }, + { + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", + "has_parent": true, + "id": 25, + "name": "3", + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#d53957", + "has_parent": true, + "id": 23, + "name": "1", + "type": "points" + } + ], + "svg": "", + "type": "skeleton" + }, + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#5c5eba", + "has_parent": false, + "id": 18, + "name": "s1", + "sublabels": [ + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "type": "points" + } + ], + "svg": "", + "type": "skeleton" + } + ], + "mode": "annotation", + "project_id": 5, + "stage": "annotation", + "start_frame": 0, + "state": "in progress", + "status": "annotation", + "stop_frame": 7, + "task_id": 14, + "updated_date": "2022-09-23T11:57:02.302000Z", + "url": "http://localhost:8080/api/jobs/18" + }, { "assignee": null, "bug_tracker": "", diff --git a/tests/python/shared/assets/projects.json b/tests/python/shared/assets/projects.json index a97b3c02..f464aba8 100644 --- a/tests/python/shared/assets/projects.json +++ b/tests/python/shared/assets/projects.json @@ -1,8 +1,220 @@ { - "count": 4, + "count": 5, "next": null, "previous": null, "results": [ + { + "assignee": null, + "bug_tracker": "", + "created_date": "2022-09-22T14:21:53.791000Z", + "dimension": "2d", + "id": 5, + "labels": [ + { + "attributes": [], + "color": "#5c5eba", + "has_parent": false, + "id": 18, + "name": "s1", + "sublabels": [ + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "type": "points" + } + ], + "svg": "", + "type": "skeleton" + }, + { + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "sublabels": [], + "type": "points" + }, + { + "attributes": [ + { + "default_value": "white", + "id": 2, + "input_type": "select", + "mutable": false, + "name": "color", + "values": [ + "white", + "black" + ] + } + ], + "color": "#0c81b5", + "has_parent": false, + "id": 22, + "name": "s2", + "sublabels": [ + { + "attributes": [], + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "type": "points" + }, + { + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", + "has_parent": true, + "id": 25, + "name": "3", + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#d53957", + "has_parent": true, + "id": 23, + "name": "1", + "type": "points" + } + ], + "svg": "", + "type": "skeleton" + }, + { + "attributes": [], + "color": "#d53957", + "has_parent": true, + "id": 23, + "name": "1", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", + "sublabels": [], + "type": "points" + }, + { + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", + "has_parent": true, + "id": 25, + "name": "3", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "sublabels": [], + "type": "points" + } + ], + "name": "project5", + "organization": 2, + "owner": { + "first_name": "Admin", + "id": 1, + "last_name": "First", + "url": "http://localhost:8080/api/users/1", + "username": "admin1" + }, + "source_storage": { + "cloud_storage_id": null, + "id": 5, + "location": "local" + }, + "status": "annotation", + "target_storage": { + "cloud_storage_id": null, + "id": 6, + "location": "local" + }, + "task_subsets": [], + "tasks": [ + 14 + ], + "updated_date": "2022-09-23T11:57:02.088000Z", + "url": "http://localhost:8080/api/projects/5" + }, { "assignee": null, "bug_tracker": "", diff --git a/tests/python/shared/assets/tasks.json b/tests/python/shared/assets/tasks.json index d5663e25..57ac63b8 100644 --- a/tests/python/shared/assets/tasks.json +++ b/tests/python/shared/assets/tasks.json @@ -1,8 +1,243 @@ { - "count": 9, + "count": 10, "next": null, "previous": null, "results": [ + { + "assignee": null, + "bug_tracker": "", + "created_date": "2022-09-22T14:22:25.820000Z", + "data": 13, + "data_chunk_size": 72, + "data_compressed_chunk_type": "imageset", + "data_original_chunk_type": "imageset", + "dimension": "2d", + "id": 14, + "image_quality": 70, + "labels": [ + { + "attributes": [], + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "sublabels": [], + "type": "points" + }, + { + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", + "has_parent": true, + "id": 25, + "name": "3", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#d53957", + "has_parent": true, + "id": 23, + "name": "1", + "sublabels": [], + "type": "points" + }, + { + "attributes": [ + { + "default_value": "white", + "id": 2, + "input_type": "select", + "mutable": false, + "name": "color", + "values": [ + "white", + "black" + ] + } + ], + "color": "#0c81b5", + "has_parent": false, + "id": 22, + "name": "s2", + "sublabels": [ + { + "attributes": [], + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "type": "points" + }, + { + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", + "has_parent": true, + "id": 25, + "name": "3", + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#d53957", + "has_parent": true, + "id": 23, + "name": "1", + "type": "points" + } + ], + "svg": "", + "type": "skeleton" + }, + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "sublabels": [], + "type": "points" + }, + { + "attributes": [], + "color": "#5c5eba", + "has_parent": false, + "id": 18, + "name": "s1", + "sublabels": [ + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "type": "points" + } + ], + "svg": "", + "type": "skeleton" + } + ], + "mode": "annotation", + "name": "task1 in project5", + "organization": 2, + "overlap": 0, + "owner": { + "first_name": "Admin", + "id": 1, + "last_name": "First", + "url": "http://localhost:8080/api/users/1", + "username": "admin1" + }, + "project_id": 5, + "segment_size": 8, + "segments": [ + { + "jobs": [ + { + "assignee": null, + "id": 18, + "stage": "annotation", + "state": "in progress", + "status": "annotation", + "url": "http://localhost:8080/api/jobs/18" + } + ], + "start_frame": 0, + "stop_frame": 7 + } + ], + "size": 8, + "source_storage": { + "cloud_storage_id": null, + "id": 7, + "location": "local" + }, + "status": "annotation", + "subset": "", + "target_storage": { + "cloud_storage_id": null, + "id": 8, + "location": "local" + }, + "updated_date": "2022-09-23T11:57:02.300000Z", + "url": "http://localhost:8080/api/tasks/14" + }, { "assignee": null, "bug_tracker": "", diff --git a/tests/python/shared/assets/users.json b/tests/python/shared/assets/users.json index ba514e91..2eded1dd 100644 --- a/tests/python/shared/assets/users.json +++ b/tests/python/shared/assets/users.json @@ -310,7 +310,7 @@ "is_active": true, "is_staff": true, "is_superuser": true, - "last_login": "2022-07-19T14:27:42.006000Z", + "last_login": "2022-09-22T14:21:28.429000Z", "last_name": "First", "url": "http://localhost:8080/api/users/1", "username": "admin1" diff --git a/tests/python/shared/fixtures/data.py b/tests/python/shared/fixtures/data.py index c686b237..b40dc830 100644 --- a/tests/python/shared/fixtures/data.py +++ b/tests/python/shared/fixtures/data.py @@ -237,8 +237,10 @@ def is_org_member(memberships): @pytest.fixture(scope='session') def find_job_staff_user(is_job_staff): - def find(jobs, users, is_staff): + def find(jobs, users, is_staff, wo_jobs=None): for job in jobs: + if wo_jobs is not None and job['id'] in wo_jobs: + continue for user in users: if is_staff == is_job_staff(user['id'], job['id']): return user['username'], job['id'] @@ -247,8 +249,10 @@ def find_job_staff_user(is_job_staff): @pytest.fixture(scope='session') def find_task_staff_user(is_task_staff): - def find(tasks, users, is_staff): + def find(tasks, users, is_staff, wo_tasks=None): for task in tasks: + if wo_tasks is not None and task['id'] in wo_tasks: + continue for user in users: if is_staff == is_task_staff(user['id'], task['id']): return user['username'], task['id']