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

Allow to upload tracks from COCO formats #6969

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

sizov-kirill
Copy link
Contributor

@sizov-kirill sizov-kirill commented Oct 9, 2023

Motivation and context

This PR resolves the following problems:

  1. During import we ignore track_id attribute for annotations if these annotations do not come from one of these formats ('cvat', 'datumaro', 'sly_pointcloud') this prevents to import tracks in coco format -> this PR extends the list of "track formats"
  2. When we convert a dataset from CVAT representation to Datumaro Dataset in all possible situations only the first shape of the skeleton track is a keyframe, all other shapes will be as marked as not keyframes it leads to problems when we try to import such tracks that were exported from CVAT -> this PR adds the following line of code: set keyframe = True for skeletons if at least one point of this skeleton is keyframe
  3. During import skeleton tracks our code always expects to see a "keyframe" attribute for the skeleton's element, but not all formats support attributes for skeleton points (for example COCO Keypoints doesn't allow to have attributes for each skeleton's point). And if the server doesn't see this attribute for some element we ignore this element -> this PR adds the following logic for skeleton track: if skeleton's elements don't have a keyframe attribute at all then consider such skeleton elements as keyframes = True

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@sizov-kirill sizov-kirill changed the title [WIP] Allow to upload tracks from COCO formats Allow to upload tracks from COCO formats Oct 11, 2023
task.import_annotations(format_name, dataset_file)

imported_annotations = task.get_annotations()
print(imported_annotations)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #6969 (60e3c14) into develop (e699848) will increase coverage by 0.01%.
Report is 17 commits behind head on develop.
The diff coverage is 94.11%.

@@             Coverage Diff             @@
##           develop    #6969      +/-   ##
===========================================
+ Coverage    82.58%   82.59%   +0.01%     
===========================================
  Files          360      360              
  Lines        38914    38928      +14     
  Branches      3570     3570              
===========================================
+ Hits         32137    32154      +17     
+ Misses        6777     6774       -3     
Components Coverage Δ
cvat-ui 77.61% <90.90%> (+<0.01%) ⬆️
cvat-server 87.17% <100.00%> (+0.02%) ⬆️

@nmanovic nmanovic merged commit 2802442 into develop Oct 12, 2023
33 checks passed
@nmanovic nmanovic deleted the sk/fix-coco-tracks-uploading branch October 12, 2023 19:59
@github-actions github-actions bot mentioned this pull request Oct 13, 2023
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Oct 25, 2023
This PR resolves the following problems:

1. During import we ignore track_id attribute for annotations if these
annotations do not come from one of these formats `('cvat', 'datumaro',
'sly_pointcloud')` this prevents to import tracks in coco format -> this
PR extends the list of "track formats"
2. When we convert a dataset from CVAT representation to Datumaro
Dataset in all possible situations only the first shape of the skeleton
track is a keyframe, all other shapes will be as marked as not keyframes
it leads to problems when we try to import such tracks that were
exported from CVAT -> this PR adds the following line of code: set
`keyframe = True` for skeletons if at least one point of this skeleton
is keyframe
3. During import skeleton tracks our code always expects to see a
"keyframe" attribute for the skeleton's element, but not all formats
support attributes for skeleton points (for example COCO Keypoints
doesn't allow to have attributes for each skeleton's point). And if the
server doesn't see this attribute for some element we ignore this
element -> this PR adds the following logic for skeleton track: if
skeleton's elements don't have a keyframe attribute at all then consider
such skeleton elements as keyframes = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants