From f4a88e2e9fc130f3e281d0c6e422846b165effef Mon Sep 17 00:00:00 2001 From: LielinJiang Date: Thu, 27 Aug 2020 02:09:58 +0000 Subject: [PATCH] fix bug of color model --- applications/DeOldify/predict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/DeOldify/predict.py b/applications/DeOldify/predict.py index 9ac857f..1f73fd4 100644 --- a/applications/DeOldify/predict.py +++ b/applications/DeOldify/predict.py @@ -74,7 +74,7 @@ class DeOldifyPredictor(): img += img_mean img = img.transpose((1, 2, 0)) - return (img * 255).astype('uint8') + return (img * 255).clip(0, 255).astype('uint8') def post_process(self, raw_color, orig): color_np = np.asarray(raw_color) -- GitLab