generated from dopt-python/py311
temporally remove Engineimport
This commit is contained in:
parent
4bf5bcc182
commit
d5a9071f9d
@ -10,7 +10,8 @@ import matplotlib.pyplot as plt
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import numpy.typing as npt
|
import numpy.typing as npt
|
||||||
import torch
|
import torch
|
||||||
from anomalib.engine import Engine
|
|
||||||
|
# from anomalib.engine import Engine
|
||||||
from anomalib.models import Patchcore
|
from anomalib.models import Patchcore
|
||||||
from imutils import contours, perspective
|
from imutils import contours, perspective
|
||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
@ -30,14 +31,14 @@ pixels_per_metric_Y: float = 0.251
|
|||||||
|
|
||||||
|
|
||||||
# measuring
|
# 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
|
"""to identify the midpoint of a 2D area
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
ptA : npt.NDArray
|
pt_A : npt.NDArray
|
||||||
tuple of coordinates x, y; shape (2, )
|
tuple of coordinates x, y; shape (2, )
|
||||||
ptB : npt.NDArray
|
pt_B : npt.NDArray
|
||||||
tuple of coordinates x, y; shape (2, )
|
tuple of coordinates x, y; shape (2, )
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
@ -45,7 +46,7 @@ def midpoint(ptA: npt.NDArray, ptB: npt.NDArray) -> tuple[float, float]:
|
|||||||
tuple[float, float]
|
tuple[float, float]
|
||||||
tuple of midpoint coordinates
|
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(
|
def check_box_redundancy(
|
||||||
@ -377,7 +378,7 @@ def anomaly_detection(
|
|||||||
backbone=const.BACKBONE, layers=const.LAYERS, coreset_sampling_ratio=const.RATIO
|
backbone=const.BACKBONE, layers=const.LAYERS, coreset_sampling_ratio=const.RATIO
|
||||||
)
|
)
|
||||||
# ?? benötigt? Wird nicht genutzt
|
# ?? benötigt? Wird nicht genutzt
|
||||||
engine = Engine()
|
# engine = Engine()
|
||||||
|
|
||||||
# preparation for plot
|
# preparation for plot
|
||||||
_, axes = plt.subplots(1, 2, figsize=(12, 6))
|
_, axes = plt.subplots(1, 2, figsize=(12, 6))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user