From a281d99eac12073bea5918353457c85aaecee286 Mon Sep 17 00:00:00 2001 From: "J.Y." <132313008+jb-ye@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:11:12 -0400 Subject: [PATCH] bug fix for splatfacto (#3367) * bug fix for splatfacto * fix core tests * Remove ipynb exclude for ruff, will fix in #3369 --------- Co-authored-by: Brent Yi --- nerfstudio/models/splatfacto.py | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nerfstudio/models/splatfacto.py b/nerfstudio/models/splatfacto.py index 05587c642..a6881d424 100644 --- a/nerfstudio/models/splatfacto.py +++ b/nerfstudio/models/splatfacto.py @@ -472,9 +472,9 @@ class SplatfactoModel(Model): avg_grad_norm = (self.xys_grad_norm / self.vis_counts) * 0.5 * max(self.last_size[0], self.last_size[1]) high_grads = (avg_grad_norm > self.config.densify_grad_thresh).squeeze() splits = (self.scales.exp().max(dim=-1).values > self.config.densify_size_thresh).squeeze() + splits &= high_grads if self.step < self.config.stop_screen_size_at: splits |= (self.max_2Dsize > self.config.split_screen_size).squeeze() - splits &= high_grads nsamps = self.config.n_split_samples split_params = self.split_gaussians(splits, nsamps) diff --git a/pyproject.toml b/pyproject.toml index 06600e94b..753c12762 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -190,6 +190,7 @@ lint.ignore = [ "PLR0912", # Too many branches. "PLW0603", # Globa statement updates are discouraged. "PLW2901", # For loop variable overwritten. + "PLR1730", # Replace if statement with min/max ] [tool.ruff.lint.isort]