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

Floater removal tool for splatfacto #3001

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

anniezhang2288
Copy link

No description provided.

@@ -393,7 +503,10 @@ def after_train(self, step: int):
with torch.no_grad():
# keep track of a moving average of grad norms
visible_mask = (self.radii > 0).flatten()
assert self.xys.grad is not None
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to if self.xys.grad is None: return

# Create the button with the modified callback
self.button2 = ViewerButton("Delete Gaussians", cb_hook=delete_cropbox)

def select_gaussians(button: ViewerButton):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make both select_gaussians and delete_cropbox class functions? Will declutter the populate modules function

self.selected_gaussian_indices = []
self.original_colors = None

def update_colors(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function is self-contained enough that it can be defined inside on_select, that way its scope is clearer (it only gets used inside that callback).

@@ -186,6 +186,29 @@ def __init__(
):
self.seed_points = seed_points
super().__init__(*args, **kwargs)
self.selected_gaussian_indices = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's define these inside populate_submodules next to the buttons/viewer control so all the new code for initializing floater removal is in one place

@kerrj kerrj changed the title Annie/floater_removal_button Floater removal tool for splatfacto Mar 18, 2024
camera = camera.to(self.device)

self.eval()
self.get_outputs_for_camera(camera)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can surround this in a with torch.no_grad()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done! :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh i meant the get_outputs_for_camera() line

@seppestaes
Copy link

Hi! Thanks for your contribution! Any chance the changes will make it (PR)?

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.

None yet

4 participants