generated from dopt-python/py311
fix result reproduction error on different computers (#17)
fixes #16 Co-authored-by: frasu <frasu@noreply.localhost> Reviewed-on: #17 Co-authored-by: foefl <f.foerster@d-opt.com> Co-committed-by: foefl <f.foerster@d-opt.com>
This commit was merged in pull request #17.
This commit is contained in:
@@ -6,9 +6,10 @@ STOP_FOLDER_NAME: Final[str] = "python"
|
||||
MODEL_FOLDER_NAME: Final[str] = "models"
|
||||
|
||||
THRESHOLD_BW: Final[int] = 63
|
||||
BACKBONE: Final[str] = "resnet18"
|
||||
LAYERS: Final[tuple[str, str]] = ("layer1", "layer2")
|
||||
RATIO: Final[float] = 0.05
|
||||
BACKBONE: Final[str] = "wide_resnet50_2"
|
||||
LAYERS: Final[tuple[str, ...]] = ("layer1", "layer2", "layer3")
|
||||
RATIO: Final[float] = 0.01
|
||||
ANOMALY_THRESHOLD: Final[float] = 0.2
|
||||
|
||||
NUM_VALID_ELECTRODES: Final[int] = 6
|
||||
HEATMAP_FILENAME_SUFFIX: Final[str] = "_Heatmap"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -176,7 +176,7 @@ def infer_image(
|
||||
output = model(input_tensor)
|
||||
|
||||
anomaly_score = output.pred_score.item()
|
||||
anomaly_label = bool(1 if anomaly_score >= 0.2 else 0)
|
||||
anomaly_label = bool(1 if anomaly_score >= const.ANOMALY_THRESHOLD else 0)
|
||||
anomaly_map = output.anomaly_map.squeeze().cpu().numpy()
|
||||
|
||||
img_np = np.array(pil_image)
|
||||
|
||||
Reference in New Issue
Block a user