Skip to content

Commit e965c8a

Browse files
authored
Optimized inference with onnx for patchcore. (#652)
results inferenced with onnx is inconsistent with torch, especially the four vertices.
1 parent d78f995 commit e965c8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

anomalib/models/patchcore/torch_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
self.num_neighbors = num_neighbors
3939

4040
self.feature_extractor = FeatureExtractor(backbone=self.backbone, pre_trained=pre_trained, layers=self.layers)
41-
self.feature_pooler = torch.nn.AvgPool2d(3, 1, 1)
41+
self.feature_pooler = torch.nn.AvgPool2d(3, 1, 1, count_include_pad=False)
4242
self.anomaly_map_generator = AnomalyMapGenerator(input_size=input_size)
4343

4444
self.register_buffer("memory_bank", Tensor())

0 commit comments

Comments
 (0)