Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skeletons in datumaro format #8165

Merged
merged 10 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- Datumaro format now supports skeletons
(<https://github.com/cvat-ai/cvat/pull/8165>)
2 changes: 1 addition & 1 deletion cvat/requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ azure-storage-blob==12.13.0
boto3==1.17.61
clickhouse-connect==0.6.8
coreapi==2.3.3
datumaro @ git+https://github.com/cvat-ai/datumaro.git@82982b16b178eb3f39c707795bb68a3306610abf
datumaro @ git+https://github.com/cvat-ai/datumaro.git@2a4d9dbbd86f2e5fc5f8db2cfd2defdf464e9645
dj-pagination==2.5.0
# Despite direct indication allauth in requirements we should keep 'with_social' for dj-rest-auth
# to avoid possible further versions conflicts (we use registration functionality)
Expand Down
52 changes: 26 additions & 26 deletions cvat/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:72d30d3a78182797ba879af4b7b50f17ecaf2e8f
# SHA1:e320604118ebbbb6f9a0460d977e416d4cb27200
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -16,7 +16,7 @@ attrs==21.4.0
# -r cvat/requirements/base.in
# datumaro
# jsonschema
azure-core==1.30.1
azure-core==1.30.2
# via
# azure-storage-blob
# msrest
Expand All @@ -30,7 +30,7 @@ botocore==1.20.112
# s3transfer
cachetools==5.3.3
# via google-auth
certifi==2024.2.2
certifi==2024.7.4
# via
# clickhouse-connect
# msrest
Expand All @@ -51,13 +51,13 @@ coreschema==0.0.4
# via coreapi
crontab==1.0.1
# via rq-scheduler
cryptography==42.0.7
cryptography==42.0.8
# via
# azure-storage-blob
# pyjwt
cycler==0.12.1
# via matplotlib
datumaro @ git+https://github.com/cvat-ai/datumaro.git@82982b16b178eb3f39c707795bb68a3306610abf
datumaro @ git+https://github.com/cvat-ai/datumaro.git@2a4d9dbbd86f2e5fc5f8db2cfd2defdf464e9645
# via -r cvat/requirements/base.in
defusedxml==0.7.1
# via
Expand All @@ -67,9 +67,9 @@ deprecated==1.2.14
# via limits
dj-pagination==2.5.0
# via -r cvat/requirements/base.in
dj-rest-auth[with_social]==5.0.2
dj-rest-auth[with-social]==5.0.2
# via -r cvat/requirements/base.in
django==4.2.13
django==4.2.14
# via
# -r cvat/requirements/base.in
# dj-rest-auth
Expand Down Expand Up @@ -100,7 +100,7 @@ django-crum==0.7.9
# via -r cvat/requirements/base.in
django-filter==2.4.0
# via -r cvat/requirements/base.in
django-health-check==3.18.2
django-health-check==3.18.3
# via -r cvat/requirements/base.in
django-rq==2.8.1
# via -r cvat/requirements/base.in
Expand All @@ -117,17 +117,17 @@ easyprocess==1.1
# via pyunpack
entrypoint2==1.1
# via pyunpack
fonttools==4.51.0
fonttools==4.53.1
# via matplotlib
freezegun==1.5.1
# via rq-scheduler
furl==2.1.0
# via -r cvat/requirements/base.in
google-api-core==2.19.0
google-api-core==2.19.1
# via
# google-cloud-core
# google-cloud-storage
google-auth==2.29.0
google-auth==2.32.0
# via
# google-api-core
# google-cloud-core
Expand All @@ -138,15 +138,15 @@ google-cloud-storage==1.42.0
# via -r cvat/requirements/base.in
google-crc32c==1.5.0
# via google-resumable-media
google-resumable-media==2.7.0
google-resumable-media==2.7.1
# via google-cloud-storage
googleapis-common-protos==1.63.0
googleapis-common-protos==1.63.2
# via google-api-core
h5py==3.11.0
# via datumaro
idna==3.7
# via requests
importlib-metadata==7.1.0
importlib-metadata==8.0.0
# via clickhouse-connect
importlib-resources==6.4.0
# via limits
Expand All @@ -168,7 +168,7 @@ jsonschema==4.17.3
# via drf-spectacular
kiwisolver==1.4.5
# via matplotlib
limits==3.12.0
limits==3.13.0
# via python-logstash-async
lxml==5.2.2
# via
Expand Down Expand Up @@ -196,9 +196,9 @@ oauthlib==3.2.2
# via requests-oauthlib
orderedmultidict==1.0.1
# via furl
orjson==3.10.3
orjson==3.10.6
# via datumaro
packaging==24.0
packaging==24.1
# via
# limits
# matplotlib
Expand All @@ -212,9 +212,9 @@ pdf2image==1.14.0
# via -r cvat/requirements/base.in
pottery==3.0.0
# via -r cvat/requirements/base.in
proto-plus==1.23.0
proto-plus==1.24.0
# via google-api-core
protobuf==4.25.3
protobuf==5.27.2
# via
# google-api-core
# googleapis-common-protos
Expand All @@ -233,7 +233,7 @@ pyasn1-modules==0.4.0
# via
# google-auth
# python-ldap
pycocotools==2.0.7
pycocotools==2.0.8
# via datumaro
pycparser==2.22
# via cffi
Expand Down Expand Up @@ -281,7 +281,7 @@ redis==4.6.0
# django-rq
# pottery
# rq
requests==2.31.0
requests==2.32.3
# via
# -r cvat/requirements/base.in
# azure-core
Expand Down Expand Up @@ -312,11 +312,11 @@ ruamel-yaml==0.18.6
# via datumaro
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
rules==3.3
rules==3.4
# via -r cvat/requirements/base.in
s3transfer==0.4.2
# via boto3
scipy==1.13.0
scipy==1.13.1
# via datumaro
shapely==1.7.1
# via -r cvat/requirements/base.in
Expand All @@ -331,7 +331,7 @@ sqlparse==0.5.0
# via django
tensorboardx==2.6.2.2
# via datumaro
typing-extensions==4.11.0
typing-extensions==4.12.2
# via
# asgiref
# azure-core
Expand All @@ -344,7 +344,7 @@ uritemplate==4.1.1
# via
# coreapi
# drf-spectacular
urllib3==1.26.18
urllib3==1.26.19
# via
# botocore
# clickhouse-connect
Expand All @@ -355,7 +355,7 @@ xmlsec==1.3.14
# via
# -r cvat/requirements/base.in
# python3-saml
zipp==3.18.2
zipp==3.19.2
# via importlib-metadata
zstandard==0.22.0
# via clickhouse-connect
12 changes: 6 additions & 6 deletions cvat/requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

astroid==2.11.7
# via pylint
autopep8==2.1.0
autopep8==2.3.1
# via django-silk
black==24.4.2
# via -r cvat/requirements/development.in
Expand All @@ -19,7 +19,7 @@ django-extensions==3.0.8
# via -r cvat/requirements/development.in
django-silk==5.0.3
# via -r cvat/requirements/development.in
gprof2dot==2022.7.29
gprof2dot==2024.6.6
# via django-silk
isort==5.13.2
# via pylint
Expand All @@ -35,7 +35,7 @@ platformdirs==4.2.2
# via
# black
# pylint
pycodestyle==2.11.1
pycodestyle==2.12.0
# via autopep8
pylint==2.14.5
# via
Expand All @@ -57,11 +57,11 @@ tomli==2.0.1
# autopep8
# black
# pylint
tomlkit==0.12.5
tomlkit==0.13.0
# via pylint
tornado==6.4
tornado==6.4.1
# via snakeviz

# The following packages are considered to be unsafe in a requirements file:
setuptools==70.0.0
setuptools==70.3.0
# via astroid
4 changes: 2 additions & 2 deletions cvat/requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
--no-binary lxml
--no-binary xmlsec

anyio==4.3.0
anyio==4.4.0
# via watchfiles
coverage==7.2.3
# via -r cvat/requirements/production.in
Expand All @@ -27,7 +27,7 @@ uvicorn[standard]==0.22.0
# via -r cvat/requirements/production.in
uvloop==0.19.0
# via uvicorn
watchfiles==0.21.0
watchfiles==0.22.0
# via uvicorn
websockets==12.0
# via uvicorn
4 changes: 2 additions & 2 deletions site/content/en/docs/manual/advanced/formats/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ The table below outlines the available formats for data export in CVAT.

<!--lint disable maximum-line-length-->

| Format | Type | Computer Vision Task | Models | Shapes | Attributes | Video Tracks |
| Format | Type | Computer Vision Task | Models | Shapes | Attributes | Video Tracks |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------- | ------------- |
| [CamVid 1.0](format-camvid) | .txt <br>.png | Semantic <br>Segmentation | U-Net, SegNet, DeepLab, <br>PSPNet, FCN, Mask R-CNN, <br>ICNet, ERFNet, HRNet, <br>V-Net, and others. | Polygons | Not supported | Not supported |
| [Cityscapes 1.0](format-cityscapes) | .txt<br>.png | Semantic<br>Segmentation | U-Net, SegNet, DeepLab, <br>PSPNet, FCN, ERFNet, <br>ICNet, Mask R-CNN, HRNet, <br>ENet, and others. | Polygons | Specific attributes | Not supported |
| [COCO 1.0](format-coco) | JSON | Detection, Semantic <br>Segmentation | YOLO (You Only Look Once), <br>Faster R-CNN, Mask R-CNN, SSD (Single Shot MultiBox Detector), <br> RetinaNet, EfficientDet, UNet, <br>DeepLabv3+, CenterNet, Cascade R-CNN, and others. | Bounding Boxes, Polygons | Specific attributes | Not supported |
| [COCO Keypoints 1.0](coco-keypoints) | .xml | Keypoints | OpenPose, PoseNet, AlphaPose, <br> SPM (Single Person Model), <br>Mask R-CNN with Keypoint Detection:, and others. | Skeletons | Specific attributes | Not supported |
| {{< ilink "/docs/manual/advanced/formats/format-cvat#cvat-for-image-export" "CVAT for images 1.1" >}} | .xml | Any in 2D except for Video Tracking | Any model that can decode the format. | Bounding Boxes, Polygons, <br>Polylines, Points, Cuboids, <br>Skeletons, Ellipses, Masks, Tags. | All attributes | Not supported |
| {{< ilink "/docs/manual/advanced/formats/format-cvat#cvat-for-videos-export" "CVAT for video 1.1" >}} | .xml | Any in 2D except for Classification | Any model that can decode the format. | Bounding Boxes, Polygons, <br>Polylines, Points, Cuboids, <br>Skeletons, Ellipses, Masks. | All attributes | Supported |
| [Datumaro 1.0](format-datumaro) | JSON | Any | Any model that can decode the format. <br> Main format in [Datumaro](https://github.com/openvinotoolkit/datumaro) framework | Bounding Boxes, Polygons, <br>Polylines, Points, Cuboids, <br>Tags, Ellipses, Masks. | All attributes | Supported |
| [Datumaro 1.0](format-datumaro) | JSON | Any | Any model that can decode the format. <br> Main format in [Datumaro](https://github.com/openvinotoolkit/datumaro) framework | Bounding Boxes, Polygons, <br>Polylines, Points, Cuboids, <br>Skeletons, Ellipses, Masks, Tags. | All attributes | Supported |
| [ICDAR](format-icdar)<br> Includes ICDAR Recognition 1.0, <br>ICDAR Detection 1.0, <br>and ICDAR Segmentation 1.0 <br>descriptions. | .txt | Text recognition, <br>Text detection, <br>Text segmentation | EAST: Efficient and Accurate <br>Scene Text Detector, CRNN, Mask TextSpotter, TextSnake, <br>and others. | Tag, Bounding Boxes, Polygons | Specific attributes | Not supported |
| [ImageNet 1.0](format-imagenet) | .jpg <br>.txt | Semantic Segmentation, <br>Classification, <br>Detection | VGG (VGG16, VGG19), Inception, YOLO, Faster R-CNN , U-Net, and others | Tags | No attributes | Not supported |
| [KITTI 1.0](format-kitti) | .txt <br>.png | Semantic Segmentation, Detection, 3D | PointPillars, SECOND, AVOD, YOLO, DeepSORT, PWC-Net, ORB-SLAM, and others. | Bounding Boxes, Polygons | Specific attributes | Not supported |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For more information, see:
For export of images: any 2D shapes, tags

- Supported annotations: Bounding Boxes, Polygons, Polylines,
Masks, Points, Cuboids, Tags
Masks, Points, Cuboids, Tags, Skeletons
- Attributes: Supported.
- Tracks: Supported.

Expand All @@ -41,7 +41,7 @@ taskname.zip/
# Import annotations in Datumaro format

- supported annotations: Bounding Boxes, Polygons, Polylines,
Masks, Points, Cuboids, Labels
Masks, Points, Cuboids, Labels, Skeletons
- supported attributes: any

Uploaded file: a zip archive of the following structure:
Expand Down
55 changes: 25 additions & 30 deletions tests/python/rest_api/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,44 +586,39 @@ def test_can_import_dataset_in_org(self, admin_user):

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, format="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)

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
@pytest.mark.parametrize(
"export_format, import_format",
(
("COCO Keypoints 1.0", "COCO Keypoints 1.0"),
("CVAT for images 1.1", "CVAT 1.1"),
zhiltsov-max marked this conversation as resolved.
Show resolved Hide resolved
("CVAT for video 1.1", "CVAT 1.1"),
("Datumaro 1.0", "Datumaro 1.0"),
),
)
def test_can_export_and_import_dataset_with_skeletons(
self, annotations, tasks, admin_user, export_format, import_format
):
tasks_with_skeletons = [
int(task_id)
for task_id in annotations["task"]
for element in annotations["task"][task_id]["shapes"]
if element["type"] == "skeleton"
]
project_id = next(
task["project_id"]
for task in tasks
if task["id"] in tasks_with_skeletons and task["project_id"] is not None
)

response = self._test_export_project(admin_user, project_id, format="CVAT for video 1.1")
response = self._test_export_project(admin_user, project_id, format=export_format)

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)
self._test_import_project(admin_user, project_id, import_format, import_data)

def _test_can_get_project_backup(self, username, pid, **kwargs):
for _ in range(30):
Expand Down
4 changes: 2 additions & 2 deletions utils/dataset_manifest/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ natsort==8.0.0
# via -r utils/dataset_manifest/requirements.in
numpy==1.22.4
# via opencv-python-headless
opencv-python-headless==4.9.0.80
opencv-python-headless==4.10.0.84
# via -r utils/dataset_manifest/requirements.in
pillow==10.3.0
pillow==10.4.0
# via -r utils/dataset_manifest/requirements.in
tqdm==4.66.4
# via -r utils/dataset_manifest/requirements.in
Loading