Weaviate is a vector database that allows you to create and query embeddings with pre-trained deep learning models. It integrates with ResNet-50 to vectorize images, making it possible to build an image similarity search engine with relative ease.
docker-compose up
Create a new Node.js project and install the Weaviate TS client.
npm init
Initialize the client and fetch the schema just to make sure the database is up and running.
node test_client.js
Create a schema that contains an image property.
node create_schema.js
Images must first be converted to base64. Once converted, store it in the corresponding class in the schema. Weaviate will automatically use the neural network in the background to vectorize it and update the embedding.
node store_image.js
After storing a few images, we can provide an image as a query input. The database will use HNSW to quickly find similar-looking images.
node query_image.js