Commit 2293f1fe authored by Nikhila Ravi's avatar Nikhila Ravi Committed by Facebook GitHub Bot
Browse files

IoU for 3D boxes

Summary:
I have implemented an exact solution for 3D IoU of oriented 3D boxes.

This file includes:
* box3d_overlap: which computes the exact IoU of box1 and box2
* box3d_overlap_sampling: which computes an approximate IoU of box1 and box2 by sampling points within the boxes

Note that both implementations currently do not support batching.

Our exact IoU implementation is based on the fact that the intersecting shape of the two 3D boxes will be formed by segments of the surface of the boxes. Our algorithm computes these segments by reasoning whether triangles of one box are within the second box and vice versa. We deal with intersecting triangles by clipping them.

Reviewed By: gkioxari

Differential Revision: D30667497

fbshipit-source-id: 2f747f410f90b7f854eeaf3036794bc3ac982917
parent 5b89c4e3
......@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.
from random import randint
from typing import Optional, Tuple, Union, List
from typing import List, Optional, Tuple, Union
import torch
from pytorch3d import _C
......
This diff is collapsed.
......@@ -10,17 +10,18 @@ import numpy as np
import torch
from common_testing import (
TestCaseMixin,
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
get_pytorch3d_dir,
)
from pytorch3d.io import load_obj
from pytorch3d.ops.sample_farthest_points import (
sample_farthest_points_naive,
sample_farthest_points,
sample_farthest_points_naive,
)
from pytorch3d.ops.utils import masked_gather
DATA_DIR = get_tests_dir() / "data"
TUTORIAL_DATA_DIR = get_pytorch3d_dir() / "docs/tutorials/data"
DEBUG = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment