viser icon indicating copy to clipboard operation
viser copied to clipboard

3DGS editing problems

Open SmthFail opened this issue 10 months ago • 4 comments

Hi all! Is it a way to edit 3DGS scene? I can load .ply file and splats visualize prettry cool. But i want change some parameters of splats (e.g. color). I see that viser.GaussianSplatHandle has field "buffer" but it seems that i can't assign modified buffer. Is it correct and this field is readonly or Im wrong and it is possible?

SmthFail avatar Mar 11 '25 12:03 SmthFail

Hi! For updating Gaussians, the best we can do is replace the whole buffer.

Assigning to the .buffer attribute should work, eg splat_handle.buffer = new_buffer, but constructing the buffer is a little bit involved:

https://github.com/nerfstudio-project/viser/blob/0cb94054b29028a012aeeba11b00a5477b09a2fa/src/viser/_scene_api.py#L1342-L1360

An easier approach is to call server.scene.add_gaussian_splats() a second time. If you use the same name, the new splat object should replace the old one. Did you happen to try this?

brentyi avatar Mar 18 '25 13:03 brentyi

Hi @brentyi! Thanks for answer. I found a way to update like this:

gaussian_splats = server.scene.add_gaussian_splats()
new_buff = gaussian_splats.buffer.copy()
# do some stuff with buffer
gaussian_splats.buffer = new_buff

Also i notice that is similar to point cloud behavior, e.g. you can update field .colors only with new buffer But is it good for update large scene? Or its limitation of viser that i couldn't realize enough?

And another question. Do we need method that will return buffer as more readable format, e.g. SplatFile from example or structed numpy array / dataclass?

SmthFail avatar Mar 19 '25 06:03 SmthFail

Also i notice that is similar to point cloud behavior, e.g. you can update field .colors only with new buffer But is it good for update large scene? Or its limitation of viser that i couldn't realize enough?

Yeah, unfortunately this is an implementation limitation right now. We could try to support partial updates but it would be tricky and it's not on the roadmap.

And another question. Do we need method that will return buffer as more readable format, e.g. SplatFile from example or structed numpy array / dataclass?

Perhaps we could add a method to GaussianSplatHandle called something like update_buffer(self, rgbs, ...) that takes more human-friendly arrays as input, then sets the .buffer property under the hood? I'm open to a PR for something like this!

brentyi avatar Mar 21 '25 10:03 brentyi

@brentyi thanks for answer. I think it also be good to have method for get buffer in human-friendly array. Perhaps get_parsed_buffer(). If you want i can try to implement it and open PR in next week

SmthFail avatar Mar 21 '25 11:03 SmthFail