Overview
I created a sample program for performing similar image search using GUIE (Google Universal Image Embedding) pre-trained models. You can access the notebook from the following link.
https://colab.research.google.com/github/nakamura196/000_tools/blob/main/guie_sample.ipynb
References
It uses the model output from the following notebook.
https://www.kaggle.com/code/francischen1991/tf-baseline-v2-submission
Usage Notes
Kaggle Account
A Kaggle account is required to run the notebook. Obtain a Kaggle API Key and register it in your secrets.

If the following is displayed, please click “Allow access.”

Also, you will need to wait for some time while the model is being downloaded from Kaggle.
Results
The similar image search results are displayed as follows.

Some images from the gallery “Gion Matsuri” published on Japan Search are used.
https://jpsearch.go.jp/gallery/ndl-kbjG03kKgjp
Notes
torchvision Version
The default version of torchvision installed in Google Colab did not work properly, and it was necessary to downgrade the version to around 0.12.0.
Summary
In the future, I would like to use Elasticsearch’s approximate nearest neighbor search to search the vectors created this time.
https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html
We hope this is helpful.