Questions about image classification based on feature vector

Hello, I am trying to implement image classification based on feature vector. I followed this tutorial and added

model_conv = models.resnet18(pretrained=True)
feature_extractor = torch.nn.Sequential(*list(model_conv.children())[:-1])
x = torch.randn([1,3,224,224])
output1 = feature_extractor(x)

and got a result of 512 output. My questions are

β€œAre there outputs are features of the trained model?”
if I want to extract features of one image should I follow the same procedure?
Thank you

The output of the model should be feature extracted by the model.

Thank you for the reply. If I understood correctly, I trained my model with dataset β€œA” and extracted feature of this model which means feature of dataset β€œA”. Right?

Yes, you are correct.

1 Like