Skip to content

Commit

Permalink
Merge pull request #49 from pierotofy/basefix
Browse files Browse the repository at this point in the history
Fix SH degrees variable mismatch
  • Loading branch information
pierotofy authored Mar 21, 2024
2 parents 95d5abb + c9c71d4 commit 2e99438
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ torch::Tensor Model::forward(Camera& cam, int step){

rgbs = torch::clamp_min(rgbs + 0.5f, 0.0f);


if (device == torch::kCPU){
rgb = RasterizeGaussiansCPU::apply(
xys,
Expand Down
4 changes: 2 additions & 2 deletions vendor/gsplat-cpu/gsplat_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ torch::Tensor compute_sh_forward_tensor_cpu(
const int numChannels = 3;
unsigned numBases = numShBases(degrees_to_use);

torch::Tensor result = torch::zeros({viewdirs.size(0), numBases}, torch::TensorOptions().dtype(torch::kFloat32).device(viewdirs.device()));
torch::Tensor result = torch::zeros({viewdirs.size(0), numShBases(degree)}, torch::TensorOptions().dtype(torch::kFloat32).device(viewdirs.device()));

result.index_put_({"...", 0}, SH_C0);
if (numBases > 1){
Expand Down Expand Up @@ -478,6 +478,6 @@ torch::Tensor compute_sh_forward_tensor_cpu(
}
}
}

return (result.index({"...", None}) * coeffs).sum(-2);
}

0 comments on commit 2e99438

Please sign in to comment.