Skip to content

Quality control: can't match skeletons or point groups in corner cases #9957

@zhiltsov-max

Description

@zhiltsov-max

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

  1. Create a task with 1 skeleton label (with 1 point) and a GT job
  2. Create 1 annotation that you'd expect to match in the GT job and a regular job
  3. Run quality check, find that the skeletons were not matched

The reason is that the skeleton boxes are checked for intersection first. Only if there's an intersection, the points are compared between each other. This works in "normal" cases, where there are 5+ visible skeleton points and they cover some area, but in some corner cases this check produces incorrect results.

Related cases:

  • a pair of skeletons / points that are quasi-parallel lines without bbox intersection
  • a pair of skeletons / points, with one or two of them having just 1 visible point

Code references:

a_bbox = self.instance_map[id(a)][1]
b_bbox = self.instance_map[id(b)][1]
if datumaro.util.annotation_util.bbox_iou(a_bbox, b_bbox) <= 0:
return 0

Known workarounds:
Append a grouped bounding box to each skeleton. These boxes can be used by the existing implementation. It solves the problem, but it's not always convenient to do and increases the amount of annotation work. In some annotation scenarios there is no simple way to add more annotation types in the specification.

Expected Behavior

The skeleton and points should match when they're close to each other.

Possible Solution

It's possible to disable this check, but doing so can reduce performance of the algorithm significantly and can result in some false-positive matches because of the OKS scaling to the common bbox.

Context

No response

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions