facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.7k stars 1.3k forks source link

Inconsistent box3d_overlap's iou3d depending on the arguments order #1868

Open BartlomiejOlber opened 1 week ago

BartlomiejOlber commented 1 week ago
from pytorch3d.ops import box3d_overlap

corners1 = torch.tensor([[[677.59423828125, 1565.7000732421875, 0.2792315185070038],
                          [675.9971313476562, 1566.979736328125, 0.3516670763492584],
                          [672.6110229492188, 1562.760009765625, 0.2355925589799881],
                          [674.2081298828125, 1561.48046875, 0.16315698623657227],
                          [677.62109375, 1565.62646484375, 2.1715939044952393],
                          [676.0239868164062, 1566.9061279296875, 2.2440295219421387],
                          [672.6378173828125, 1562.6864013671875, 2.1279549598693848],
                          [674.2349853515625, 1561.4068603515625, 2.0555195808410645]]])

corners2 = torch.tensor([[[677.1073608398438, 1565.327880859375, 0.4230000078678131],
                          [675.630859375, 1566.475341796875, 0.4230000078678131],
                          [672.6626586914062, 1562.6561279296875, 0.4230000078678131],
                          [674.13916015625, 1561.5086669921875, 0.4230000078678131],
                          [677.1073608398438, 1565.327880859375, 2.4230000972747803],
                          [675.630859375, 1566.475341796875, 2.4230000972747803],
                          [672.6626586914062, 1562.6561279296875, 2.4230000972747803],
                          [674.13916015625, 1561.5086669921875, 2.4230000972747803]]])

print(box3d_overlap(corners1, corners2)[1])

print(box3d_overlap(corners2, corners1)[1])

output:

tensor([[0.5706]]) tensor([[0.7511]])

torch version: 1.11.0+cu113 pytorch3d version: 0.7.2

bottler commented 1 week ago

This is another instability with a difficult case I suspect. there's no obvious solution as far as I know