minar09 / cp-vton-plus

Official implementation for "CP-VTON+: Clothing Shape and Texture Preserving Image-Based Virtual Try-On", CVPRW 2020
https://minar09.github.io/cpvtonplus/
MIT License
346 stars 120 forks source link

Threshold value for body masking #39

Open arvind-iyer opened 3 years ago

arvind-iyer commented 3 years ago

In the make_body_mask function in body_binary_masking.py, I see this line of code

54:  _, seg_mask = cv2.threshold(gray, 1, 255, cv2.THRESH_BINARY)

Shouldn't the first second argument be 0 not 1? Won't the hat segmentation part be lost if 1 is set as the threshold?

minar09 commented 3 years ago

Hi @arvind-iyer , this code is very heuristic, sure you can update the arguments based on your data. For example, in the case of the VITON dataset, they don't have the hat labels.