Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNeRF committed Sep 27, 2024
1 parent c4e4f6c commit 9fafbb3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ compile_commands.json
# Visual Studio Code configs.
.vscode/

# Pycharm
.idea

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
8 changes: 6 additions & 2 deletions examples/simple_trainer_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,12 @@ def train(self):

# eval the full set
if step in [i - 1 for i in cfg.eval_steps]:
self.eval(step)
# self.render_traj(step)
self.eval(
step,
n_feat_offsets=self.cfg.n_feat_offsets,
feat_dim=self.cfg.feat_dim,
)
self.render_traj(step)

if not cfg.disable_viewer:
self.viewer.lock.release()
Expand Down
5 changes: 2 additions & 3 deletions gsplat/strategy/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import torch
import torch.nn.functional as F
from torch import Tensor
from torch_scatter import scatter_max

from gsplat import quat_scale_to_covar_preci
from gsplat.relocation import compute_relocation
Expand Down Expand Up @@ -417,8 +416,8 @@ def grow_anchors(
selected_features = repeated_features[gradient_mask] # [N_selected, feat_dim]

# Use inverse_indices to aggregate features
scattered_features, _ = scatter_max(
selected_features, inv_idx.unsqueeze(1).expand(-1, feat_dim), dim=0
scattered_features = torch.segment_reduce(
data=selected_features, reduce="amax", lengths=torch.bincount(inv_idx)
)
feat = scattered_features[remove_duplicates_mask] # [N_new, feat_dim]

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def get_extensions():
"jaxtyping",
"rich>=12",
"torch",
"torch_scatter",
"typing_extensions; python_version<'3.8'",
],
extras_require={
Expand Down

0 comments on commit 9fafbb3

Please sign in to comment.