Skip to content

bug : Update gaussian_model.py 154-155 lines - #1333

Open
learnLearnDayUp wants to merge 1 commit into
graphdeco-inria:mainfrom
learnLearnDayUp:patch-1
Open

bug : Update gaussian_model.py 154-155 lines#1333
learnLearnDayUp wants to merge 1 commit into
graphdeco-inria:mainfrom
learnLearnDayUp:patch-1

Conversation

@learnLearnDayUp

Copy link
Copy Markdown

Description : During code study, I found a minor issue in the create_from_pcd function when initializing SH features
Current code:

features = torch.zeros((fused_color.shape[0], 3, (self.max_sh_degree + 1) ** 2)).float().cuda()
features[:, :3, 0] = fused_color
features[:, 3:, 1:] = 0.0

Problem:
The second dimension of features is exactly 3 (RGB channels), so :3 is redundant
features[:, 3:, 1:] will produce an empty slice since dimension 1 only has indices 0,1,2

Proposed fix:

features = torch.zeros((fused_color.shape[0], 3, (self.max_sh_degree + 1) ** 2)).float().cuda()
features[:, :, 0] = fused_color
features[:, :, 1:] = 0.0

This sets the DC component (index 0) for all RGB channels to the initial color, and zeros out all higher-order SH coefficients. The functionality remains identical, but the code is cleaner and avoids unnecessary slicing.

Impact: No functional change, just code clarity improvement。

Description : During code study, I found a minor issue in the create_from_pcd function when initializing SH features
Current code: 
    features[:, :3, 0] = fused_color
    features[:, 3:, 1:] = 0.0
Proposed fix:
    features[:, :, 0] = fused_color
    features[:, :, 1:] = 0.0
Impact: No functional change, just code clarity improvement。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant