Skip to content

Commit

Permalink
Fix warning in piecewise affine (#2052)
Browse files Browse the repository at this point in the history
* Empty-Commit

* Fix in warning in PiecewiseAffine
  • Loading branch information
ternaus authored Nov 2, 2024
1 parent 63da7b7 commit eab8836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions albumentations/augmentations/geometric/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def __init__(
super().__init__(p=p, always_apply=always_apply)

warn(
"This augmenter is very slow. Try to use ``ElasticTransformation`` instead, which is at least 10x faster.",
"This augmenter is very slow. Try to use ``ElasticTransform`` instead, which is at least 10x faster.",
stacklevel=2,
)

Expand Down Expand Up @@ -1120,14 +1120,14 @@ def get_transform_init_args_names(self) -> tuple[str, ...]:
)

def get_params_dependent_on_data(self, params: dict[str, Any], data: dict[str, Any]) -> dict[str, Any]:
height, width = params["shape"][:2]
image_shape = params["shape"][:2]

nb_rows = np.clip(self.py_random.randint(*self.nb_rows), 2, None)
nb_cols = np.clip(self.py_random.randint(*self.nb_cols), 2, None)
scale = self.py_random.uniform(*self.scale)

map_x, map_y = fgeometric.create_piecewise_affine_maps(
image_shape=(height, width),
image_shape=image_shape,
grid=(nb_rows, nb_cols),
scale=scale,
absolute_scale=self.absolute_scale,
Expand Down

0 comments on commit eab8836

Please sign in to comment.