Skip to content

Commit 928b35a

Browse files
committed
fix(transforms): fix norm trans bug
1 parent ea5ed32 commit 928b35a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cellseg_models_pytorch/transforms/albu_transforms/norm_transforms.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def apply(self, image: np.ndarray, **kwargs) -> np.ndarray:
4545
"""
4646
return minmax_normalize(image, self.amin, self.amax)
4747

48+
def get_transform_init_args_names(self):
49+
"""Get the names of the transformation arguments."""
50+
return ("amin", "amax")
51+
4852

4953
class PercentileNormalization(ImageOnlyTransform):
5054
def __init__(
@@ -83,6 +87,10 @@ def apply(self, image: np.ndarray, **kwargs) -> np.ndarray:
8387
"""
8488
return percentile_normalize(image, self.lower, self.upper)
8589

90+
def get_transform_init_args_names(self):
91+
"""Get the names of the transformation arguments."""
92+
return ("lower", "upper")
93+
8694

8795
class ImgNormalization(ImageOnlyTransform):
8896
def __init__(
@@ -127,6 +135,10 @@ def apply(self, image: np.ndarray, **kwargs) -> np.ndarray:
127135
"""
128136
return normalize(image, self.standardize, self.amin, self.amax)
129137

138+
def get_transform_init_args_names(self):
139+
"""Get the names of the transformation arguments."""
140+
return ("amin", "amax", "standardize")
141+
130142

131143
def imgnorm_transform(**kwargs) -> List[ImageOnlyTransform]:
132144
"""Return image-level normalization transform."""

0 commit comments

Comments
 (0)