diff --git a/main.py b/main.py index 19f825c7..5ef8b833 100644 --- a/main.py +++ b/main.py @@ -70,8 +70,8 @@ if opt.O: opt.fp16 = True - opt.cuda_ray = True opt.dir_text = True + opt.cuda_ray = True elif opt.O2: opt.fp16 = True opt.dir_text = True diff --git a/nerf/renderer.py b/nerf/renderer.py index 005fc7d4..64dd2733 100644 --- a/nerf/renderer.py +++ b/nerf/renderer.py @@ -323,7 +323,7 @@ def run(self, rays_o, rays_d, num_steps=128, upsample_steps=128, light_d=None, a # random sample light_d if not provided if light_d is None: # gaussian noise around the ray origin, so the light always face the view dir (avoid dark face) - light_d = - (rays_o[0] + torch.randn(3, device=device, dtype=torch.float)) + light_d = (rays_o[0] + torch.randn(3, device=device, dtype=torch.float)) light_d = safe_normalize(light_d) #print(f'nears = {nears.min().item()} ~ {nears.max().item()}, fars = {fars.min().item()} ~ {fars.max().item()}') @@ -457,7 +457,7 @@ def run_cuda(self, rays_o, rays_d, dt_gamma=0, light_d=None, ambient_ratio=1.0, # random sample light_d if not provided if light_d is None: # gaussian noise around the ray origin, so the light always face the view dir (avoid dark face) - light_d = - (rays_o[0] + torch.randn(3, device=device, dtype=torch.float)) + light_d = (rays_o[0] + torch.randn(3, device=device, dtype=torch.float)) light_d = safe_normalize(light_d) results = {}