cvat icon indicating copy to clipboard operation
cvat copied to clipboard

Skeleton annotation task: can't export dataset

Open ConsciousML opened this issue 3 years ago • 7 comments

My actions before raising this issue

  • [X] Read/searched the docs
  • [X] Searched past issues

Without skeletal annotation (or only bbox), I can't succesfully export the data. Once I annotated the task, upon export as 'COCO Keypoints 1.1' I have the following error: image

Expected Behaviour

The annotation and images are exported.

Current Behaviour

Can't export dataset with skeletal anntotation

Steps to Reproduce (for bugs)

  1. Upload data to create a task
  2. Annotate a skeletal track
  3. Export the dataset

Your Environment

  • Git hash commit (git log -1): 46b88c11ab2bbb4989365899196bf4157ee94b90
  • Docker version docker version (e.g. Docker 17.0.05): 20.10.21
  • Are you using Docker Swarm or Kubernetes? No
  • Operating System and version (e.g. Linux, Windows, MacOS): Ubuntu 22.04
  • Other diagnostic information / logs: The way I defined the annotations in the project:
[
  {
    "name": "person",
    "id": 22,
    "color": "#c06060",
    "type": "any",
    "attributes": []
  },
  {
    "name": "pose",
    "id": 66,
    "color": "#1446c2",
    "type": "skeleton",
    "sublabels": [
      {
        "name": "head",
        "attributes": [],
        "type": "points",
        "color": "#d12345",
        "id": 67
      },
      {
        "name": "l_shoulder",
        "attributes": [],
        "type": "points",
        "color": "#350dea",
        "id": 68
      },
      {
        "name": "l_elbow",
        "attributes": [],
        "type": "points",
        "color": "#479ffe",
        "id": 69
      },
      {
        "name": "l_hand",
        "attributes": [],
        "type": "points",
        "color": "#4a649f",
        "id": 70
      },
      {
        "name": "r_shoulder",
        "attributes": [],
        "type": "points",
        "color": "#478144",
        "id": 71
      },
      {
        "name": "r_elbow",
        "attributes": [],
        "type": "points",
        "color": "#57236b",
        "id": 72
      },
      {
        "name": "r_hand",
        "attributes": [],
        "type": "points",
        "color": "#1cdda5",
        "id": 73
      }
    ],
    "svg": "<line x1=&quot;68.81401824951172&quot; y1=&quot;26.254180908203125&quot; x2=&quot;46.40599060058594&quot; y2=&quot;12.374582290649414&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;5&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;1&quot;></line><line x1=&quot;77.8441162109375&quot; y1=&quot;43.4782600402832&quot; x2=&quot;66.138427734375&quot; y2=&quot;65.0501708984375&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;6&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;7&quot;></line><line x1=&quot;68.81401824951172&quot; y1=&quot;26.254180908203125&quot; x2=&quot;77.8441162109375&quot; y2=&quot;43.4782600402832&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;5&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;6&quot;></line><line x1=&quot;23.997961044311523&quot; y1=&quot;28.595317840576172&quot; x2=&quot;68.81401824951172&quot; y2=&quot;26.254180908203125&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;2&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;5&quot;></line><line x1=&quot;23.997961044311523&quot; y1=&quot;28.595317840576172&quot; x2=&quot;46.40599060058594&quot; y2=&quot;12.374582290649414&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;2&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;1&quot;></line><line x1=&quot;12.292276382446289&quot; y1=&quot;47.15719223022461&quot; x2=&quot;24.666858673095703&quot; y2=&quot;65.88628387451172&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;3&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;4&quot;></line><line x1=&quot;23.997961044311523&quot; y1=&quot;28.595317840576172&quot; x2=&quot;12.292276382446289&quot; y2=&quot;47.15719223022461&quot; stroke=&quot;black&quot; data-type=&quot;edge&quot; data-node-from=&quot;2&quot; stroke-width=&quot;0.5&quot; data-node-to=&quot;3&quot;></line><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;46.40599060058594&quot; cy=&quot;12.374582290649414&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;1&quot; data-node-id=&quot;1&quot; data-label-id=&quot;67&quot;></circle><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;23.997961044311523&quot; cy=&quot;28.595317840576172&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;2&quot; data-node-id=&quot;2&quot; data-label-id=&quot;68&quot;></circle><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;12.292276382446289&quot; cy=&quot;47.15719223022461&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;3&quot; data-node-id=&quot;3&quot; data-label-id=&quot;69&quot;></circle><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;24.666858673095703&quot; cy=&quot;65.88628387451172&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;4&quot; data-node-id=&quot;4&quot; data-label-id=&quot;70&quot;></circle><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;68.81401824951172&quot; cy=&quot;26.254180908203125&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;5&quot; data-node-id=&quot;5&quot; data-label-id=&quot;71&quot;></circle><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;77.8441162109375&quot; cy=&quot;43.4782600402832&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;6&quot; data-node-id=&quot;6&quot; data-label-id=&quot;72&quot;></circle><circle r=&quot;1.5&quot; stroke=&quot;black&quot; fill=&quot;#b3b3b3&quot; cx=&quot;66.138427734375&quot; cy=&quot;65.0501708984375&quot; stroke-width=&quot;0.1&quot; data-type=&quot;element node&quot; data-element-id=&quot;7&quot; data-node-id=&quot;7&quot; data-label-id=&quot;73&quot;></circle>",
    "attributes": [
      {
        "id": 3,
        "name": "track_id",
        "input_type": "select",
        "mutable": false,
        "values": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10"
        ],
        "default_value": "1"
      }
    ]
  }
]

