Skip to content

Commit

Permalink
fix!: fixed flip for normal maps
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjercan committed May 10, 2021
1 parent 7c31269 commit 55be05e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions my_albumentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)


Expand Down

0 comments on commit 55be05e

Please sign in to comment.