Skip to content

Commit cdacd08

Browse files
fix(dinov2_loader): fixes comments
1 parent 9c36172 commit cdacd08

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

src/anomalib/models/components/dinov2/dinov2_loader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ def _load_weights(
185185

186186
# Weights_only is set to True
187187
# See mitigation details in https://github.com/open-edge-platform/anomalib/pull/2729
188-
# nosemgrep: trailofbits.python.pickles-in-pytorch.pickles-in-pytorch
189-
state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) # nosec B614
188+
state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) # nosec B614 # nosemgrep: trailofbits.python.pickles-in-pytorch.pickles-in-pytorch
190189
model.load_state_dict(state_dict, strict=False)
191190

192191
def _get_weight_path(

src/anomalib/models/components/dinov2/layers/drop_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from torch import nn
1616

1717

18-
def drop_path(x: torch.torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor:
18+
def drop_path(x: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor:
1919
"""Apply stochastic depth to an input tensor.
2020
2121
Args:

src/anomalib/models/image/anomaly_dino/lightning_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class AnomalyDINO(MemoryBankMixin, AnomalibModule):
8888
to simulate occlusions or missing patches. Defaults to ``False``.
8989
coreset_subsampling (bool, optional): Whether to apply coreset subsampling
9090
to reduce the size of the memory bank. Defaults to ``False``.
91-
sampling ratio(float, optional): If coreset subsampling, by what ratio
91+
sampling_ratio (float, optional): If coreset subsampling, by what ratio
9292
should we subsample. Defaults to ``0.1``
9393
precision (str, optional): Precision type for model computations.
9494
Supported values are defined in :class:`PrecisionType`.

src/anomalib/models/image/anomaly_dino/torch_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def forward(self, input_tensor: torch.Tensor) -> torch.Tensor | InferenceBatch:
220220
* ``pred_score``: Image-level anomaly score ``(B, 1)``
221221
* ``anomaly_map``: Pixel-level anomaly heatmap ``(B, 1, H, W)``
222222
"""
223-
# set precicion
223+
# set precision
224224
input_tensor = input_tensor.type(self.memory_bank.dtype)
225225

226226
# work out sizing

tests/unit/models/image/anomaly_dino/test_torch_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2025 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
"""Unit tests for the WinCLIP torch model."""
4+
"""Unit tests for the AnomalyDINO torch model."""
55

66
import numpy as np
77
import pytest

0 commit comments

Comments
 (0)