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
343 stars 120 forks source link

can u explain this piece of code #79

Closed gamenerd457 closed 2 years ago

gamenerd457 commented 2 years ago

parse_shape = (mask_array > 0).astype(np.float32)

    if self.stage == 'GMM':
        parse_head = (parse_array == 1).astype(np.float32) + \
            (parse_array == 4).astype(np.float32) + \
            (parse_array == 13).astype(
                np.float32)  # CP-VTON+ GMM input (reserved regions)
minar09 commented 2 years ago

@gamenerd457 , here's actually the head/face area labels are considered as in the human representation that is helpful for target clothing deformation. Please see the paper for more details.

gamenerd457 commented 2 years ago

thanks and by the way can u explain this piece of code too.. for i in range(point_num): one_map = Image.new('L', (self.fine_width, self.fine_height)) draw = ImageDraw.Draw(one_map) pointx = pose_data[i, 0] pointy = pose_data[i, 1] if pointx > 1 and pointy > 1: draw.rectangle((pointx-r, pointy-r, pointx + r, pointy+r), 'white', 'white') pose_draw.rectangle( (pointx-r, pointy-r, pointx+r, pointy+r), 'white', 'white') one_map = self.transform(one_map) pose_map[i] = one_map[0]

minar09 commented 2 years ago

@gamenerd457 , this is for drawing the heatmap image from the pose keypoints.