Convert to float32 instead of uint8

This commit is contained in:
jh 2021-05-05 11:10:23 -07:00
commit de00810871

View file

@ -373,8 +373,8 @@ def color_transfer(ct_mode, img_src, img_trg):
# imported from faceswap # imported from faceswap
def color_augmentation(img, seed=None): def color_augmentation(img, seed=None):
""" Color adjust RGB image """ """ Color adjust RGB image """
face = img face = img.astype(np.float32)
face = np.clip(face*255.0, 0, 255).astype(np.uint8) face = np.clip(face*255.0, 0, 255)
face = random_clahe(face, seed) face = random_clahe(face, seed)
face = random_lab(face, seed) face = random_lab(face, seed)
img[:, :, :3] = face img[:, :, :3] = face