image

ConsciousML avatar Nov 08 '22 13:11 ConsciousML

@ConsciousML

Please, provide docker logs cvat_server

bsekachev avatar Nov 08 '22 14:11 bsekachev

Hi @bsekachev,

Here it is:

2022-11-08 13:54:04,112 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:04.112792 2022] [wsgi:error] [pid 68:tid 140604987524864] [remote 192.168.224.4:50008] [2022-11-08 13:54:04,112] INFO cvat.server.task_285: get repository request

2022-11-08 13:54:04,113 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:04.113083 2022] [wsgi:error] [pid 68:tid 140604987524864] [remote 192.168.224.4:50008] INFO:cvat.server.task_285:get repository request

2022-11-08 13:54:04,145 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:04.145671 2022] [wsgi:error] [pid 68:tid 140604970739456] [remote 192.168.224.4:50006] INFO:cvat.client.task_285:{"job_id":240,"task_id":285,"client_id":477228,"name":"Load job","time":"2022-11-08T13:53:59.327000Z","payload":{"duration":881,"frame count":71,"track count":8,"object count":479,"box count":1,"polygon count":0,"polyline count":0,"points count":7,"cuboids count":0,"tag count":0},"is_active":true,"username":"admin"}

2022-11-08 13:54:04,146 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:04.146084 2022] [wsgi:error] [pid 68:tid 140604970739456] [remote 192.168.224.4:50006] INFO:cvat.client.task_285:{"job_id":240,"task_id":285,"client_id":477228,"name":"Fit image","time":"2022-11-08T13:54:00.241000Z","payload":{},"is_active":true,"username":"admin"}

2022-11-08 13:54:04,146 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:04.146600 2022] [wsgi:error] [pid 68:tid 140604970739456] [remote 192.168.224.4:50006] INFO:cvat.client:{"client_id":477228,"name":"Send user activity","time":"2022-11-08T13:54:04.067000Z","payload":{"working_time":3507},"is_active":true,"username":"admin"}

2022-11-08 13:54:25,736 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:25.736578 2022] [wsgi:error] [pid 68:tid 140604987524864] [remote 192.168.224.4:50102] [2022-11-08 13:54:25,736] ERROR django.request: Internal Server Error: /api/tasks/285/dataset

