From d5a9071f9d012c2133681a1ee367bde66ebaa365 Mon Sep 17 00:00:00 2001 From: foefl Date: Thu, 9 Oct 2025 07:56:05 +0200 Subject: [PATCH] temporally remove `Engine`import --- src/dopt_sensor_anomalies/detection.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dopt_sensor_anomalies/detection.py b/src/dopt_sensor_anomalies/detection.py index 90aea1f..ac97668 100644 --- a/src/dopt_sensor_anomalies/detection.py +++ b/src/dopt_sensor_anomalies/detection.py @@ -10,7 +10,8 @@ import matplotlib.pyplot as plt import numpy as np import numpy.typing as npt import torch -from anomalib.engine import Engine + +# from anomalib.engine import Engine from anomalib.models import Patchcore from imutils import contours, perspective from pandas import DataFrame @@ -30,14 +31,14 @@ pixels_per_metric_Y: float = 0.251 # measuring -def midpoint(ptA: npt.NDArray, ptB: npt.NDArray) -> tuple[float, float]: +def midpoint(pt_A: npt.NDArray, pt_B: npt.NDArray) -> tuple[float, float]: """to identify the midpoint of a 2D area Parameters ---------- - ptA : npt.NDArray + pt_A : npt.NDArray tuple of coordinates x, y; shape (2, ) - ptB : npt.NDArray + pt_B : npt.NDArray tuple of coordinates x, y; shape (2, ) Returns @@ -45,7 +46,7 @@ def midpoint(ptA: npt.NDArray, ptB: npt.NDArray) -> tuple[float, float]: tuple[float, float] tuple of midpoint coordinates """ - return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5) + return ((pt_A[0] + pt_B[0]) * 0.5, (pt_A[1] + pt_B[1]) * 0.5) def check_box_redundancy( @@ -377,7 +378,7 @@ def anomaly_detection( backbone=const.BACKBONE, layers=const.LAYERS, coreset_sampling_ratio=const.RATIO ) # ?? benötigt? Wird nicht genutzt - engine = Engine() + # engine = Engine() # preparation for plot _, axes = plt.subplots(1, 2, figsize=(12, 6))