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:
Ethan Weber authored and GitHub committed 2022-05-17 19:09:25 -07:00
1 parent 5c2d8c2a0b
commit fb440fedf3
23 files changed
+423 -217

No files matched your search

+14
View File
@@ -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."