From 55be05e132ec252d740b82f43e4eab6105ccd035 Mon Sep 17 00:00:00 2001 From: Alexandru Jercan Date: Mon, 10 May 2021 13:13:36 +0300 Subject: [PATCH] fix!: fixed flip for normal maps --- my_albumentations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/my_albumentations.py b/my_albumentations.py index ee150cc..d1c43d5 100644 --- a/my_albumentations.py +++ b/my_albumentations.py @@ -16,7 +16,7 @@ def targets(self): def apply_normal(self, img, **params): # when flipping horizontally the normal map should be inversed on the x axis - img[:, :, 0] = -1 * img[:, :, 0] + 1 + img[:, :, 0] = -1 * img[:, :, 0] return super().apply(img, **params) @@ -26,7 +26,7 @@ def targets(self): return dict(super().targets, **{'depth': self.apply, 'normal': self.apply_normal}) def apply_normal(self, img, **params): - img[:, :, 1] = -1 * img[:, :, 1] + 1 # y axis flip for normal maps + img[:, :, 1] = -1 * img[:, :, 1] # y axis flip for normal maps return super().apply(img, **params)