mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 05:48:57 +08:00
Occupancy grid (#79)
* occupancy grid in progress * visualizing occupancy grid. currently restructing field and renderer head outputs * black and pylint. broke nerfw and semantic nerf but it's okay * get_project_root
This commit is contained in:
1 parent
5c2d8c2a0b
commit
fb440fedf3
23 files changed
+423
-217
No files matched your search
@@ -11,6 +11,15 @@ from torchtyping import TensorType
|
||||
from mattport.utils.misc import is_not_none
|
||||
|
||||
|
||||
@dataclass
|
||||
class PointSamples:
|
||||
"""Samples in space."""
|
||||
|
||||
positions: TensorType[..., 3] = None
|
||||
directions: TensorType[..., 3] = None
|
||||
camera_indices: TensorType[..., 1] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class RayBundle:
|
||||
"""_summary_
|
||||
@@ -137,6 +146,11 @@ class RaySamples:
|
||||
self.directions = ray_bundle.directions.unsqueeze(1).repeat(1, self.positions.shape[1], 1)
|
||||
self.deltas = self.get_deltas()
|
||||
|
||||
def to_point_samples(self):
|
||||
"""Convert to PointSamples instance and return."""
|
||||
# TODO: make this more interpretable
|
||||
return PointSamples(positions=self.positions, directions=self.directions)
|
||||
|
||||
def get_camera_indices(self):
|
||||
"""Returns camera indices."""
|
||||
assert not isinstance(self.ray_bundle.camera_indices, type(None)), "Camera indices cannot be None here."
|
||||
|
||||
Reference in new issue
Block a user