nerfstudio-project / gsplat

CUDA accelerated rasterization of gaussian splatting
https://docs.gsplat.studio/
Apache License 2.0
1.79k stars 220 forks source link

Train with a customized image background #219

Open MatteoMarengo opened 3 months ago

MatteoMarengo commented 3 months ago

Hello !

Do you have any advice on which part of the code should I modify in order to do the training with a customized image as a background instead of using a background color ?

Thank you so much :)

liruilong940607 commented 3 months ago

Hi,

That is fairly easy! Here is the pseudo code.

backgrounds: ... # [C, H, W, 1]
# colors is [C, H, W, 3], alphas is [C, H, W, 1]
colors, alphas, meta = gsplat.rasterization(...)
# apply background
colors = colors + backgrounds * (1 - alphas)
MatteoMarengo commented 3 months ago

In which files should I apply these modifications ?

Thank you ! :)

liruilong940607 commented 3 months ago

simple_trainer.py