Skip to content

Commit

Permalink
eps fix for iou3d
Browse files Browse the repository at this point in the history
Summary: Fix EPS issue that causes numerical instabilities when boxes are very close

Reviewed By: kjchalup

Differential Revision: D38661465

fbshipit-source-id: d2b6753cba9dc2f0072ace5289c9aa815a1a29f6
  • Loading branch information
gkioxari authored and facebook-github-bot committed Aug 22, 2022
1 parent 06cbba2 commit 1bfe6bf
Show file tree
Hide file tree
Showing 5 changed files with 923 additions and 188 deletions.
4 changes: 2 additions & 2 deletions pytorch3d/csrc/iou_box3d/iou_box3d.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ __global__ void IoUBox3DKernel(
for (int b1 = 0; b1 < box1_count; ++b1) {
for (int b2 = 0; b2 < box2_count; ++b2) {
const bool is_coplanar =
IsCoplanarFace(box1_intersect[b1], box2_intersect[b2]);
IsCoplanarTriTri(box1_intersect[b1], box2_intersect[b2]);
const float area = FaceArea(box1_intersect[b1]);
if ((is_coplanar) && (area > kEpsilon)) {
if ((is_coplanar) && (area > aEpsilon)) {
tri2_keep[b2].keep = false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pytorch3d/csrc/iou_box3d/iou_box3d_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ std::tuple<at::Tensor, at::Tensor> IoUBox3DCpu(
for (int b1 = 0; b1 < box1_intersect.size(); ++b1) {
for (int b2 = 0; b2 < box2_intersect.size(); ++b2) {
const bool is_coplanar =
IsCoplanarFace(box1_intersect[b1], box2_intersect[b2]);
IsCoplanarTriTri(box1_intersect[b1], box2_intersect[b2]);
const float area = FaceArea(box1_intersect[b1]);
if ((is_coplanar) && (area > kEpsilon)) {
if ((is_coplanar) && (area > aEpsilon)) {
tri2_keep[b2] = 0;
}
}
Expand Down
Loading

0 comments on commit 1bfe6bf

Please sign in to comment.