Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

refactor(augmentation): drop 6 dead base-class method overrides (#3843)

Edgar Ribaba3737c82a60
diff --git a/kornia/augmentation/_2d/geometric/base.py b/kornia/augmentation/_2d/geometric/base.py
index a607c7343..eef03f80d 100644
--- a/kornia/augmentation/_2d/geometric/base.py
+++ b/kornia/augmentation/_2d/geometric/base.py
@@ -136,16 +136,6 @@ class GeometricAugmentationBase2D(RigidAffineAugmentationBase2D):
return output
- def apply_non_transform_box(
- self,
- input: Boxes,
- params: Dict[str, torch.Tensor],
- flags: Dict[str, Any],
- transform: Optional[torch.Tensor] = None,
- ) -> Boxes:
- """Process boxes corresponding to the inputs that are no transformation applied."""
- return input
-
def apply_transform_box(
self,
input: Boxes,
@@ -161,16 +151,6 @@ class GeometricAugmentationBase2D(RigidAffineAugmentationBase2D):
input = self.apply_non_transform_box(input, params, flags, transform)
return input.transform_boxes_(transform)
- def apply_non_transform_keypoint(
- self,
- input: Keypoints,
- params: Dict[str, torch.Tensor],
- flags: Dict[str, Any],
- transform: Optional[torch.Tensor] = None,
- ) -> Keypoints:
- """Process keypoints corresponding to the inputs that are no transformation applied."""
- return input
-
def apply_transform_keypoint(
self,
input: Keypoints,
@@ -186,16 +166,6 @@ class GeometricAugmentationBase2D(RigidAffineAugmentationBase2D):
input = self.apply_non_transform_keypoint(input, params, flags, transform)
return input.transform_keypoints_(transform)
- def apply_non_transform_class(
- self,
- input: torch.Tensor,
- params: Dict[str, torch.Tensor],
- flags: Dict[str, Any],
- transform: Optional[torch.Tensor] = None,
- ) -> torch.Tensor:
- """Process class tags corresponding to the inputs that are no transformation applied."""
- return input
-
def apply_transform_class(
self,
input: torch.Tensor,
diff --git a/kornia/augmentation/_2d/intensity/base.py b/kornia/augmentation/_2d/intensity/base.py
index 4648a2ad3..9cb4cb70c 100644
--- a/kornia/augmentation/_2d/intensity/base.py
+++ b/kornia/augmentation/_2d/intensity/base.py
@@ -46,12 +46,6 @@ class IntensityAugmentationBase2D(RigidAffineAugmentationBase2D):
def compute_transformation(self, input: Tensor, params: Dict[str, Tensor], flags: Dict[str, Any]) -> Tensor:
return self.identity_matrix(input)
- def apply_non_transform(
- self, input: Tensor, params: Dict[str, Tensor], flags: Dict[str, Any], transform: Optional[Tensor] = None
- ) -> Tensor:
- # For the images where batch_prob == False.
- return input
-
def apply_non_transform_mask(
self, input: Tensor, params: Dict[str, Tensor], flags: Dict[str, Any], transform: Optional[Tensor] = None
) -> Tensor:
@@ -72,21 +66,11 @@ class IntensityAugmentationBase2D(RigidAffineAugmentationBase2D):
) -> Boxes:
return input
- def apply_non_transform_keypoint(
- self, input: Keypoints, params: Dict[str, Tensor], flags: Dict[str, Any], transform: Optional[Tensor] = None
- ) -> Keypoints:
- return input
-
def apply_transform_keypoint(
self, input: Keypoints, params: Dict[str, Tensor], flags: Dict[str, Any], transform: Optional[Tensor] = None
) -> Keypoints:
return input
- def apply_non_transform_class(
- self, input: Tensor, params: Dict[str, Tensor], flags: Dict[str, Any], transform: Optional[Tensor] = None
- ) -> Tensor:
- return input
-
def apply_transform_class(
self, input: Tensor, params: Dict[str, Tensor], flags: Dict[str, Any], transform: Optional[Tensor] = None
) -> Tensor: