facebookresearch / facebookresearch/pytorch3d

Potential IOU compute Bug in box3d_overlap

Open
#1,771 10 comments 4 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

## box3d_overlap IOU computation value larger than 1

box3d_overlap computes incorrect IOU value which sometimes could be value even larger than 1. Note this bug is different from the bug fix mentioned [here](https://github.com/facebookresearch/pytorch3d/commit/1bfe6bf20a1de877cc623d11c2eeed8c7091ae90) in github and actually happens with a low eps setting.

## Instructions To Reproduce the Issue:
**Min replicating code**
(data:
[bbox_ab_data.pth.zip](https://github.com/facebookresearch/pytorch3d/files/14826995/bbox_ab_data.pth.zip)
)
```
import torch
from pytorch3d.ops import box3d_overlap

# unzip attached file, and fill its path here
[bbox_ab_data.pth.zip](https://github.com/facebookresearch/pytorch3d/files/14826992/bbox_ab_data.pth.zip)

bbox_ab_data_file = # FILEPATH
bbox_ab_data = torch.load(bbox_ab_data_file)

box_a = bbox_ab_data["box_a"].unsqueeze(0)
box_b = bbox_ab_data["box_b"].unsqueeze(0)
print(box_a)
print(box_b)

# compute IOU
vol_in, iou = box3d_overlap(box_a, box_b)
print(vol_in, iou)
"""
expected output:

tensor([[1.0696]]) tensor([[1.1747]])
"""
```
We validated this issue by several different methods such as random sampling, convex hull implementation, objectron implementation, and the Pytorch3D's IOU is indeed giving larger than 1 values.

Contributor guide

Open the contributing guide

Research direction

Start with the provided reproducer and the box3d_overlap entry point in pytorch3d.ops. Load bbox_ab_data.pth and confirm that the reported intersection volume and IoU can exceed 1 at low eps. Trace the overlap calculation and add a regression test using the supplied boxes; done means the IoU is no greater than 1 and existing overlap tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.