This article shows how we can quickly stand up an image similarity search app using txtai and Streamlit.
sentence-transformers recently added support for the OpenAI CLIP model. This model embeds text and images into the same space, enabling image similarity search. txtai can directly utilize these models.
Install dependencies
Install txtai
and all dependencies.
pip install git+https://github.com/neuml/txtai streamlit torchvision
# Get test data
wget -N https://github.com/neuml/txtai/releases/download/v3.5.0/tests.tar.gz
tar -xvzf tests.tar.gz
# Get application script
wget https://raw.githubusercontent.com/neuml/txtai/master/examples/images.py
Start the application
Start the application and search. The application takes a single command line argument to a directory of images. Run it against your own images and explore the results!
streamlit run images.py txtai/
Discussion (0)