sergeywong / cp-vton

Reimplemented code for "Toward Characteristic-Preserving Image-based Virtual Try-On Network"
MIT License
474 stars 182 forks source link

Generating the mask of the clothes #32

Open sagarnildass opened 4 years ago

sagarnildass commented 4 years ago

Sorry if this is a dumb question, but if I have a brand new dataset of different clothes, how do I generate the masks for them? I am seeing that the matlab file is very customized for viton data. Is there a different way in python which allows us to generate the masks of the clothes?

JaquesM commented 3 years ago

img = cv2.imread(image_path, 0) blur = cv2.GaussianBlur(img,(5,5),0) ret3,th3 = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)

cv2.imwrite(output_path, th3)

mesllo commented 2 years ago

I still get incorrect patches with the code above. The background of my new dataset is also white and the resolution is the same. Does anyone have any suggestions?