foamliu / Deep-Image-Matting-PyTorch

Deep Image Matting implementation in PyTorch
MIT License
817 stars 185 forks source link

question on alpha as input to gen_trimap #43

Closed ghazni123 closed 4 years ago

ghazni123 commented 4 years ago

Hi

I have question regarding alpha needed during testing phase. Per my understanding, paper states that for testing/inference only original image & corresponding trimap are needed and encoder/decoder framework will predict the alpha. On the other hand Ground truth alpha (generated by photoshop) is required for training.

I am aware that originally authors calculated alpha manually for all 431 objects and after composing distributed among training and testing sets. So training and testing both gets high quality alpha produced manually. This is fine is testing images of authors are used.

However for the case if I chose another image from internet Why alpha being passed during testing phase to generate trimap? and how do I get that alpha? Is it the case that mask generated by any segmentation framework can be used as initial/rough alpha as input to generate_trimap and by running through the network will produce the relatively accurate alpha?

Thank you.

foamliu commented 4 years ago

Yes, during testing phase the trimap is supposed to be generated by some rough segmentation tools.