Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please tell me how to extract features from training data #34

Open
kirorotarzan opened this issue Aug 11, 2024 · 5 comments
Open

Please tell me how to extract features from training data #34

kirorotarzan opened this issue Aug 11, 2024 · 5 comments

Comments

@kirorotarzan
Copy link

Excuse me, I need your help. I have modified a program based on a Streamlit application to run it as a command-line interface (CUI). As an additional process, I want to implement a feature where the extracted features of the training data images can be saved as data (or a model?) and then reloaded when the program is executed again. However, as I am a beginner, I am struggling to implement this properly. I would appreciate it if you could give me some advice. Thank you.

@rvorias
Copy link
Owner

rvorias commented Aug 18, 2024

Hi, do you want to save the raw features (e.g. resnet50 features) or the features in the format of a specific approach? (e.g. spade features, padim features etc)

@kirorotarzan
Copy link
Author

Thank you for your message. If possible, I would like to obtain the features of PatchCore. Best regards.

@kirorotarzan
Copy link
Author

Excuse me. I've been doing some research, and is it correct to assume that I should use torch.save() to save the model?

@rvorias
Copy link
Owner

rvorias commented Aug 21, 2024

Hey, over the weekend I started working on a .export method for spade and patchcore, but for patchcore it's only the torchscript that gets exported, not yet the onnx format. Need to take a further look at that.

check out the test_patchcore.py file for work so far

https://github.com/rvorias/ind_knn_ad/blob/fbea993f3b4b61c9667ec9a22b76db3174f5263b/tests/test_patchcore.py#L23:L48

@kirorotarzan
Copy link
Author

Thank you for your response and handling.
I have reviewed the code. Personally, if it is possible to save the model in a .pt file and load that .pt file for inference during the next program execution, then using .onnx files is not particularly necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants