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

COCO Dataset Export filename mismatch if frame_step != 1 #1334

Closed
justinkay opened this issue Mar 30, 2020 · 0 comments · Fixed by #1352
Closed

COCO Dataset Export filename mismatch if frame_step != 1 #1334

justinkay opened this issue Mar 30, 2020 · 0 comments · Fixed by #1352
Assignees
Labels
bug Something isn't working
Milestone

Comments

@justinkay
Copy link

When using Export as a dataset -> MS COCO, if a task has a frame_step not equal to 1, image filenames and annotations do not match up. In the exported file instances_default.json:

  • "images": "id" is incremented by 1, matching filenames (e.g. 0.jpg has id=0, 1.jpg has id=1, etc)
  • "annotations": "image_id" for each annotation is incremented by frame_step (e.g. for a task with frame_step=5, annotations for 0.jpg have image_id=0, but annotations for 1.jpg have image_id=5)

I notice in cvat/apps/annotation/annotation.py, the _export_... methods all follow this logic. E.g.

def _export_labeled_shape(self, shape):
        return Annotation.LabeledShape(
            type=shape["type"],
            label=self._get_label_name(shape["label_id"]),
            ## here: ##
            frame=self._db_task.start_frame + shape["frame"] * self._frame_step,
            ##########
            points=shape["points"],
            occluded=shape["occluded"],
            z_order=shape.get("z_order", 0),
            group=shape.get("group", 0),
            attributes=self._export_attributes(shape["attributes"]),
        )

I'm not familiar enough with the codebase to know how essential this logic is. If it used elsewhere, the easiest method may be to change the exported filenames to increment by frame_step as well (though, it would not match how CVAT stores the files internally)..? E.g. 0.jpg, frame_step.jpg, 2*frame_step.jpg....

Attached is an exported dataset of an example task with frame_step=5

task_yft_test_coco.zip

@nmanovic nmanovic added the bug Something isn't working label Mar 30, 2020
@nmanovic nmanovic added this to To do in Dataset framework (Datumaro) via automation Mar 30, 2020
@nmanovic nmanovic added this to the 1.0.0 - Beta milestone Mar 30, 2020
@nmanovic nmanovic modified the milestones: 1.0.0-beta.1, 1.0.0-beta.2 Apr 15, 2020
@zhiltsov-max zhiltsov-max linked a pull request Apr 28, 2020 that will close this issue
9 tasks
@nmanovic nmanovic modified the milestones: 1.0.0-beta.2, 1.0.0-release May 1, 2020
Dataset framework (Datumaro) automation moved this from To do to Done May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants