mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-24 18:14:16 +08:00
Setting near and far with scene bounds collider. Also LR schedules. (#74)
* some initial cuda code as I learn. using git to save progress. * first cuda kernel for ray sampling that mostly works * cleaning up code. working on lr. structs for scene bounds aabb * added scene bounds collider code * updated setup * setup * setup * black * including some files * exporting env variable * new file * git workflows * github actions * github actions * github actions * removing env var
This commit is contained in:
1 parent
752df417ce
commit
676beebb14
45 files changed
+803
-8354
No files matched your search
@@ -5,6 +5,7 @@ import torch
|
||||
from mattport.nerf.sampler import PDFSampler, UniformSampler
|
||||
|
||||
from mattport.structures.rays import RayBundle
|
||||
from mattport.nerf.field_modules.scene_bounds_collider import NearFarCollider
|
||||
|
||||
|
||||
def test_uniform_sampler():
|
||||
@@ -12,11 +13,13 @@ def test_uniform_sampler():
|
||||
near_plane = 2
|
||||
far_plane = 4
|
||||
num_samples = 15
|
||||
sampler = UniformSampler(near_plane=near_plane, far_plane=far_plane, num_samples=num_samples)
|
||||
sampler = UniformSampler(num_samples=num_samples)
|
||||
|
||||
origins = torch.zeros((10, 3))
|
||||
directions = torch.ones_like(origins)
|
||||
ray_bundle = RayBundle(origins=origins, directions=directions)
|
||||
collider = NearFarCollider(near_plane, far_plane)
|
||||
ray_bundle = collider(ray_bundle)
|
||||
|
||||
ray_samples = sampler(ray_bundle)
|
||||
|
||||
@@ -34,8 +37,10 @@ def test_pdf_sampler():
|
||||
origins = torch.zeros((10, 3))
|
||||
directions = torch.ones_like(origins)
|
||||
ray_bundle = RayBundle(origins=origins, directions=directions)
|
||||
collider = NearFarCollider(near_plane, far_plane)
|
||||
ray_bundle = collider(ray_bundle)
|
||||
|
||||
uniform_sampler = UniformSampler(near_plane=near_plane, far_plane=far_plane, num_samples=num_samples)
|
||||
uniform_sampler = UniformSampler(num_samples=num_samples)
|
||||
coarse_ray_samples = uniform_sampler(ray_bundle)
|
||||
|
||||
weights = torch.ones((10, num_samples))
|
||||
|
||||
Reference in new issue
Block a user