diff --git a/CHANGELOG.md b/CHANGELOG.md index fa8174d1..def49b26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428) - Fixed FBRS serverless function runtime error on images with alpha channel () - Attaching manifest with custom name () - Uploading non-zip annotaion files () +- Missing source tag in project annotations () ### Security - TDB diff --git a/cvat/apps/dataset_manager/bindings.py b/cvat/apps/dataset_manager/bindings.py index aba8362c..c417a7c0 100644 --- a/cvat/apps/dataset_manager/bindings.py +++ b/cvat/apps/dataset_manager/bindings.py @@ -723,6 +723,9 @@ class TaskData(CommonData): ("height", str(db_task.data.video.height)) ]) + # Add source to dumped file + meta["source"] = str(osp.basename(db_task.data.video.path)) + return meta def _init_meta(self): @@ -731,11 +734,6 @@ class TaskData(CommonData): ("dumped", str(timezone.localtime(timezone.now()))) ]) - if hasattr(self._db_task.data, "video"): - # Add source to dumped file - self._meta["source"] = str( - osp.basename(self._db_task.data.video.path)) - def __len__(self): return self._db_data.size diff --git a/tests/python/rest_api/test_projects.py b/tests/python/rest_api/test_projects.py index 5f5cb486..9c182327 100644 --- a/tests/python/rest_api/test_projects.py +++ b/tests/python/rest_api/test_projects.py @@ -4,8 +4,11 @@ # SPDX-License-Identifier: MIT import io +import xml.etree.ElementTree as ET +import zipfile from copy import deepcopy from http import HTTPStatus +from io import BytesIO from itertools import groupby, product from time import sleep @@ -351,6 +354,22 @@ class TestPostProjects: self._test_create_project_201(user["username"], spec, org_id=user["org"]) +def _check_cvat_for_video_project_annotations_meta(content, values_to_be_checked): + document = ET.fromstring(content) + instance = list(document.find("meta"))[0] + assert instance.tag == "project" + assert instance.find("id").text == values_to_be_checked["pid"] + assert len(list(document.iter("task"))) == len(values_to_be_checked["tasks"]) + tasks = document.iter("task") + for task_checking in values_to_be_checked["tasks"]: + task_meta = next(tasks) + assert task_meta.find("id").text == str(task_checking["id"]) + assert task_meta.find("name").text == task_checking["name"] + assert task_meta.find("size").text == str(task_checking["size"]) + assert task_meta.find("mode").text == task_checking["mode"] + assert task_meta.find("source").text + + @pytest.mark.usefixtures("restore_db_per_function") class TestImportExportDatasetProject: def _test_export_project(self, username, pid, format_name): @@ -359,6 +378,12 @@ class TestImportExportDatasetProject: api_client.projects_api.retrieve_dataset_endpoint, id=pid, format=format_name ) + def _export_annotations(self, username, pid, format_name): + with make_api_client(username) as api_client: + return export_dataset( + api_client.projects_api.retrieve_annotations_endpoint, id=pid, format=format_name + ) + def _test_import_project(self, username, project_id, format_name, data): with make_api_client(username) as api_client: (_, response) = api_client.projects_api.create_dataset( @@ -477,6 +502,50 @@ class TestImportExportDatasetProject: self._test_import_project(username, project_id, format_name, import_data) + @pytest.mark.parametrize("username, pid", [("admin1", 8)]) + @pytest.mark.parametrize( + "anno_format, anno_file_name, check_func", + [ + ( + "CVAT for video 1.1", + "annotations.xml", + _check_cvat_for_video_project_annotations_meta, + ), + ], + ) + def test_exported_project_dataset_structure( + self, + username, + pid, + anno_format, + anno_file_name, + check_func, + tasks, + projects, + annotations, + ): + project = projects[pid] + + values_to_be_checked = { + "pid": str(pid), + "name": project["name"], + "tasks": [ + { + "id": tid, + "name": (task := tasks[tid])["name"], + "size": str(task["size"]), + "mode": task["mode"], + } + for tid in project["tasks"] + ], + } + + response = self._export_annotations(username, pid, anno_format) + assert response.data + with zipfile.ZipFile(BytesIO(response.data)) as zip_file: + content = zip_file.read(anno_file_name) + check_func(content, values_to_be_checked) + @pytest.mark.usefixtures("restore_db_per_function") class TestPatchProjectLabel: diff --git a/tests/python/shared/assets/annotations.json b/tests/python/shared/assets/annotations.json index 80fe0133..f2a7dbe4 100644 --- a/tests/python/shared/assets/annotations.json +++ b/tests/python/shared/assets/annotations.json @@ -714,6 +714,53 @@ } ], "version": 0 + }, + "19": { + "shapes": [ + { + "attributes": [], + "elements": [], + "frame": 0, + "group": 0, + "id": 44, + "label_id": 29, + "occluded": false, + "outside": false, + "points": [ + 479.97322623828586, + 408.0053547523421, + 942.6238286479238, + 513.3868808567604 + ], + "rotation": 0.0, + "source": "manual", + "type": "rectangle", + "z_order": 0 + }, + { + "attributes": [], + "elements": [], + "frame": 0, + "group": 0, + "id": 43, + "label_id": 30, + "occluded": false, + "outside": false, + "points": [ + 120.81927710843593, + 213.52074966532928, + 258.7576974564945, + 643.614457831327 + ], + "rotation": 0.0, + "source": "manual", + "type": "rectangle", + "z_order": 0 + } + ], + "tags": [], + "tracks": [], + "version": 0 } }, "task": { @@ -1418,6 +1465,53 @@ } ], "version": 0 + }, + "15": { + "shapes": [ + { + "attributes": [], + "elements": [], + "frame": 0, + "group": 0, + "id": 44, + "label_id": 29, + "occluded": false, + "outside": false, + "points": [ + 479.97322623828586, + 408.0053547523421, + 942.6238286479238, + 513.3868808567604 + ], + "rotation": 0.0, + "source": "manual", + "type": "rectangle", + "z_order": 0 + }, + { + "attributes": [], + "elements": [], + "frame": 0, + "group": 0, + "id": 43, + "label_id": 30, + "occluded": false, + "outside": false, + "points": [ + 120.81927710843593, + 213.52074966532928, + 258.7576974564945, + 643.614457831327 + ], + "rotation": 0.0, + "source": "manual", + "type": "rectangle", + "z_order": 0 + } + ], + "tags": [], + "tracks": [], + "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 d05fa40c..99db774a 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 3c371804..f6efcec2 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-11-03T13:56:42.744Z", + "last_login": "2022-12-01T12:52:15.631Z", "is_superuser": true, "username": "admin1", "first_name": "Admin", @@ -1146,6 +1146,25 @@ "deleted_frames": "[]" } }, +{ + "model": "engine.data", + "pk": 14, + "fields": { + "chunk_size": 72, + "size": 25, + "image_quality": 70, + "start_frame": 0, + "stop_frame": 24, + "frame_filter": "", + "compressed_chunk_type": "imageset", + "original_chunk_type": "video", + "storage_method": "cache", + "storage": "local", + "cloud_storage": null, + "sorting_method": "lexicographical", + "deleted_frames": "[]" + } +}, { "model": "engine.video", "pk": 1, @@ -1156,6 +1175,16 @@ "height": 720 } }, +{ + "model": "engine.video", + "pk": 2, + "fields": { + "data": 14, + "path": "test_video_1.mp4", + "width": 1280, + "height": 720 + } +}, { "model": "engine.image", "pk": 131, @@ -2315,6 +2344,24 @@ "target_storage": 12 } }, +{ + "model": "engine.project", + "pk": 8, + "fields": { + "name": "project with video data", + "owner": [ + "admin1" + ], + "assignee": null, + "bug_tracker": "", + "created_date": "2022-12-01T12:52:42.454Z", + "updated_date": "2022-12-01T12:53:34.917Z", + "status": "annotation", + "organization": null, + "source_storage": 13, + "target_storage": 14 + } +}, { "model": "engine.task", "pk": 2, @@ -2577,6 +2624,31 @@ "target_storage": 8 } }, +{ + "model": "engine.task", + "pk": 15, + "fields": { + "project": 8, + "name": "task with video data", + "mode": "interpolation", + "owner": [ + "admin1" + ], + "assignee": null, + "bug_tracker": "", + "created_date": "2022-12-01T12:53:10.425Z", + "updated_date": "2022-12-01T12:53:35.028Z", + "overlap": 5, + "segment_size": 25, + "status": "annotation", + "data": 14, + "dimension": "2d", + "subset": "", + "organization": null, + "source_storage": 15, + "target_storage": 16 + } +}, { "model": "engine.clientfile", "pk": 131, @@ -3329,6 +3401,14 @@ "file": "/home/django/data/data/13/raw/2.png" } }, +{ + "model": "engine.clientfile", + "pk": 442, + "fields": { + "data": 14, + "file": "/home/django/data/data/14/raw/test_video_1.mp4" + } +}, { "model": "engine.relatedfile", "pk": 1, @@ -3446,6 +3526,15 @@ "stop_frame": 7 } }, +{ + "model": "engine.segment", + "pk": 19, + "fields": { + "task": 15, + "start_frame": 0, + "stop_frame": 24 + } +}, { "model": "engine.job", "pk": 2, @@ -3600,6 +3689,18 @@ "state": "in progress" } }, +{ + "model": "engine.job", + "pk": 19, + "fields": { + "segment": 19, + "assignee": null, + "updated_date": "2022-12-01T12:53:35.354Z", + "status": "annotation", + "stage": "annotation", + "state": "in progress" + } +}, { "model": "engine.label", "pk": 3, @@ -3912,6 +4013,30 @@ "parent": null } }, +{ + "model": "engine.label", + "pk": 29, + "fields": { + "task": null, + "project": 8, + "name": "car", + "color": "#2080c0", + "type": "any", + "parent": null + } +}, +{ + "model": "engine.label", + "pk": 30, + "fields": { + "task": null, + "project": 8, + "name": "person", + "color": "#c06060", + "type": "any", + "parent": null + } +}, { "model": "engine.skeleton", "pk": 1, @@ -4800,6 +4925,72 @@ "job": 14 } }, +{ + "model": "engine.jobcommit", + "pk": 77, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-12-01T12:53:11.352Z", + "data": { + "stage": "annotation", + "state": "new", + "assignee": null + }, + "job": 19 + } +}, +{ + "model": "engine.jobcommit", + "pk": 78, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-12-01T12:53:35.036Z", + "data": { + "stage": "annotation", + "state": "new", + "assignee": null + }, + "job": 19 + } +}, +{ + "model": "engine.jobcommit", + "pk": 79, + "fields": { + "scope": "create", + "owner": [ + "admin1" + ], + "timestamp": "2022-12-01T12:53:35.360Z", + "data": { + "stage": "annotation", + "state": "in progress", + "assignee": null + }, + "job": 19 + } +}, +{ + "model": "engine.jobcommit", + "pk": 80, + "fields": { + "scope": "update", + "owner": [ + "admin1" + ], + "timestamp": "2022-12-01T12:53:35.363Z", + "data": { + "state": "in progress" + }, + "job": 19 + } +}, { "model": "engine.labeledimage", "pk": 1, @@ -5164,6 +5355,42 @@ "parent": null } }, +{ + "model": "engine.labeledshape", + "pk": 43, + "fields": { + "job": 19, + "label": 30, + "frame": 0, + "group": 0, + "source": "manual", + "type": "rectangle", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[120.81927710843593, 213.52074966532928, 258.7576974564945, 643.614457831327]", + "rotation": 0.0, + "parent": null + } +}, +{ + "model": "engine.labeledshape", + "pk": 44, + "fields": { + "job": 19, + "label": 29, + "frame": 0, + "group": 0, + "source": "manual", + "type": "rectangle", + "occluded": false, + "outside": false, + "z_order": 0, + "points": "[479.97322623828586, 408.0053547523421, 942.6238286479238, 513.3868808567604]", + "rotation": 0.0, + "parent": null + } +}, { "model": "engine.labeledshapeattributeval", "pk": 1, @@ -5930,6 +6157,38 @@ "cloud_storage_id": null } }, +{ + "model": "engine.storage", + "pk": 13, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, +{ + "model": "engine.storage", + "pk": 14, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, +{ + "model": "engine.storage", + "pk": 15, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, +{ + "model": "engine.storage", + "pk": 16, + "fields": { + "location": "local", + "cloud_storage_id": null + } +}, { "model": "webhooks.webhook", "pk": 1, diff --git a/tests/python/shared/assets/jobs.json b/tests/python/shared/assets/jobs.json index 2c65db5f..2df47bfa 100644 --- a/tests/python/shared/assets/jobs.json +++ b/tests/python/shared/assets/jobs.json @@ -1,5 +1,5 @@ { - "count": 12, + "count": 13, "next": null, "previous": null, "results": [ @@ -9,53 +9,105 @@ "data_chunk_size": 72, "data_compressed_chunk_type": "imageset", "dimension": "2d", - "id": 18, + "id": 19, "labels": [ { "attributes": [], - "color": "#4a649f", - "has_parent": true, - "id": 26, - "name": "4", + "color": "#2080c0", + "has_parent": false, + "id": 29, + "name": "car", "sublabels": [], - "type": "points" + "type": "any" }, { - "attributes": [ + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 30, + "name": "person", + "sublabels": [], + "type": "any" + } + ], + "mode": "interpolation", + "project_id": 8, + "stage": "annotation", + "start_frame": 0, + "state": "in progress", + "status": "annotation", + "stop_frame": 24, + "task_id": 15, + "updated_date": "2022-12-01T12:53:35.354431Z", + "url": "http://localhost:8080/api/jobs/19" + }, + { + "assignee": null, + "bug_tracker": "", + "data_chunk_size": 72, + "data_compressed_chunk_type": "imageset", + "dimension": "2d", + "id": 18, + "labels": [ + { + "attributes": [], + "color": "#5c5eba", + "has_parent": false, + "id": 18, + "name": "s1", + "sublabels": [ { - "default_value": "val1", - "id": 3, - "input_type": "select", - "mutable": false, - "name": "attr", - "values": [ - "val1", - "val2" - ] + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "type": "points" } ], - "color": "#59a8fe", + "svg": "", + "type": "skeleton" + }, + { + "attributes": [], + "color": "#d12345", "has_parent": true, - "id": 25, - "name": "3", + "id": 19, + "name": "1", "sublabels": [], "type": "points" }, { "attributes": [], - "color": "#4925ec", + "color": "#350dea", "has_parent": true, - "id": 24, + "id": 20, "name": "2", "sublabels": [], "type": "points" }, { "attributes": [], - "color": "#d53957", + "color": "#479ffe", "has_parent": true, - "id": 23, - "name": "1", + "id": 21, + "name": "3", "sublabels": [], "type": "points" }, @@ -80,10 +132,18 @@ "sublabels": [ { "attributes": [], - "color": "#4a649f", + "color": "#d53957", "has_parent": true, - "id": 26, - "name": "4", + "id": 23, + "name": "1", + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", "type": "points" }, { @@ -108,18 +168,10 @@ }, { "attributes": [], - "color": "#4925ec", - "has_parent": true, - "id": 24, - "name": "2", - "type": "points" - }, - { - "attributes": [], - "color": "#d53957", + "color": "#4a649f", "has_parent": true, - "id": 23, - "name": "1", + "id": 26, + "name": "4", "type": "points" } ], @@ -128,65 +180,51 @@ }, { "attributes": [], - "color": "#479ffe", + "color": "#d53957", "has_parent": true, - "id": 21, - "name": "3", + "id": 23, + "name": "1", "sublabels": [], "type": "points" }, { "attributes": [], - "color": "#350dea", + "color": "#4925ec", "has_parent": true, - "id": 20, + "id": 24, "name": "2", "sublabels": [], "type": "points" }, { - "attributes": [], - "color": "#d12345", + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", "has_parent": true, - "id": 19, - "name": "1", + "id": 25, + "name": "3", "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" + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "sublabels": [], + "type": "points" } ], "mode": "annotation", @@ -210,19 +248,19 @@ "labels": [ { "attributes": [], - "color": "#406040", + "color": "#6080c0", "has_parent": false, - "id": 17, - "name": "dog", + "id": 16, + "name": "cat", "sublabels": [], "type": "any" }, { "attributes": [], - "color": "#6080c0", + "color": "#406040", "has_parent": false, - "id": 16, - "name": "cat", + "id": 17, + "name": "dog", "sublabels": [], "type": "any" } @@ -254,19 +292,19 @@ "labels": [ { "attributes": [], - "color": "#406040", + "color": "#6080c0", "has_parent": false, - "id": 8, - "name": "dog", + "id": 7, + "name": "cat", "sublabels": [], "type": "any" }, { "attributes": [], - "color": "#6080c0", + "color": "#406040", "has_parent": false, - "id": 7, - "name": "cat", + "id": 8, + "name": "dog", "sublabels": [], "type": "any" } @@ -290,15 +328,6 @@ "dimension": "2d", "id": 14, "labels": [ - { - "attributes": [], - "color": "#c06060", - "has_parent": false, - "id": 6, - "name": "person", - "sublabels": [], - "type": "any" - }, { "attributes": [ { @@ -320,6 +349,15 @@ "name": "car", "sublabels": [], "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 6, + "name": "person", + "sublabels": [], + "type": "any" } ], "mode": "annotation", @@ -341,15 +379,6 @@ "dimension": "2d", "id": 13, "labels": [ - { - "attributes": [], - "color": "#c06060", - "has_parent": false, - "id": 6, - "name": "person", - "sublabels": [], - "type": "any" - }, { "attributes": [ { @@ -371,6 +400,15 @@ "name": "car", "sublabels": [], "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 6, + "name": "person", + "sublabels": [], + "type": "any" } ], "mode": "annotation", @@ -392,15 +430,6 @@ "dimension": "2d", "id": 12, "labels": [ - { - "attributes": [], - "color": "#c06060", - "has_parent": false, - "id": 6, - "name": "person", - "sublabels": [], - "type": "any" - }, { "attributes": [ { @@ -422,6 +451,15 @@ "name": "car", "sublabels": [], "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 6, + "name": "person", + "sublabels": [], + "type": "any" } ], "mode": "annotation", @@ -449,15 +487,6 @@ "dimension": "2d", "id": 11, "labels": [ - { - "attributes": [], - "color": "#c06060", - "has_parent": false, - "id": 6, - "name": "person", - "sublabels": [], - "type": "any" - }, { "attributes": [ { @@ -479,6 +508,15 @@ "name": "car", "sublabels": [], "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 6, + "name": "person", + "sublabels": [], + "type": "any" } ], "mode": "annotation", diff --git a/tests/python/shared/assets/projects.json b/tests/python/shared/assets/projects.json index 51e9ee02..c21987f2 100644 --- a/tests/python/shared/assets/projects.json +++ b/tests/python/shared/assets/projects.json @@ -1,8 +1,61 @@ { - "count": 7, + "count": 8, "next": null, "previous": null, "results": [ + { + "assignee": null, + "bug_tracker": "", + "created_date": "2022-12-01T12:52:42.454308Z", + "dimension": "2d", + "id": 8, + "labels": [ + { + "attributes": [], + "color": "#2080c0", + "has_parent": false, + "id": 29, + "name": "car", + "sublabels": [], + "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 30, + "name": "person", + "sublabels": [], + "type": "any" + } + ], + "name": "project with video data", + "organization": null, + "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": 13, + "location": "local" + }, + "status": "annotation", + "target_storage": { + "cloud_storage_id": null, + "id": 14, + "location": "local" + }, + "task_subsets": [], + "tasks": [ + 15 + ], + "updated_date": "2022-12-01T12:53:34.917451Z", + "url": "http://localhost:8080/api/projects/8" + }, { "assignee": { "first_name": "Worker", @@ -115,10 +168,10 @@ "sublabels": [ { "attributes": [], - "color": "#479ffe", + "color": "#d12345", "has_parent": true, - "id": 21, - "name": "3", + "id": 19, + "name": "1", "type": "points" }, { @@ -131,10 +184,10 @@ }, { "attributes": [], - "color": "#d12345", + "color": "#479ffe", "has_parent": true, - "id": 19, - "name": "1", + "id": 21, + "name": "3", "type": "points" } ], @@ -189,10 +242,18 @@ "sublabels": [ { "attributes": [], - "color": "#4a649f", + "color": "#d53957", "has_parent": true, - "id": 26, - "name": "4", + "id": 23, + "name": "1", + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", "type": "points" }, { @@ -217,18 +278,10 @@ }, { "attributes": [], - "color": "#4925ec", - "has_parent": true, - "id": 24, - "name": "2", - "type": "points" - }, - { - "attributes": [], - "color": "#d53957", + "color": "#4a649f", "has_parent": true, - "id": 23, - "name": "1", + "id": 26, + "name": "4", "type": "points" } ], diff --git a/tests/python/shared/assets/tasks.json b/tests/python/shared/assets/tasks.json index 9642092f..4a2113bb 100644 --- a/tests/python/shared/assets/tasks.json +++ b/tests/python/shared/assets/tasks.json @@ -1,8 +1,84 @@ { - "count": 10, + "count": 11, "next": null, "previous": null, "results": [ + { + "assignee": null, + "bug_tracker": "", + "created_date": "2022-12-01T12:53:10.425141Z", + "data": 14, + "data_chunk_size": 72, + "data_compressed_chunk_type": "imageset", + "data_original_chunk_type": "video", + "dimension": "2d", + "id": 15, + "image_quality": 70, + "labels": [ + { + "attributes": [], + "color": "#2080c0", + "has_parent": false, + "id": 29, + "name": "car", + "sublabels": [], + "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 30, + "name": "person", + "sublabels": [], + "type": "any" + } + ], + "mode": "interpolation", + "name": "task with video data", + "organization": null, + "overlap": 5, + "owner": { + "first_name": "Admin", + "id": 1, + "last_name": "First", + "url": "http://localhost:8080/api/users/1", + "username": "admin1" + }, + "project_id": 8, + "segment_size": 25, + "segments": [ + { + "jobs": [ + { + "assignee": null, + "id": 19, + "stage": "annotation", + "state": "in progress", + "status": "annotation", + "url": "http://localhost:8080/api/jobs/19" + } + ], + "start_frame": 0, + "stop_frame": 24 + } + ], + "size": 25, + "source_storage": { + "cloud_storage_id": null, + "id": 15, + "location": "local" + }, + "status": "annotation", + "subset": "", + "target_storage": { + "cloud_storage_id": null, + "id": 16, + "location": "local" + }, + "updated_date": "2022-12-01T12:53:35.028385Z", + "url": "http://localhost:8080/api/tasks/15" + }, { "assignee": null, "bug_tracker": "", @@ -17,49 +93,63 @@ "labels": [ { "attributes": [], - "color": "#4a649f", - "has_parent": true, - "id": 26, - "name": "4", - "sublabels": [], - "type": "points" - }, - { - "attributes": [ + "color": "#5c5eba", + "has_parent": false, + "id": 18, + "name": "s1", + "sublabels": [ { - "default_value": "val1", - "id": 3, - "input_type": "select", - "mutable": false, - "name": "attr", - "values": [ - "val1", - "val2" - ] + "attributes": [], + "color": "#d12345", + "has_parent": true, + "id": 19, + "name": "1", + "type": "points" + }, + { + "attributes": [], + "color": "#350dea", + "has_parent": true, + "id": 20, + "name": "2", + "type": "points" + }, + { + "attributes": [], + "color": "#479ffe", + "has_parent": true, + "id": 21, + "name": "3", + "type": "points" } ], - "color": "#59a8fe", + "svg": "", + "type": "skeleton" + }, + { + "attributes": [], + "color": "#d12345", "has_parent": true, - "id": 25, - "name": "3", + "id": 19, + "name": "1", "sublabels": [], "type": "points" }, { "attributes": [], - "color": "#4925ec", + "color": "#350dea", "has_parent": true, - "id": 24, + "id": 20, "name": "2", "sublabels": [], "type": "points" }, { "attributes": [], - "color": "#d53957", + "color": "#479ffe", "has_parent": true, - "id": 23, - "name": "1", + "id": 21, + "name": "3", "sublabels": [], "type": "points" }, @@ -84,10 +174,18 @@ "sublabels": [ { "attributes": [], - "color": "#4a649f", + "color": "#d53957", "has_parent": true, - "id": 26, - "name": "4", + "id": 23, + "name": "1", + "type": "points" + }, + { + "attributes": [], + "color": "#4925ec", + "has_parent": true, + "id": 24, + "name": "2", "type": "points" }, { @@ -112,18 +210,10 @@ }, { "attributes": [], - "color": "#4925ec", - "has_parent": true, - "id": 24, - "name": "2", - "type": "points" - }, - { - "attributes": [], - "color": "#d53957", + "color": "#4a649f", "has_parent": true, - "id": 23, - "name": "1", + "id": 26, + "name": "4", "type": "points" } ], @@ -132,65 +222,51 @@ }, { "attributes": [], - "color": "#479ffe", + "color": "#d53957", "has_parent": true, - "id": 21, - "name": "3", + "id": 23, + "name": "1", "sublabels": [], "type": "points" }, { "attributes": [], - "color": "#350dea", + "color": "#4925ec", "has_parent": true, - "id": 20, + "id": 24, "name": "2", "sublabels": [], "type": "points" }, { - "attributes": [], - "color": "#d12345", + "attributes": [ + { + "default_value": "val1", + "id": 3, + "input_type": "select", + "mutable": false, + "name": "attr", + "values": [ + "val1", + "val2" + ] + } + ], + "color": "#59a8fe", "has_parent": true, - "id": 19, - "name": "1", + "id": 25, + "name": "3", "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" + "color": "#4a649f", + "has_parent": true, + "id": 26, + "name": "4", + "sublabels": [], + "type": "points" } ], "mode": "annotation", @@ -252,19 +328,19 @@ "labels": [ { "attributes": [], - "color": "#406040", + "color": "#6080c0", "has_parent": false, - "id": 17, - "name": "dog", + "id": 16, + "name": "cat", "sublabels": [], "type": "any" }, { "attributes": [], - "color": "#6080c0", + "color": "#406040", "has_parent": false, - "id": 16, - "name": "cat", + "id": 17, + "name": "dog", "sublabels": [], "type": "any" } @@ -364,19 +440,19 @@ "labels": [ { "attributes": [], - "color": "#406040", + "color": "#6080c0", "has_parent": false, - "id": 8, - "name": "dog", + "id": 7, + "name": "cat", "sublabels": [], "type": "any" }, { "attributes": [], - "color": "#6080c0", + "color": "#406040", "has_parent": false, - "id": 7, - "name": "cat", + "id": 8, + "name": "dog", "sublabels": [], "type": "any" } @@ -450,15 +526,6 @@ "id": 9, "image_quality": 70, "labels": [ - { - "attributes": [], - "color": "#c06060", - "has_parent": false, - "id": 6, - "name": "person", - "sublabels": [], - "type": "any" - }, { "attributes": [ { @@ -480,6 +547,15 @@ "name": "car", "sublabels": [], "type": "any" + }, + { + "attributes": [], + "color": "#c06060", + "has_parent": false, + "id": 6, + "name": "person", + "sublabels": [], + "type": "any" } ], "mode": "annotation", diff --git a/tests/python/shared/assets/users.json b/tests/python/shared/assets/users.json index 83e6ad10..bfd9abd5 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-11-03T13:56:42.744000Z", + "last_login": "2022-12-01T12:52:15.631928Z", "last_name": "First", "url": "http://localhost:8080/api/users/1", "username": "admin1"