Based on the following article, I created a notebook for similar image search using an autoencoder.

https://medium.com/pytorch/image-similarity-search-in-pytorch-1a744cf3469

The notebook is available below.

https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/Image_Similarity_Search_in_PyTorch.ipynb

You can verify its operation by selecting “Runtime” > “Run all.”

I hope this is helpful.