Skip to content

Commit

Permalink
1- add LLFF_NDC_SCENES, 2- remove distortionloss
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakiba Kheradmand committed Dec 19, 2023
1 parent 9d49383 commit cbcc798
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/losses.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import torch
import torch.nn as nn

from nerfacc.losses import DistortionLoss
class NeRFLoss(nn.Module):
def __init__(self, lambda_opacity=0.0, lambda_distortion=0.01):
super().__init__()
Expand All @@ -19,6 +18,7 @@ def forward(self, rgb, target, opp=None, distkwargs=None):
d['opacity'] = self.lambda_opacity*(-o*torch.log(o))

if self.lambda_distortion > 0 and distkwargs is not None:
from nerfacc.losses import DistortionLoss
d['distortion'] = self.lambda_distortion * \
DistortionLoss.apply(distkwargs['ws'], distkwargs['deltas'],
distkwargs['ts'], distkwargs['rays_a'])
Expand Down
11 changes: 11 additions & 0 deletions examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@
"stump",
]

LLFF_NDC_SCENES = [
"fern",
"flower",
"fortress",
"horns",
"leaves",
"orchids",
"room_llff",
"trex",
]


def set_random_seed(seed):
random.seed(seed)
Expand Down

0 comments on commit cbcc798

Please sign in to comment.