mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 21:39:06 +08:00
dataloader logic, new folder structure, flatter configs (#26)
* renaming dataloader to data. adding some dataloader classes * restructuring configs * fixed instant ngp tcnn direction rescaling * working through test cases * black and lint and tests
This commit is contained in:
1 parent
24c1c77ef1
commit
457788d689
105 files changed
+8828
-682
No files matched your search
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Code to test the occupancy grid.
|
||||
"""
|
||||
|
||||
import torch
|
||||
from pyrad.fields.occupancy_fields.occupancy_grid import OccupancyGrid
|
||||
|
||||
|
||||
def test_occupancy_grid():
|
||||
"""For testing the occupancy grid."""
|
||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||
num_cascades = 1
|
||||
resolution = 128
|
||||
aabb = torch.tensor([[-1, -1, -1], [1, 1, 1]], dtype=torch.float32).to(device)
|
||||
grid = OccupancyGrid(num_cascades, resolution, aabb)
|
||||
grid.to(device)
|
||||
density_fn = lambda x: x[..., 0:1] # xyz (..., 3) => density (...,)
|
||||
grid.update_occupancy_grid(density_fn=density_fn)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_occupancy_grid()
|
||||
Reference in new issue
Block a user