Skip to content

Intersection Over Union (IoU) should support Shape N x C_1 x C_2 x ... x C_n #3262

@Shoumik-Gandre

Description

@Shoumik-Gandre

🐛 Bug

I was writing a Pull Request for Sorted AP metric and I figured "let's use torchmetrics's IOU function!". Unfortunately, unlike the JaccardIndex, torchmetric's IntersectionOverUnion does not take multiple dimensions.

Infact, it only allows the very limiting shape of (N, 4). This is not an oversight; it's a major flaw hurting torchmetric's credibility because IoU is the most well-known computer vision metric. A user will first look for IntersectionOverUnion and NOT JaccardIndex and chances are that they'll be disappointed.

I propose that IntersectionOverUnion be a wrapper over MultilabelJaccardIndex

I am willing to make a PR for it.

To Reproduce

See any example from here. IntersectionOverUnion

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug / fixSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions