poppinace / indexnet_matting

(ICCV'19) Indices Matter: Learning to Index for Deep Image Matting
Other
389 stars 90 forks source link

Train Own Dataset #22

Closed cmdrootaccess closed 4 years ago

cmdrootaccess commented 4 years ago

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

983 commented 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.

QWERDF007 commented 4 years ago

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.

cmdrootaccess commented 4 years ago

alright thanks. will do that