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 import missing "extra" info in annotations #726

Open
drapado opened this issue Nov 21, 2023 · 2 comments
Open

Coco import missing "extra" info in annotations #726

drapado opened this issue Nov 21, 2023 · 2 comments

Comments

@drapado
Copy link

drapado commented Nov 21, 2023

While exporting to COCO the "extra" entry of each annotation is built (

def build_extra(annotation: dt.Annotation) -> Dict[str, Any]:
). It contains "instance_id" for instance where the objects have a tracking ID.

However, the COCO importer completely ignores this "extra" category in the annotations.

@drapado
Copy link
Author

drapado commented Nov 21, 2023

Changing the importer coco.py at line 138 like this:

    if len(segmentation) == 0 and len(annotation["bbox"]) == 4:
        x, y, w, h = map(int, annotation["bbox"])
        track_id = int(annotation["extra"]["instance_id"])
        # print(dt.make_instance_id(track_id), track_id)
        return dt.make_bounding_box(category["name"], x, y, w, h, subs=[dt.make_instance_id(track_id)])

doesn't solve the issue, any ideas why?

@drapado
Copy link
Author

drapado commented Nov 22, 2023

I made it work, just created a PR: #729

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

No branches or pull requests

1 participant