Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to preduce the trimap? #26

Closed
xaibeing opened this issue Jan 30, 2019 · 21 comments
Closed

How to preduce the trimap? #26

xaibeing opened this issue Jan 30, 2019 · 21 comments

Comments

@xaibeing
Copy link

I do some test but didn't get result as good as the images shown in the README.md.
I think trimap have a huge impact to the result. I use Mask RCNN to generator segmentation and than the trimap.
Could you tell how do you produce the trimap in the README.md demo images ?
Thanks!

@tsing90
Copy link

tsing90 commented Feb 2, 2019

good question, refer to #5

@rainsun1
Copy link

rainsun1 commented Feb 8, 2019

You can use the "Robust Matting" demo to produce the trimap.

@tsing90
Copy link

tsing90 commented Feb 8, 2019

@rainsun1 could you put a link of code here so that we can have a try? I searched for the code, it seemed 'robust matting' algorithm also need trimap to produce final result.

@rainsun1
Copy link

rainsun1 commented Feb 8, 2019

Here is a robust matting demo, you could load an image and then create a trimap yourself by the brushes and inpainting.

RobustMatting_1.45.zip

@tsing90
Copy link

tsing90 commented Feb 8, 2019

@rainsun1 many thanks for sharing this, actually, it'll be better if the trimap can be automatically generated so that the whole process can be automatic. recently, i found a useful website which can do bg removal all in automation: http://remove.bg

@rainsun1
Copy link

rainsun1 commented Feb 8, 2019

@tsing90 A paper named "Semantic Human Matting" is in this automatic trimap way.

@tsing90
Copy link

tsing90 commented Feb 13, 2019

@rainsun1 many thanks, that's what I need. unfortunately, the big datasets shown in that paper are not available for us. that kind of big datasets is essential for training a good model.

@rainsun1
Copy link

@tsing90 yes, but can you find some other implementations on "Semantic Human Matting" on github?

@wodsoe
Copy link

wodsoe commented Feb 24, 2019

remove.bg,so wonderful

@tsing90
Copy link

tsing90 commented Feb 24, 2019

@tsing90
Copy link

tsing90 commented Feb 24, 2019

@wodsoe that's our benchmark from industry ;)

@wodsoe
Copy link

wodsoe commented Feb 25, 2019

@wodsoe that's our benchmark from industry ;)
How to re-implement

@farazBhatti
Copy link

@tsing90 you can use Deep Lab v3+(https://github.com/tensorflow/models/blob/master/research/deeplab/deeplab_demo.ipynb) to get segmentation mask and then apply trimap generator to produce trimaps.
https://github.com/lnugraha/trimap_generator

@tsing90
Copy link

tsing90 commented Feb 25, 2019

@farazBhatti thanks for your suggestion. actually I've already tried its xception model which is good to get decent masks. To get trimaps, it's enough just by doing dilating and eroding. The key problem is that the masks we got from semantic segmentation (like deeplab v3+) is binary, its quality is lower than alpha matting

@farazBhatti
Copy link

@tsing90, yes true we only need medium quality segmentation mask to get trimap and from that trimap along with original colored image alpha matte is predicted. Alpha matte segmented image will always be superior to any other segmented mask , but we really don't need that good quality of segmented mask to predict alpha matte.

@tsing90
Copy link

tsing90 commented Feb 28, 2019

Does anyone have this problem? when producing trimap using the alpoha matte image from Adobe's DIM datasets, the trimap is kind of jagged, shown like below. My first guess of this issue is due to the image quality of .jpg, because .png images in that datasets don't have this problem.
1-1252426161dfxywoman_a

@farazBhatti
Copy link

Yes it could be the result of jpg compression quality. By the way is there any link to this data(
Adobe's DIM dataset) set which you are using?Thanks

@tsing90
Copy link

tsing90 commented Feb 28, 2019

@farazBhatti I got them from the author, due to license issue, you have to contact the author of that paper

@foamliu foamliu closed this as completed Mar 1, 2019
@FantasyJXF
Copy link
Contributor

@tsing90 Hi, I'm re-implementing the work nowadays. Could you please share some details of your tests. Hope to have a talk, my email 931026752@qq.com

@yxt132
Copy link

yxt132 commented Aug 20, 2019

@xaibeing The trimaps are in the dataset obtained from the author.

Only the test dataset has trimaps. The training set does not have them. @foamliu Can you explain a little bit how you generated trimaps for your training set? Thank you.

@sergiomena
Copy link

@xaibeing Hi, I'm also doing segmentation with mask RCNN and now I'm trying to use image matting to improve edge identification. I would like to private message you because now I have some trouble and maybe discussing could help both, if you want this is my email: sergio.17mena@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants