Conversation
Add --mask-dir option to specify a directory containing binary mask images (0=exclude, 1=include). Masks are matched to images by filename stem and applied during loss computation (L1 and SSIM) so only foreground pixels contribute to training. Features: - Binary mask loading with automatic resizing to match image dimensions - Mask pyramid caching (like image pyramids) using nearest-neighbor interpolation - Masked L1 loss: weighted mean over foreground pixels only - Masked SSIM: post-masking of SSIM map before averaging - Validation loss also respects masks
|
Thanks @JorisGoosen. Can you test with https://drive.google.com/file/d/1XzRI7kKKx3hvql7KKhvaIWGRwebltm9N/view?usp=sharing and post some screenshots? |
|
After 40000: |
|
Right, one cannot simply zero out the loss around the mask. I would start by looking at how other implementations do it for possible approaches (e.g. https://github.com/MrNeRF/LichtFeld-Studio/blob/master/src/training/trainer.cpp#L246) I think depending on the approach you'll need to track the outAlpha in the backward step (https://github.com/nerfstudio-project/gsplat/pull/70/changes) as well, as I currently always initialize it to zero: |
e278076 to
6047beb
Compare
|
So last week I did look into the code at lichtfeld and seem to have a better idea on how to get this used. |
|
(Haven't forgotten about this, its just that im in the middle of moving houses) |








The code in #220 actually looked like a good base to implement 2d masking, which I wanted opensplat to support for a while.
Ive fixed some loose ends in it and changed the application of the mask.
Implements #35
Ive tested this with some datasets of mine, any suggestion on other things to test would be welcome.
So far it seems to be working fine.
Any suggestions for possible datasets to test things on?