Skip to content

Commit 1bfe6bf

Browse files
gkioxarifacebook-github-bot
authored andcommitted
eps fix for iou3d
Summary: Fix EPS issue that causes numerical instabilities when boxes are very close Reviewed By: kjchalup Differential Revision: D38661465 fbshipit-source-id: d2b6753cba9dc2f0072ace5289c9aa815a1a29f6
1 parent 06cbba2 commit 1bfe6bf

File tree

5 files changed

+923
-188
lines changed

5 files changed

+923
-188
lines changed

pytorch3d/csrc/iou_box3d/iou_box3d.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ __global__ void IoUBox3DKernel(
8888
for (int b1 = 0; b1 < box1_count; ++b1) {
8989
for (int b2 = 0; b2 < box2_count; ++b2) {
9090
const bool is_coplanar =
91-
IsCoplanarFace(box1_intersect[b1], box2_intersect[b2]);
91+
IsCoplanarTriTri(box1_intersect[b1], box2_intersect[b2]);
9292
const float area = FaceArea(box1_intersect[b1]);
93-
if ((is_coplanar) && (area > kEpsilon)) {
93+
if ((is_coplanar) && (area > aEpsilon)) {
9494
tri2_keep[b2].keep = false;
9595
}
9696
}

pytorch3d/csrc/iou_box3d/iou_box3d_cpu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ std::tuple<at::Tensor, at::Tensor> IoUBox3DCpu(
8080
for (int b1 = 0; b1 < box1_intersect.size(); ++b1) {
8181
for (int b2 = 0; b2 < box2_intersect.size(); ++b2) {
8282
const bool is_coplanar =
83-
IsCoplanarFace(box1_intersect[b1], box2_intersect[b2]);
83+
IsCoplanarTriTri(box1_intersect[b1], box2_intersect[b2]);
8484
const float area = FaceArea(box1_intersect[b1]);
85-
if ((is_coplanar) && (area > kEpsilon)) {
85+
if ((is_coplanar) && (area > aEpsilon)) {
8686
tri2_keep[b2] = 0;
8787
}
8888
}

0 commit comments

Comments
 (0)