Typecheck workspace (#231)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-07-30 15:38:08 -07:00
1 parent db9d83093a
commit 6c45f72c57
19 files changed
+151 -90

No files matched your search

+6 -2
View File
@@ -128,11 +128,15 @@ class VanillaNerfWField(Field):
"""
outputs = {}
encoded_dir = self.direction_encoding(ray_samples.frustums.directions)
if ray_samples.camera_indices is None:
raise AttributeError("Camera indices are not provided.")
embedded_appearance = self.embedding_appearance(ray_samples.camera_indices.squeeze())
mlp_head_out = self.mlp_head(torch.cat([density_embedding, encoded_dir, embedded_appearance], dim=-1))
mlp_in = torch.cat([density_embedding, encoded_dir, embedded_appearance], dim=-1) # type: ignore
mlp_head_out = self.mlp_head(mlp_in)
outputs[self.field_head_rgb.field_head_name] = self.field_head_rgb(mlp_head_out) # static rgb
embedded_transient = self.embedding_transient(ray_samples.camera_indices.squeeze())
transient_mlp_out = self.mlp_transient(torch.cat([density_embedding, embedded_transient], dim=-1))
transient_mlp_in = torch.cat([density_embedding, embedded_transient], dim=-1) # type: ignore
transient_mlp_out = self.mlp_transient(transient_mlp_in)
outputs[self.field_head_transient_uncertainty.field_head_name] = self.field_head_transient_uncertainty(
transient_mlp_out
) # uncertainty