mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 13:59:10 +08:00
Fix crop robustness (#1321)
This commit is contained in:
1 parent
f3b3a517e8
commit
79395ecd8d
2 files changed
+10
-4
No files matched your search
@@ -147,6 +147,8 @@ class Cameras(TensorDataclass):
|
||||
|
||||
self.__post_init__() # This will do the dataclass post_init and broadcast all the tensors
|
||||
|
||||
self._use_nerfacc = strtobool(os.environ.get("INTERSECT_WITH_NERFACC", "TRUE"))
|
||||
|
||||
def _init_get_fc_xy(self, fc_xy, name):
|
||||
"""
|
||||
Parses the input focal length / principle point x or y and returns a tensor of the correct shape
|
||||
@@ -470,9 +472,13 @@ class Cameras(TensorDataclass):
|
||||
rays_o = rays_o.reshape((-1, 3))
|
||||
rays_d = rays_d.reshape((-1, 3))
|
||||
|
||||
if strtobool(os.environ.get("INTERSECT_WITH_NERFACC", "TRUE")):
|
||||
nerfacc = importlib.import_module("nerfacc")
|
||||
t_min, t_max = nerfacc.ray_aabb_intersect(rays_o, rays_d, tensor_aabb)
|
||||
if self._use_nerfacc:
|
||||
try:
|
||||
nerfacc = importlib.import_module("nerfacc")
|
||||
t_min, t_max = nerfacc.ray_aabb_intersect(rays_o, rays_d, tensor_aabb)
|
||||
except: # pylint: disable=bare-except
|
||||
t_min, t_max = nerfstudio.utils.math.intersect_aabb(rays_o, rays_d, tensor_aabb)
|
||||
self._use_nerfacc = False
|
||||
else:
|
||||
t_min, t_max = nerfstudio.utils.math.intersect_aabb(rays_o, rays_d, tensor_aabb)
|
||||
|
||||
|
||||
Reference in new issue
Block a user