generated from dopt-python/py311
Compare commits
6 Commits
verify_res
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 34e05476ba | |||
| 9f5ea4af5f | |||
| 507e94a73f | |||
| 6e3192885b | |||
| 80ce3dd46d | |||
| 8884ef69be |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@ reports/
|
|||||||
*.code-workspace
|
*.code-workspace
|
||||||
# credentials
|
# credentials
|
||||||
CREDENTIALS*
|
CREDENTIALS*
|
||||||
|
*.pth
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "dopt-sensor-anomalies"
|
name = "dopt-sensor-anomalies"
|
||||||
version = "0.1.3"
|
version = "0.1.5"
|
||||||
description = "anomaly detection for sensor images for quality assurance processes"
|
description = "anomaly detection for sensor images for quality assurance processes"
|
||||||
authors = [
|
authors = [
|
||||||
{name = "d-opt GmbH (resp.: Florian Foerster)", email = "f.foerster@d-opt.com"},
|
{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.0.0"]
|
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"]
|
||||||
requires-python = "<3.14,>=3.11"
|
requires-python = "<3.14,>=3.11"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = {text = "LicenseRef-Proprietary"}
|
license = {text = "LicenseRef-Proprietary"}
|
||||||
@ -77,7 +77,7 @@ directory = "reports/coverage"
|
|||||||
|
|
||||||
|
|
||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.1.3"
|
current_version = "0.1.5"
|
||||||
parse = """(?x)
|
parse = """(?x)
|
||||||
(?P<major>0|[1-9]\\d*)\\.
|
(?P<major>0|[1-9]\\d*)\\.
|
||||||
(?P<minor>0|[1-9]\\d*)\\.
|
(?P<minor>0|[1-9]\\d*)\\.
|
||||||
|
|||||||
@ -6,9 +6,10 @@ STOP_FOLDER_NAME: Final[str] = "python"
|
|||||||
MODEL_FOLDER_NAME: Final[str] = "models"
|
MODEL_FOLDER_NAME: Final[str] = "models"
|
||||||
|
|
||||||
THRESHOLD_BW: Final[int] = 63
|
THRESHOLD_BW: Final[int] = 63
|
||||||
BACKBONE: Final[str] = "resnet18"
|
BACKBONE: Final[str] = "wide_resnet50_2"
|
||||||
LAYERS: Final[tuple[str, str]] = ("layer1", "layer2")
|
LAYERS: Final[tuple[str, ...]] = ("layer1", "layer2", "layer3")
|
||||||
RATIO: Final[float] = 0.05
|
RATIO: Final[float] = 0.01
|
||||||
|
ANOMALY_THRESHOLD: Final[float] = 0.14
|
||||||
|
|
||||||
NUM_VALID_ELECTRODES: Final[int] = 6
|
NUM_VALID_ELECTRODES: Final[int] = 6
|
||||||
HEATMAP_FILENAME_SUFFIX: Final[str] = "_Heatmap"
|
HEATMAP_FILENAME_SUFFIX: Final[str] = "_Heatmap"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -176,8 +176,7 @@ def infer_image(
|
|||||||
output = model(input_tensor)
|
output = model(input_tensor)
|
||||||
|
|
||||||
anomaly_score = output.pred_score.item()
|
anomaly_score = output.pred_score.item()
|
||||||
print(f">>> Anomaly score: {anomaly_score}")
|
anomaly_label = bool(1 if anomaly_score >= const.ANOMALY_THRESHOLD else 0)
|
||||||
anomaly_label = bool(1 if anomaly_score >= 0.2 else 0)
|
|
||||||
anomaly_map = output.anomaly_map.squeeze().cpu().numpy()
|
anomaly_map = output.anomaly_map.squeeze().cpu().numpy()
|
||||||
|
|
||||||
img_np = np.array(pil_image)
|
img_np = np.array(pil_image)
|
||||||
|
|||||||
3
tests/_models/README.md
Normal file
3
tests/_models/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
**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.
Loading…
x
Reference in New Issue
Block a user