From f11001b46c5c73a0a7d553353c898efd68412abe Mon Sep 17 00:00:00 2001 From: bkerbl Date: Mon, 23 Oct 2023 16:02:30 +0200 Subject: [PATCH] Random background flag added --- arguments/__init__.py | 1 + train.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arguments/__init__.py b/arguments/__init__.py index 1793b47..1e13a55 100644 --- a/arguments/__init__.py +++ b/arguments/__init__.py @@ -86,6 +86,7 @@ class OptimizationParams(ParamGroup): self.densify_from_iter = 500 self.densify_until_iter = 15_000 self.densify_grad_threshold = 0.0002 + self.random_background = False super().__init__(parser, "Optimization Parameters") def get_combined_args(parser : ArgumentParser): diff --git a/train.py b/train.py index 36faf0d..5d819b3 100644 --- a/train.py +++ b/train.py @@ -80,7 +80,10 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoi # Render if (iteration - 1) == debug_from: pipe.debug = True - render_pkg = render(viewpoint_cam, gaussians, pipe, background) + + bg = torch.rand((3), device="cuda") if opt.random_background else background + + render_pkg = render(viewpoint_cam, gaussians, pipe, bg) image, viewspace_point_tensor, visibility_filter, radii = render_pkg["render"], render_pkg["viewspace_points"], render_pkg["visibility_filter"], render_pkg["radii"] # Loss