Skip to content

Commit

Permalink
Update albumentations/augmentations/domain_adaptation_functional.py
Browse files Browse the repository at this point in the history
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
ternaus and sourcery-ai[bot] authored Feb 28, 2024
1 parent 8393743 commit 396ed38
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions albumentations/augmentations/domain_adaptation_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def __init__(
self.target_transformer.fit(self.flatten(ref_img))

def to_colorspace(self, img: np.ndarray) -> np.ndarray:
if self.color_in is None:
return img
return cv2.cvtColor(img, self.color_in)
return img if self.color_in is None else cv2.cvtColor(img, self.color_in)

def from_colorspace(self, img: np.ndarray) -> np.ndarray:
if self.color_out is None:
Expand Down

0 comments on commit 396ed38

Please sign in to comment.