From b0e978da67fb4364611c6683c5f4e6e6c1d8d8cb Mon Sep 17 00:00:00 2001 From: inuex35 Date: Sun, 13 Oct 2024 11:57:48 +0900 Subject: [PATCH] delete camera params from spherical render --- gsplat/cuda/_torch_impl.py | 4 +--- gsplat/cuda/csrc/fully_fused_projection_bwd.cu | 4 ---- gsplat/cuda/csrc/fully_fused_projection_fwd.cu | 4 ---- gsplat/cuda/csrc/fully_fused_projection_packed_bwd.cu | 4 ---- gsplat/cuda/csrc/fully_fused_projection_packed_fwd.cu | 4 ---- gsplat/cuda/csrc/proj_bwd.cu | 4 ---- gsplat/cuda/csrc/proj_fwd.cu | 2 +- gsplat/cuda/csrc/utils.cuh | 8 -------- 8 files changed, 2 insertions(+), 32 deletions(-) diff --git a/gsplat/cuda/_torch_impl.py b/gsplat/cuda/_torch_impl.py index 84630fa4..dfc5c725 100644 --- a/gsplat/cuda/_torch_impl.py +++ b/gsplat/cuda/_torch_impl.py @@ -225,7 +225,6 @@ def _ortho_proj( def _spherical_proj( means: Tensor, # [C, N, 3] covars: Tensor, # [C, N, 3, 3] - Ks: Tensor, # [C, 3, 3] width: int, height: int, ) -> Tuple[Tensor, Tensor]: @@ -234,7 +233,6 @@ def _spherical_proj( Args: means: Gaussian means in camera coordinate system. [C, N, 3]. covars: Gaussian covariances in camera coordinate system. [C, N, 3, 3]. - Ks: Camera intrinsics. [C, 3, 3]. width: Image width. height: Image height. @@ -329,7 +327,7 @@ def _fully_fused_projection( elif camera_model == "pinhole": means2d, covars2d = _persp_proj(means_c, covars_c, Ks, width, height) elif camera_model == "spherical": - means2d, covars2d = _spherical_proj(means_c, covars_c, Ks, width, height) + means2d, covars2d = _spherical_proj(means_c, covars_c, width, height) else: assert_never(camera_model) diff --git a/gsplat/cuda/csrc/fully_fused_projection_bwd.cu b/gsplat/cuda/csrc/fully_fused_projection_bwd.cu index b4cc3489..9265bcf6 100644 --- a/gsplat/cuda/csrc/fully_fused_projection_bwd.cu +++ b/gsplat/cuda/csrc/fully_fused_projection_bwd.cu @@ -181,10 +181,6 @@ __global__ void fully_fused_projection_bwd_kernel( spherical_proj_vjp( mean_c, covar_c, - fx, - fy, - cx, - cy, image_width, image_height, v_covar2d, diff --git a/gsplat/cuda/csrc/fully_fused_projection_fwd.cu b/gsplat/cuda/csrc/fully_fused_projection_fwd.cu index 6b75cee6..dc0b4579 100644 --- a/gsplat/cuda/csrc/fully_fused_projection_fwd.cu +++ b/gsplat/cuda/csrc/fully_fused_projection_fwd.cu @@ -160,10 +160,6 @@ __global__ void fully_fused_projection_fwd_kernel( spherical_proj( mean_c, covar_c, - Ks[0], - Ks[4], - Ks[2], - Ks[5], image_width, image_height, covar2d, diff --git a/gsplat/cuda/csrc/fully_fused_projection_packed_bwd.cu b/gsplat/cuda/csrc/fully_fused_projection_packed_bwd.cu index b1704d9d..fe3c32a7 100644 --- a/gsplat/cuda/csrc/fully_fused_projection_packed_bwd.cu +++ b/gsplat/cuda/csrc/fully_fused_projection_packed_bwd.cu @@ -182,10 +182,6 @@ __global__ void fully_fused_projection_packed_bwd_kernel( spherical_proj_vjp( mean_c, covar_c, - fx, - fy, - cx, - cy, image_width, image_height, v_covar2d, diff --git a/gsplat/cuda/csrc/fully_fused_projection_packed_fwd.cu b/gsplat/cuda/csrc/fully_fused_projection_packed_fwd.cu index 8f0abb4d..5a40b344 100644 --- a/gsplat/cuda/csrc/fully_fused_projection_packed_fwd.cu +++ b/gsplat/cuda/csrc/fully_fused_projection_packed_fwd.cu @@ -175,10 +175,6 @@ __global__ void fully_fused_projection_packed_fwd_kernel( spherical_proj( mean_c, covar_c, - Ks[0], - Ks[4], - Ks[2], - Ks[5], image_width, image_height, covar2d, diff --git a/gsplat/cuda/csrc/proj_bwd.cu b/gsplat/cuda/csrc/proj_bwd.cu index d0bae5e8..f0853092 100644 --- a/gsplat/cuda/csrc/proj_bwd.cu +++ b/gsplat/cuda/csrc/proj_bwd.cu @@ -113,10 +113,6 @@ __global__ void proj_bwd_kernel( spherical_proj_vjp( mean, covar, - fx, - fy, - cx, - cy, width, height, glm::transpose(v_covar2d), diff --git a/gsplat/cuda/csrc/proj_fwd.cu b/gsplat/cuda/csrc/proj_fwd.cu index a7e44be9..e978c7bb 100644 --- a/gsplat/cuda/csrc/proj_fwd.cu +++ b/gsplat/cuda/csrc/proj_fwd.cu @@ -64,7 +64,7 @@ __global__ void proj_fwd_kernel( fisheye_proj(mean, covar, fx, fy, cx, cy, width, height, covar2d, mean2d); break; case CameraModelType::SPHERICAL: // spherical projection - spherical_proj(mean, covar, fx, fy, cx, cy, width, height, covar2d, mean2d); + spherical_proj(mean, covar, width, height, covar2d, mean2d); break; } diff --git a/gsplat/cuda/csrc/utils.cuh b/gsplat/cuda/csrc/utils.cuh index 1b392a4b..a9c29438 100644 --- a/gsplat/cuda/csrc/utils.cuh +++ b/gsplat/cuda/csrc/utils.cuh @@ -521,10 +521,6 @@ inline __device__ void spherical_proj( // inputs const vec3 mean3d, const mat3 cov3d, - const T fx, - const T fy, - const T cx, - const T cy, const uint32_t width, const uint32_t height, // outputs @@ -565,10 +561,6 @@ inline __device__ void spherical_proj_vjp( // fwd inputs const vec3 mean3d, const mat3 cov3d, - const T fx, - const T fy, - const T cx, - const T cy, const uint32_t width, const uint32_t height, // grad outputs