Does the code assume that the images are pre-resized to the same dimensions as the segment ?
Also the tensor from the self.transform has color as first element [3,320,320] whereas torch.from_numpy keeps the arrangement same [320,320,3] and hence multiplication fails
head_mask_tensor = torch.from_numpy(head_mask) # [0,1]
feature_head_tensor = person_tensor * head_mask_tensor - (1 - head_mask_tensor) # [-1,1], fill -1 for other parts
cloth_mask_tensor = torch.from_numpy(cloth_mask) # [0,1]
cloth_parse_tensor = person_tensor * cloth_mask_tensor + (1 - cloth_mask_tensor) # [-1,1], fill 1 for other parts
body_mask_tensor = torch.from_numpy(body_mask).unsqueeze(0) # Tensor [0,1]
Does the code assume that the images are pre-resized to the same dimensions as the segment ? Also the tensor from the self.transform has color as first element [3,320,320] whereas torch.from_numpy keeps the arrangement same [320,320,3] and hence multiplication fails