How to use custom trained model as backbone? #1981
-
Describe the bugHi, I am able to do Patchcore based anomaly detection, but the performance seems to be stagnant at some point. However, I thought if I can use a model trained specifically on my dataset. How can I load a resnet34 model pretrined on my dataset for feature extraction? DatasetFolder ModelPatchCore Steps to reproduce the behaviorHow to use custom pretrained model OS informationOS information:
Expected behaviorAble to load model pretrained on custom dataset, for ex: using pretrained resnet34 model ScreenshotsNA Pip/GitHubGitHub What version/branch did you use?1.1.0 Configuration YAMLusing engine.train function required parameters LogsNA Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
Hi @lathashree01, you could refer to this documentation section for custom bacbones Let us know if there is anything that is not clear |
Beta Was this translation helpful? Give feedback.
-
I think the bug is, whereas this is not possible with current anomalib implementation. |
Beta Was this translation helpful? Give feedback.
-
Yeah, we didn't really considers custom models for feature extraction. We thought timm or torchfx feature extractors are usually of interest. What I would do for now is to directly customize patchcore and modify this bit however you like anomalib/src/anomalib/models/image/patchcore/torch_model.py Lines 48 to 52 in debdae7 Meanwhile, we could think about how to address this |
Beta Was this translation helpful? Give feedback.
-
@blaz-r @samet-akcay |
Beta Was this translation helpful? Give feedback.
Yeah, we didn't really considers custom models for feature extraction. We thought timm or torchfx feature extractors are usually of interest.
What I would do for now is to directly customize patchcore and modify this bit however you like
anomalib/src/anomalib/models/image/patchcore/torch_model.py
Lines 48 to 52 in debdae7
Meanwhile, we could think about how to address this