Image dataset implemented and ray generation working. (#23)

* working data loader code

* adding gitignore

* fixing linting errors

* set black line length in settings file

* update

* fixed filepath

* black format

* tqdm
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-04-17 09:26:44 -07:00
1 parent 9bc83b0ed2
commit e38040ee4d
23 files changed
+529 -277

No files matched your search

+6 -2
View File
@@ -1,12 +1,16 @@
"""
Test the camera classes.
"""
import torch
from mattport.structures.cameras import PinholeCamera
from mattport.structures.rays import RayBundle, CameraRayBundle
from mattport.structures.rays import CameraRayBundle
def test_pinhole_camera():
"""Test that the pinhole camera model works."""
pinhole_camera = PinholeCamera(cx=400.0, cy=400.0, fx=10.0, fy=10.0)
camera_ray_bundle = pinhole_camera.generate_camera_rays()
assert isinstance(camera_ray_bundle, CameraRayBundle)
assert torch.allclose(camera_ray_bundle.origins[0], torch.tensor([0.0, 0.0, 0.0]))
# assert False