Skip to content

Commit

Permalink
Optimized inference with onnx for patchcore. (#652)
Browse files Browse the repository at this point in the history
results inferenced with onnx is inconsistent with torch, especially the four vertices.
  • Loading branch information
acai66 committed Oct 28, 2022
1 parent d78f995 commit e965c8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion anomalib/models/patchcore/torch_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
self.num_neighbors = num_neighbors

self.feature_extractor = FeatureExtractor(backbone=self.backbone, pre_trained=pre_trained, layers=self.layers)
self.feature_pooler = torch.nn.AvgPool2d(3, 1, 1)
self.feature_pooler = torch.nn.AvgPool2d(3, 1, 1, count_include_pad=False)
self.anomaly_map_generator = AnomalyMapGenerator(input_size=input_size)

self.register_buffer("memory_bank", Tensor())
Expand Down

0 comments on commit e965c8a

Please sign in to comment.