2022-11-08 13:54:25,737 DEBG 'runserver' stderr output:
[Tue Nov 08 13:54:25.736681 2022] [wsgi:error] [pid 68:tid 140604987524864] [remote 192.168.224.4:50102] ERROR:django.request:Internal Server Error: /api/tasks/285/dataset

ConsciousML avatar Nov 08 '22 14:11 ConsciousML

@ConsciousML

Hm, what about docker logs cvat_worker_default?

bsekachev avatar Nov 08 '22 14:11 bsekachev

@bsekachev

2022-11-08 13:54:24,611 DEBG 'rqworker_default_1' stderr output:
DEBUG:rq.worker:Handling failed execution of job /api/task/285/annotations/COCO Keypoints 1.0

2022-11-08 13:54:24,612 DEBG 'rqworker_default_1' stderr output:
ERROR:rq.worker:Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/datumaro/plugins/coco_format/converter.py", line 765, in apply
    task_conv.save_annotations(item)
  File "/opt/venv/lib/python3.8/site-packages/datumaro/plugins/coco_format/converter.py", line 388, in save_annotations
    elem.update(self.convert_points_object(skeleton))
  File "/opt/venv/lib/python3.8/site-packages/datumaro/plugins/coco_format/converter.py", line 418, in convert_points_object
    elements[self._point_label_to_position[element.label]] = element
