matthewearl / faceswap

Python script to put facial features from one face onto another
MIT License
1.4k stars 496 forks source link

a few bugs fixed! #25

Open chenyyx opened 4 years ago

chenyyx commented 4 years ago

Hi Matthew, Great piece of code. And thanks for putting this together from the Switching Eds blog post.

And I found some wrong in the codes, its confused me a lot, then i fixed that. See below. im1 --- 001_im1

im2 --- 002_im2

output --- 009_output_im_t

====================== that's because output_im(type is np.float64), some pixels value out of range(0~255)!!! We only need to add two line scripts as below to before this code line output_im_t = output_im.astype(np.uint8) .

output_im = np.maximum(output_im, 0) output_im = np.minimum(output_im, 255)

that's make it! :) 008_output_im