Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

remove unused code

edgarriba3cdb70c9fd65
diff --git a/kornia/augmentation/augmentation.py b/kornia/augmentation/augmentation.py
index 715c141eb..a0859f61b 100644
--- a/kornia/augmentation/augmentation.py
+++ b/kornia/augmentation/augmentation.py
@@ -426,8 +426,8 @@ class RandomRotation(AugmentationBase):
if params is None:
height, width = self.infer_image_shape(input)
batch_size: int = self.infer_batch_size(input)
- params = self.get_params(batch_size, self.degrees)
- return super().forward(input, params)
+ self.set_params(batch_size, self.degrees)
+ return super().forward(input, self._params)
class RandomCrop(AugmentationBase):
@@ -550,4 +550,4 @@ class RandomResizedCrop(AugmentationBase):
batch_shape = input.shape
params = RandomResizedCrop.get_params(
batch_size, (batch_shape[-2], batch_shape[-1]), self.size, self.scale, self.ratio)
- return super().forward(input, params)
\ No newline at end of file
+ return super().forward(input, params)
diff --git a/kornia/augmentation/functional.py b/kornia/augmentation/functional.py
index 954fee11f..dfa6eb786 100644
--- a/kornia/augmentation/functional.py
+++ b/kornia/augmentation/functional.py
@@ -518,8 +518,4 @@ def apply_crop(input: torch.Tensor, params: Dict[str, torch.Tensor], return_tran
is set to ``True``
"""
input = _transform_input(input)
-
- if return_transform:
- return crop_by_boxes(input, params['src'], params['dst'], return_transform=return_transform)
-
return crop_by_boxes(input, params['src'], params['dst'], return_transform=return_transform)
diff --git a/kornia/augmentation/param_gen.py b/kornia/augmentation/param_gen.py
index d52cffec3..69e831a0a 100644
--- a/kornia/augmentation/param_gen.py
+++ b/kornia/augmentation/param_gen.py
@@ -2,7 +2,6 @@ from typing import Tuple, List, Union, Dict, Optional, cast
import random
import math
-import numpy as np
import torch
from torch.distributions import Uniform