π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
enable pyupgrade as pre-commit (#1221)
Edgar Ribaf1a879bf39f0
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 6c58b2ea0..787f1888e 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -41,8 +41,8 @@ repos:hooks:- id: flake8- #- repo: https://github.com/asottile/pyupgrade- # rev: v2.23.0- # hooks:- # - id: pyupgrade- # args: [--py36-plus]+ - repo: https://github.com/asottile/pyupgrade+ rev: v2.23.0+ hooks:+ - id: pyupgrade+ args: [--py36-plus]diff --git a/kornia/feature/defmo.py b/kornia/feature/defmo.pyindex ecf6f4213..a149e0a7d 100644--- a/kornia/feature/defmo.py+++ b/kornia/feature/defmo.py@@ -51,7 +51,7 @@ class Bottleneck(nn.Module):dilation: int = 1,norm_layer: Optional[Callable[..., nn.Module]] = None,) -> None:- super(Bottleneck, self).__init__()+ super().__init__()if norm_layer is None:norm_layer = nn.BatchNorm2dwidth = int(planes * (base_width / 64.0)) * groups@@ -101,7 +101,7 @@ class ResNet(nn.Module):replace_stride_with_dilation: Optional[List[bool]] = None,norm_layer: Optional[Callable[..., nn.Module]] = None,) -> None:- super(ResNet, self).__init__()+ super().__init__()if norm_layer is None:norm_layer = nn.BatchNorm2dself._norm_layer = norm_layer@@ -204,7 +204,7 @@ class ResNet(nn.Module):class EncoderDeFMO(nn.Module):def __init__(self):- super(EncoderDeFMO, self).__init__()+ super().__init__()model = ResNet(Bottleneck, [3, 4, 6, 3]) # ResNet50modelc1 = nn.Sequential(*list(model.children())[:3])modelc2 = nn.Sequential(*list(model.children())[4:8])@@ -217,7 +217,7 @@ class EncoderDeFMO(nn.Module):class RenderingDeFMO(nn.Module):def __init__(self):- super(RenderingDeFMO, self).__init__()+ super().__init__()self.tsr_steps: int = 24model = nn.Sequential(nn.Conv2d(2049, 1024, kernel_size=3, stride=1, padding=1, bias=False),@@ -280,7 +280,7 @@ class DeFMO(nn.Module):"""def __init__(self, pretrained: bool = False) -> None:- super(DeFMO, self).__init__()+ super().__init__()self.encoder = EncoderDeFMO()self.rendering = RenderingDeFMO()