maybeLx / MVSFormerPlusPlus

Codes of MVSFormer++: Revealing the Devil in Transformer’s Details for Multi-View Stereo (ICLR2024)
Apache License 2.0
175 stars 6 forks source link

Integrating Mask for Object Removal #20

Open vietpho opened 4 months ago

vietpho commented 4 months ago

Hi there,

I have a question regarding MVSFormer++. Is it possible to input a mask along with the images when running the model? Specifically, I would like to use the pre-trained weights as they are, but include a mask to exclude certain objects from the depth estimation process. For example, if I want to remove trees from my mesh, I would provide a mask where the trees are marked. This way, the depth map would ignore those areas, and the resulting mesh would be free of the trees.

Could you guide me on which part of the code I should modify to integrate this masking functionality?

Thank you!

maybeLx commented 4 months ago

Yes, you can use mask to exclude certain objects. You can just use image = image * mask[...,None] if the shape of image is [h,w,3], the shape of the mask is [h,w] (bool type) in the dataset.