mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-16 04:43:52 +08:00
Add sampler
This commit is contained in:
1 parent
bf3b77f952
commit
5ee9669b2c
4 files changed
+105
-50
No files matched your search
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
Test samplers
|
||||
"""
|
||||
from random import uniform
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from mattport.nerf import sampler
|
||||
from mattport.structures.cameras import Rays
|
||||
|
||||
|
||||
def test_uniform_sampler():
|
||||
"""Test uniform sampler"""
|
||||
uniform_sampler = sampler.UniformSampler()
|
||||
|
||||
origins = torch.zeros((10, 3))
|
||||
directions = torch.ones_like(origins)
|
||||
camera_rays = Rays(origin=origins, direction=directions)
|
||||
|
||||
|
||||
def test_pdf_sampler():
|
||||
"""Test uniform sampler"""
|
||||
# TODO Tancik: Add more precise tests
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_uniform_sampler()
|
||||
Reference in new issue
Block a user