Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsupported camera optimization from GS #2790

Merged
merged 27 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
70ade42
fix jittering in markdown in viewer beta
kerrj Oct 11, 2023
622342c
Revert "fix jittering in markdown in viewer beta"
kerrj Oct 11, 2023
072c3ed
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Oct 18, 2023
d68138d
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Oct 19, 2023
e65d14e
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Oct 20, 2023
39637f0
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Oct 21, 2023
c30d0c8
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Oct 23, 2023
5723357
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Oct 29, 2023
8a08740
print correctly formatted url in banner for viewer beta
kerrj Oct 29, 2023
246d731
merge
kerrj Nov 1, 2023
a7b08df
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Nov 29, 2023
fa8909e
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Nov 29, 2023
eab1f7a
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Nov 30, 2023
86ff630
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Dec 13, 2023
cf41e63
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Dec 15, 2023
db13cfa
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 5, 2024
5ca2be0
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 8, 2024
172cf07
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 8, 2024
1559504
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 10, 2024
93436d4
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 17, 2024
91c6b49
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 17, 2024
c012963
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 18, 2024
9620061
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 18, 2024
e5c5601
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 18, 2024
06011f5
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 18, 2024
bf12b3e
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 18, 2024
a42d076
remove cam opt from gs
kerrj Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions nerfstudio/models/gaussian_splatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from pytorch_msssim import SSIM
from torch.nn import Parameter

from nerfstudio.cameras.camera_optimizers import CameraOptimizer, CameraOptimizerConfig
from nerfstudio.cameras.cameras import Cameras
from nerfstudio.data.scene_box import OrientedBox
from nerfstudio.engine.callbacks import TrainingCallback, TrainingCallbackAttributes, TrainingCallbackLocation
Expand Down Expand Up @@ -142,8 +141,6 @@ class GaussianSplattingModelConfig(ModelConfig):
"""stop splitting at this step"""
sh_degree: int = 3
"""maximum degree of spherical harmonics to use"""
camera_optimizer: CameraOptimizerConfig = field(default_factory=CameraOptimizerConfig)
"""camera optimizer config"""
use_scale_regularization: bool = False
"""If enabled, a scale regularization introduced in PhysGauss (https://xpandora.github.io/PhysGaussian/) is used for reducing huge spikey gaussians."""
max_gauss_ratio: float = 10.0
Expand Down Expand Up @@ -211,10 +208,6 @@ def populate_modules(self):
self.crop_box: Optional[OrientedBox] = None
self.back_color = torch.zeros(3)

self.camera_optimizer: CameraOptimizer = self.config.camera_optimizer.setup(
num_cameras=self.num_train_data, device="cpu"
)

@property
def colors(self):
if self.config.sh_degree > 0:
Expand Down Expand Up @@ -569,8 +562,6 @@ def get_param_groups(self) -> Dict[str, List[Parameter]]:
Mapping of different parameter groups
"""
gps = self.get_gaussian_param_groups()
# add camera optimizer param groups
self.camera_optimizer.get_param_groups(gps)
return gps

def _get_downscale_factor(self):
Expand All @@ -593,9 +584,6 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]:
print("Called get_outputs with not a camera")
return {}
assert camera.shape[0] == 1, "Only one camera at a time"
if self.training:
# currently relies on the branch vickie/camera-grads
self.camera_optimizer.apply_to_camera(camera)
if self.training:
background = torch.rand(3, device=self.device)
else:
Expand Down Expand Up @@ -754,7 +742,6 @@ def get_metrics_dict(self, outputs, batch) -> Dict[str, torch.Tensor]:
predicted_rgb = outputs["rgb"]
metrics_dict["psnr"] = self.psnr(predicted_rgb, gt_rgb)

self.camera_optimizer.get_metrics_dict(metrics_dict)
metrics_dict["gaussian_count"] = self.num_points
return metrics_dict

Expand Down
Loading