Skip to content

Onnx padim output processing in C# #1539

Answered by blaz-r
Tibe31 asked this question in Q&A
Nov 30, 2023 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Hello. The reason that the model is so big are mean tensor and inverse of covariance matrix inside multivariate Gaussian which can become quite large in dimensions:

self.register_buffer("mean", torch.zeros(n_features, n_patches))
self.register_buffer("inv_covariance", torch.eye(n_features).unsqueeze(0).repeat(n_patches, 1, 1))

WIth input size of 256x256 they have shape of [100, 4096] and [4096, 100, 100] respectively . With 512x512 they are [100, 16384] and [16384, 100, 100] respectively.
Now for pre and post-processing you can refer to OpenVInoInferencer code. You will…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by samet-akcay
Comment options

You must be logged in to vote
5 replies
@Dpat123
Comment options

@samet-akcay
Comment options

@Tibe31
Comment options

@Lee-CheWei
Comment options

@Tibe31
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #1517 on December 11, 2023 13:19.