As it seems, the function used at the time of training to create the agnostic mask is different from the function used at the time of inferencing(given by the levihsu), and given that the agnostic mask function used at inference uses human parsing and so using that for training will leak clothing information. Whether your somehow function help in that aspect