Compare commits

..

4 Commits

Author SHA1 Message Date
9cd8457762 pin anomalib version to v2.0.0 2025-11-20 14:46:55 +01:00
322506bfd0 tests 2025-11-20 08:11:57 +01:00
54babec627 add new models 2025-11-20 07:32:36 +01:00
d7feb53b90 pin anomalib version to v2.1.0 2025-11-20 07:31:28 +01:00
14 changed files with 555 additions and 1623 deletions

1
.gitattributes vendored
View File

@ -1 +0,0 @@
*.pth filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored
View File

@ -5,7 +5,6 @@ reports/
*.code-workspace
# credentials
CREDENTIALS*
*.pth
# Byte-compiled / optimized / DLL files
__pycache__/

1101
pdm.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
[project]
name = "dopt-sensor-anomalies"
version = "0.1.5"
version = "0.1.3"
description = "anomaly detection for sensor images for quality assurance processes"
authors = [
{name = "d-opt GmbH (resp.: Florian Foerster)", email = "f.foerster@d-opt.com"},
]
dependencies = ["imutils>=0.5.4", "dopt-basics>=0.2.4", "numpy>=2.2.6", "open-clip-torch>=3.2.0", "anomalib==2.1.0", "dotenv>=0.9.9"]
dependencies = ["imutils>=0.5.4", "dopt-basics>=0.2.4", "numpy>=2.2.6", "open-clip-torch>=3.2.0", "anomalib==2.0.0"]
requires-python = "<3.14,>=3.11"
readme = "README.md"
license = {text = "LicenseRef-Proprietary"}
@ -77,7 +77,7 @@ directory = "reports/coverage"
[tool.bumpversion]
current_version = "0.1.5"
current_version = "0.1.3"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.

View File

@ -6,10 +6,9 @@ STOP_FOLDER_NAME: Final[str] = "python"
MODEL_FOLDER_NAME: Final[str] = "models"
THRESHOLD_BW: Final[int] = 63
BACKBONE: Final[str] = "wide_resnet50_2"
LAYERS: Final[tuple[str, ...]] = ("layer1", "layer2", "layer3")
RATIO: Final[float] = 0.01
ANOMALY_THRESHOLD: Final[float] = 0.14
BACKBONE: Final[str] = "resnet18"
LAYERS: Final[tuple[str, str]] = ("layer1", "layer2")
RATIO: Final[float] = 0.05
NUM_VALID_ELECTRODES: Final[int] = 6
HEATMAP_FILENAME_SUFFIX: Final[str] = "_Heatmap"

File diff suppressed because one or more lines are too long

View File

@ -176,7 +176,8 @@ def infer_image(
output = model(input_tensor)
anomaly_score = output.pred_score.item()
anomaly_label = bool(1 if anomaly_score >= const.ANOMALY_THRESHOLD else 0)
print(f">>> Anomaly score: {anomaly_score}")
anomaly_label = bool(1 if anomaly_score >= 0.2 else 0)
anomaly_map = output.anomaly_map.squeeze().cpu().numpy()
img_np = np.array(pil_image)

View File

@ -1,3 +0,0 @@
**PLACE MODELS IN THIS FOLDER**
The model files are too large. Download the files from our internal distribution channel (primarily cloud).

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.