zyainfal / One-Shot-Face-Swapping-on-Megapixels

One Shot Face Swapping on Megapixels.
Other
314 stars 40 forks source link

Swap result is black #28

Closed antongonz closed 2 years ago

antongonz commented 2 years ago

HI,

I set up the environment exactly as you described. I checked the images before they became tensors in preprocess and are correct. After swap, I do this:

        swapped_face = self.postprocess(swapped_face, tgt_face_rgb, tgt_mask)
        result = np.hstack((src_face_rgb[:,:,::-1], tgt_face_rgb[:,:,::-1], swapped_face))
        cv2.imshow('result', result)
        cv2.waitKey(0)

The resulting image is black. Any idea what is wrong? Any other step I can do to debug?

Thanks!

zyainfal commented 2 years ago

You may check the result of _swapped_face_ here. Is it black? swappedface = self.postprocess(swapped_face_, tgt_face_rgb, tgt_mask)

antongonz commented 2 years ago

Got it, just needed to create the correct mask. Thanks!

flynnamy commented 2 years ago

Same problem. How do you solve it? I use GT mask of CelebAHQ. @cwalt2014

flynnamy commented 2 years ago

Hi,I check that swapped_face is not black, any suggestions? @zyainfal

zyainfal commented 2 years ago

If swapped_face is not black, your mask should be incorrect. Take care of the mask value and shape.