IndexError: list assignment index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rq/worker.py", line 936, in perform_job
    rv = job.perform()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 684, in perform
    self._result = self._execute()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/home/django/cvat/apps/dataset_manager/views.py", line 114, in export_task_as_dataset
    return export(dst_format, task_id=task_id, server_url=server_url, save_images=True)
  File "/home/django/cvat/apps/dataset_manager/views.py", line 81, in export
    export_fn(db_instance.id, temp_file, dst_format,
  File "/home/django/cvat/apps/dataset_manager/task.py", line 766, in export_task
    task.export(f, exporter, host=server_url, save_images=save_images)
  File "/home/django/cvat/apps/dataset_manager/task.py", line 648, in export
    exporter(dst_file, task_data, **options)
  File "/home/django/cvat/apps/dataset_manager/formats/registry.py", line 37, in __call__
    f_or_cls(*args, **kwargs)
  File "/home/django/cvat/apps/dataset_manager/formats/coco.py", line 46, in _export
    dataset.export(temp_dir, 'coco_person_keypoints', save_images=save_images,
  File "/opt/venv/lib/python3.8/site-packages/datumaro/util/scope.py", line 158, in wrapped_func
    ret_val = func(*args, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/datumaro/components/dataset.py", line 1111, in export
    raise e.__cause__
datumaro.components.errors.AnnotationExportError: Failed to export item ('frame_000021', 'default')
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/datumaro/plugins/coco_format/converter.py", line 765, in apply
    task_conv.save_annotations(item)
  File "/opt/venv/lib/python3.8/site-packages/datumaro/plugins/coco_format/converter.py", line 388, in save_annotations
    elem.update(self.convert_points_object(skeleton))
  File "/opt/venv/lib/python3.8/site-packages/datumaro/plugins/coco_format/converter.py", line 418, in convert_points_object
    elements[self._point_label_to_position[element.label]] = element
IndexError: list assignment index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rq/worker.py", line 936, in perform_job
    rv = job.perform()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 684, in perform
    self._result = self._execute()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/home/django/cvat/apps/dataset_manager/views.py", line 114, in export_task_as_dataset
    return export(dst_format, task_id=task_id, server_url=server_url, save_images=True)
  File "/home/django/cvat/apps/dataset_manager/views.py", line 81, in export
    export_fn(db_instance.id, temp_file, dst_format,
  File "/home/django/cvat/apps/dataset_manager/task.py", line 766, in export_task
    task.export(f, exporter, host=server_url, save_images=save_images)
  File "/home/django/cvat/apps/dataset_manager/task.py", line 648, in export
    exporter(dst_file, task_data, **options)
  File "/home/django/cvat/apps/dataset_manager/formats/registry.py", line 37, in __call__
    f_or_cls(*args, **kwargs)
  File "/home/django/cvat/apps/dataset_manager/formats/coco.py", line 46, in _export
    dataset.export(temp_dir, 'coco_person_keypoints', save_images=save_images,
  File "/opt/venv/lib/python3.8/site-packages/datumaro/util/scope.py", line 158, in wrapped_func
    ret_val = func(*args, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/datumaro/components/dataset.py", line 1111, in export
    raise e.__cause__
datumaro.components.errors.AnnotationExportError: Failed to export item ('frame_000021', 'default')

ConsciousML avatar Nov 08 '22 14:11 ConsciousML

@yasakova-anastasia , could you check this problem?

zhiltsov-max avatar Nov 08 '22 14:11 zhiltsov-max

@zhiltsov-max I have no issue when I export with the format 'CVAT for videos 1.1' with the 'Save Images Option'.

Whereas the issue happens with the 'COCO Keypoints 1.1' format.

ConsciousML avatar Nov 09 '22 13:11 ConsciousML

Hi @bsekachev @zhiltsov-max,

Sorry to disturb. Would it be possible to have someone on this issue ?

It is a major problem for our team as we want to start delegating a skeleton annotation project with external annotators. We are stuck since we can't export the annotations.

Any workaround ? I could try to help, problem is I've never contributed in the CVAT code base.

ConsciousML avatar Nov 15 '22 13:11 ConsciousML

I couldn't reproduce this.

@ConsciousML Would it be possible to create a small task that exhibits this problem, back it up, and attach the backup here?

SpecLad avatar Nov 30 '22 12:11 SpecLad

I am also not able to export the annotation file for keypoint annotation from CVAT,

The issue that I am getting is.

photo_2022-11-25_16-05-18

Please help me solve this issue.

AnandGajaria avatar Dec 11 '22 09:12 AnandGajaria

Hi, @AnandGajaria

Could you please provide more information?

  1. What format do you export annotations to?
  2. Please, provide git hash commit (git log -1) and docker logs cvat_worker_default

yasakova-anastasia avatar Dec 11 '22 10:12 yasakova-anastasia

Thank you so much for the reply, @yasakova-anastasia

I am trying to export in COCO keypoint 1.0 Format.

The process that I am following is.

  • Create a Task.
  • Create a Skeleton using an image.
  • Then use that skeleton on an Image I want to annotate. -Adjust the annotation. -Save and Export it. -So while Exporting I am getting the issue.

Thank you so much for the help.

AnandGajaria avatar Dec 11 '22 11:12 AnandGajaria

@AnandGajaria, I think this problem has already been fixed. Could you tell me what version of CVAT you are using?

yasakova-anastasia avatar Dec 14 '22 08:12 yasakova-anastasia

I am also not able to export the annotation file for keypoint annotation from CVAT,

The issue that I am getting is.

photo_2022-11-25_16-05-18

Please help me solve this issue.

I got same error. I am using dev version.

Is there any updated..?

DoHoNi avatar Jan 03 '23 23:01 DoHoNi

@DoHoNi , @AnandGajaria , could you please backup your task and share with us the archive?

nmanovic avatar Jan 04 '23 15:01 nmanovic

I get the same error using the web application and exporting skeleton annotation to COCO keypoints. In addition, when exporting using YOLO 1.1 I get empty .txt files. Do you know if there is a work around to these problems?

mikalbre avatar Jan 11 '23 10:01 mikalbre

I am having the same problem while exporting the data for Skeleton Keypoints

sultanakhtar avatar Jun 25 '23 16:06 sultanakhtar