From e9b6a079cc15e1ea49183f7e429bfbd08ef7bd29 Mon Sep 17 00:00:00 2001 From: jb-ye Date: Thu, 22 Aug 2024 04:12:21 +0000 Subject: [PATCH] Fix a bug in scaling screen space grads --- gsplat/strategy/default.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gsplat/strategy/default.py b/gsplat/strategy/default.py index 30ffae6cd..4ca16eef4 100644 --- a/gsplat/strategy/default.py +++ b/gsplat/strategy/default.py @@ -210,8 +210,7 @@ def _update_state( grads = info["means2d"].absgrad.clone() else: grads = info["means2d"].grad.clone() - grads[..., 0] *= info["width"] / 2.0 * info["n_cameras"] - grads[..., 1] *= info["height"] / 2.0 * info["n_cameras"] + grads *= max(info["width"], info["height"]) / 2.0 * info["n_cameras"] # initialize state on the first run n_gaussian = len(list(params.values())[0])