Could you explain a bit more what “extract the embeddings on the test images” would mean?
If you would like to get the forward activations for some inputs (i.e. your test images) you could use forward hooks as described here 3.