From 00841ab8c067b9b504ca31fbafab9c50bc82aebd Mon Sep 17 00:00:00 2001 From: jh Date: Wed, 5 May 2021 11:41:48 -0700 Subject: [PATCH] convert float32 --- core/imagelib/color_transfer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/imagelib/color_transfer.py b/core/imagelib/color_transfer.py index 927dc9f..c9cafc5 100644 --- a/core/imagelib/color_transfer.py +++ b/core/imagelib/color_transfer.py @@ -373,8 +373,9 @@ def color_transfer(ct_mode, img_src, img_trg): # imported from faceswap def color_augmentation(img, seed=None): """ Color adjust RGB image """ - face = img.astype(np.float32) - face = np.clip(face*255.0, 0, 255) + img = img.astype(np.float32) + face = img + face = np.clip(face*255.0, 0, 255).astype(np.uint8) face = random_clahe(face, seed) face = random_lab(face, seed) img[:, :, :3] = face