mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 19:04:03 +08:00
remove unused sampler, normalize predicted normals from network
This commit is contained in:
1 parent
0fc4495348
commit
4059cbaddb
2 files changed
+2
-2
No files matched your search
@@ -43,6 +43,7 @@ from nerfstudio.field_components.spatial_distortions import (
|
||||
SpatialDistortion,
|
||||
)
|
||||
from nerfstudio.fields.base_field import Field
|
||||
from nerfstudio.utils import colormaps, colors, math
|
||||
|
||||
try:
|
||||
import tinycudann as tcnn
|
||||
@@ -208,7 +209,7 @@ class DreamFusionField(Field):
|
||||
pred_normals_inp = torch.cat([positions_flat, density_embedding.view(-1, self.geo_feat_dim)], dim=-1)
|
||||
|
||||
x = self.mlp_pred_normals(pred_normals_inp).view(*outputs_shape, -1).to(directions)
|
||||
outputs[FieldHeadNames.PRED_NORMALS] = self.field_head_pred_normals(x)
|
||||
outputs[FieldHeadNames.PRED_NORMALS] = math.safe_normalize(self.field_head_pred_normals(x))
|
||||
|
||||
h = density_embedding.view(-1, self.geo_feat_dim)
|
||||
|
||||
|
||||
@@ -149,7 +149,6 @@ class DreamFusionModel(Model):
|
||||
|
||||
# samplers
|
||||
self.sampler_uniform = UniformSampler(num_samples=self.num_samples, single_jitter=True)
|
||||
self.sampler_pdf = PDFSampler(num_samples=self.num_samples // 2, single_jitter=True)
|
||||
|
||||
# renderers
|
||||
self.renderer_rgb = RGBRenderer(background_color=colors.WHITE)
|
||||
|
||||
Reference in new issue
Block a user