openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.85k stars 685 forks source link

[Task]: Enable WinCLIP export #1641

Open djdameln opened 10 months ago

djdameln commented 10 months ago

What is the motivation for this task?

Export is not working for the WinCLIP implementation because the masks and reference embeddings are currently not stored in the model's state dict.

Describe the solution you'd like

Enable export for WinCLIP model by registering masks and reference embeddings as buffers so that they end up in the state dict.

Additional context

Note that storing the masks and reference embeddings in the state dict is not necessary for testing and predicting, since we re-collect these attributes at the beginning of the test and predict sequence in the setup call of the lightning model.

thinhngo-x commented 9 months ago

Hi, isn't this already addressed in the most recent PR? https://github.com/openvinotoolkit/anomalib/blob/cbb623e33876e446b7788375cc355e3a3dd44cef/src/anomalib/models/image/winclip/torch_model.py#L73-L76

samet-akcay commented 9 months ago

@djdameln, can you confirm and close this issue if this is complete?

adrianboguszewski commented 7 months ago

@samet-akcay The model is still non-runnable in OpenVINO (due to not exported masks)

junxnone commented 6 months ago

Thanks for awesome project!


Is there a sample show how to run WinCLIP fewshot model with OpenVINO?

junxnone commented 6 months ago

OOM when I export the INT8_PTQ OpenVINO model for WinCLIP