additions from Susanne #14

Merged
foefl merged 2 commits from new_main into main 2025-11-10 07:40:15 +00:00
Showing only changes of commit 346b905a86 - Show all commits

View File

@ -141,9 +141,9 @@ def measure_length(
)
x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0)
x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20
x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1])
y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0)
y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20
y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0])
rightmost_x_third = max(filtered_cnts[2][:, 0, 0])
leftmost_x_fourth = min(filtered_cnts[3][:, 0, 0])
@ -176,7 +176,7 @@ def infer_image(
output = model(input_tensor)
anomaly_score = output.pred_score.item()
anomaly_label = output.pred_label.item()
anomaly_label = 1 if anomaly_score >= .2 else 0
anomaly_map = output.anomaly_map.squeeze().cpu().numpy()
img_np = np.array(pil_image)