fix result reproduction error on different computers #17

Merged
foefl merged 7 commits from main_new into main 2025-11-20 16:04:27 +00:00
2 changed files with 2 additions and 1 deletions
Showing only changes of commit f80fbbc1f9 - Show all commits

View File

@ -9,6 +9,7 @@ THRESHOLD_BW: Final[int] = 63
BACKBONE: Final[str] = "'wide_resnet50_2"
LAYERS: Final[tuple[str, 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"

View File

@ -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)