nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

How to render without background?

Open Yoonho-Na opened this issue 2 years ago • 8 comments

Hi I want to render an object without any backgrounds. How can this be done?

Yoonho-Na avatar Nov 02 '23 03:11 Yoonho-Na

I think the easiest way is to preprocess the imgs and remove their backgrounds. https://github.com/danielgatis/rembg may help.

KevinXu02 avatar Nov 08 '23 07:11 KevinXu02

@KevinXu02 Thanks for the comment. I just used rembg to remove the backgrounds in the images and trained nerfacto. but I found out that the results were even worse than training with full background and cropping. the results were more blurry and renders some black artifacts. What I'm assuming is that the background is changed to 0 RGB (which is black) when it goes to the model and the model still learns the density of this black background. but I want the whole background to be transparent. Do you think this can be fixed by using masks?

스크린샷 2023-11-21 오전 10 18 23

Yoonho-Na avatar Nov 21 '23 01:11 Yoonho-Na

@Yoonho-Na did you figure this out? I am also giving the same artifacts when following the method above.

arbab-ml avatar Jan 09 '24 23:01 arbab-ml

@arbab-ml not yet. I think we should use mask when rendering somehow. I didn't had time to look up the code yet.

Yoonho-Na avatar Jan 11 '24 01:01 Yoonho-Na

@Yoonho-Na I did more digging and this should clarify a little more: https://github.com/nerfstudio-project/nerfstudio/issues/1498#issuecomment-1528672022

For implementation look here: look at this: https://github.com/nerfstudio-project/nerfstudio/pull/2165

arbab-ml avatar Jan 11 '24 01:01 arbab-ml

@arbab-ml thank you for sharing!

Yoonho-Na avatar Jan 11 '24 01:01 Yoonho-Na

Hi, did you solve it? I browsed #2165 but still don't know what to do to remove the background, I made the background of the input images transparent, but the rendering result has very obvious black artifact, if possible, could you please give me any guidance? this would very important to me, thank you!

tree8888 avatar Mar 26 '24 10:03 tree8888