Closed cmdrootaccess closed 4 years ago
Usually, trimaps are drawn by hand. For example, here is a video by Macro Forte where he is drawing a trimap: https://www.youtube.com/watch?v=gl1XOAuMckM
You could also train a neural network to generate a trimaps for a specific kind of object, but then you'd need a dataset to train your neural network.
you can generate trimaps by using cv2.dilate
and cv2.erode
on alpha(only two value 0&255). Then, you need to merge fg and bg, and save it. Finally, use the generate_imlist.py to generate train.txt and test.txt.
alright thanks. will do that
hello,
i want to train my own dataset to generate indexnet_matting.pth.tar .
what do i have to do ? i see first trimaps are needed, do you have a complete matting project that generates trimaps then runs training ?
or how do i first generate these trimaps ? Thanks