Swin without Classification Head
Are each of these models atomic building blocks or can I dissect them at all? For example, I would like to use the Swin image transformermicrosoft/swin-base-patch4-window7-224 · Hugging Facebut leave out the classification head to only output the embedding. However, it appears the model goes straight from inputs to logits. Is breaking up a model to get the embedding possible?
2022-06-08T17:05:32Z
Hi! You can load this model as follows:from transformers import SwinModel
SwinModel.from_pretrained("microsoft/swin-base-patch4-window7-224")if you are are only interested in the “raw” model and not the classification head.