mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 07:48:50 +08:00
CropBox GUI implementation (#1205)
* fixed an exception bug in case of num_samples is 0 fixed an exception bug when num samples is 0 , "IndexError tensors used as indices must be long, byte or bool tensors" change type to long ( was float32) * implemented crop box in gui. For now works on instant-ngp-bounded * fixed import bugs * update aabb every time and not only on training * prevent crash when chosing accomulation and crop box * Checkbox * max_box is bounded by scevne box in the gui * implemented altenative intesection to nerfacc * convert str to bool correctly * fixed isort bug * fixed isort bug2 * update viewer version * remove json bug * Update UI * Force black background * Fix formatting Co-authored-by: dror <you@example.com> Co-authored-by: Matt Tancik <tancik@berkeley.edu> Co-authored-by: Matthew Tancik <mattt4001@gmail.com>
This commit is contained in:
12 files changed
+518
-25
No files matched your search
@@ -449,6 +449,15 @@ class VolumetricSampler(Sampler):
|
||||
|
||||
rays_o = ray_bundle.origins.contiguous()
|
||||
rays_d = ray_bundle.directions.contiguous()
|
||||
|
||||
if ray_bundle.nears is not None and ray_bundle.fars is not None:
|
||||
t_min = ray_bundle.nears.contiguous().reshape(-1)
|
||||
t_max = ray_bundle.fars.contiguous().reshape(-1)
|
||||
|
||||
else:
|
||||
t_min = None
|
||||
t_max = None
|
||||
|
||||
if ray_bundle.camera_indices is not None:
|
||||
camera_indices = ray_bundle.camera_indices.contiguous()
|
||||
else:
|
||||
@@ -457,6 +466,8 @@ class VolumetricSampler(Sampler):
|
||||
ray_indices, starts, ends = nerfacc.ray_marching(
|
||||
rays_o=rays_o,
|
||||
rays_d=rays_d,
|
||||
t_min=t_min,
|
||||
t_max=t_max,
|
||||
scene_aabb=self.scene_aabb,
|
||||
grid=self.occupancy_grid,
|
||||
# this is a workaround - using density causes crash and damage quality. should be fixed
|
||||
|
||||
Reference in new issue
Block a user