localrf icon indicating copy to clipboard operation
localrf copied to clipboard

Masking ray sampling

Open Khoa-NT opened this issue 1 year ago • 3 comments

Hi,

Because my dataset has black regions in the images, I would like to ask how I can add my mask for ray sampling to avoid those black regions.

I checked the code and I think I should start from idx_sample. Do I have to be aware anywhere else? Thank you.

Khoa-NT avatar Jun 22 '23 10:06 Khoa-NT

The easiest would be to add a mask that zeros the loss. Would this suit your needs?

ameuleman avatar Jun 23 '23 19:06 ameuleman

Hi, The dataloader uses the valid masks in ${SCENE_DIR}/masks if they exist. Masks should have the same names as the files in images except for the extension that should be .png. Masks are then used to weigh the loss so that zero areas don't affect the training.

ameuleman avatar Jul 07 '23 20:07 ameuleman

Hi, Thank you for updating the code. Currently, I'm using my modified version at this line which is random.choice only index inside the mask.

I will test your new update and compare it.

Khoa-NT avatar Jul 08 '23 18:07 Khoa-NT