Computing and predicting normals (#905)

* staring normals PR

* code runs but visualization looks bad

* Camera and world coordinate conventions (#889)

* documented coordinate conventions without a figure for now

* another sentence

* update frames docs

* explain intrinsics and extrinsics

* more comments

* fix build

* Start viewer with more accurate speed calculation (#899)

Start viewer with more accurate speed calc

* Minor doc updates (#903)

* fix conflicts

* code runs but visualization looks bad

* normals implemented and vis fixed. still debugging quality

* minor name change

* comment

* fix black

* lint

* predicting normals

* adding detach

* predicted normals

* improved normals prediction performance

* cleaning code

* cleaning code

* cleaning code

* adding type to function param

* fixing tensorf forward func

* reverting tensorf changes

* fix style with tensorf field

* adding normals check to tensorffield

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
Co-authored-by: terrance <terrance.3512@gmail.com>
This commit is contained in:
authored and GitHub committed 2022-11-20 13:22:37 -08:00
1 parent a82d19f549
commit b829499c12
8 files changed
+204 -17

No files matched your search

+7 -1
View File
@@ -111,8 +111,14 @@ class TensoRFField(Field):
return rgb
def forward(
self, ray_samples: RaySamples, mask: Optional[TensorType] = None, bg_color: Optional[TensorType] = None
self,
ray_samples: RaySamples,
compute_normals: bool = False,
mask: Optional[TensorType] = None,
bg_color: Optional[TensorType] = None,
):
if compute_normals is True:
raise ValueError("Surface normals are not currently supported with TensoRF")
if mask is not None and bg_color is not None:
base_density = torch.zeros(ray_samples.shape)[:, :, None].to(mask.device)
base_rgb = bg_color.repeat(ray_samples[:, :, None].shape)