π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Add bandit B110 test and fix (#1243)
Edgar Riba23149197be20
diff --git a/.github/workflows/tests_cuda.yml b/.github/workflows/tests_cuda.ymlindex a4d787eb1..fce5f0c95 100644--- a/.github/workflows/tests_cuda.yml+++ b/.github/workflows/tests_cuda.yml@@ -21,6 +21,8 @@ jobs:- name: Install dependenciesshell: bash -l {0}run: |+ # NOTE: pytorch image does not include git+ conda install -c anaconda gitpip install -r requirements-dev.txtpython setup.py install- name: Run Testsdiff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex aedf122fc..324e21c71 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -54,7 +54,7 @@ repos:args:- --recursive- --skip- - "B101,B110,B311,B404,B602,B603,B607"+ - "B101,B311,B404,B602,B603,B607"- .- repo: https://github.com/myint/docformatterdiff --git a/kornia/feature/hardnet.py b/kornia/feature/hardnet.pyindex 7cddfbb10..40ed38d73 100644--- a/kornia/feature/hardnet.py+++ b/kornia/feature/hardnet.py@@ -148,10 +148,8 @@ class HardNet8(nn.Module):def weights_init(m):if isinstance(m, nn.Conv2d):nn.init.orthogonal_(m.weight.data, gain=0.6)- try:+ if m.bias is not None:nn.init.constant_(m.bias.data, 0.01)- except:- pass@staticmethoddef _normalize_input(x: torch.Tensor, eps: float = 1e-7) -> torch.Tensor:diff --git a/setup.py b/setup.pyindex 686a1cdf1..4e46ef7af 100644--- a/setup.py+++ b/setup.py@@ -65,7 +65,7 @@ cwd = os.path.dirname(os.path.abspath(__file__))try:sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()-except Exception:+except subprocess.CalledProcessError:passif os.getenv('KORNIA_BUILD_VERSION'):