Skip to content

RESTful API for vector similarity search. It uses the Python web framework FastAPI. This accelerates machine learning workflows that require vector similarity search using classification models.

License

Notifications You must be signed in to change notification settings

mbari-org/fastapi-vss

Repository files navigation

MBARI Python

fastapi-vss A RESTful API for vector similarity search. It uses the Python web framework FastAPI and the Redis database enabled as Vector database to provide a fast and efficient way to search for similar images based on vector embeddings in either real-time or batch mode.

This accelerates machine learning workflows using vector similarity search with classification models. It is particularly useful for applications like image retrieval, where you want to find images similar to a given query image for mining rare events, anomaly detection, or other tasks that require finding similar images.

This can be used with a foundational model and does not require a custom trained model, but it is more effective with a fine-tuned model.


Features

  • 🔍 Vector similarity search using fast Redis; you can search for similar images based on vector embeddings with a simple API call. Redis is an in-memory data structure store that supports fast vector search.
  • 📊 Supports foundational models like DINO and fine-tuned models for specific tasks.
  • Support batch processing for efficient querying of multiple images. Default batch size is 32; you can adjust it with the BATCH_SIZE environment variable to adjust to the available GPU memory.
  • Supports top-n search, where you can specify how many similar predictions to return, e.g. top_n=5 to return the top 5 similar predictions, where a prediction includes a score and the database id of the closest match.
  • The database ID corresponds to the image ID in the Tator database, which can be used to retrieve the original image. See the MBARI AI docs for more details.
  • 📦 Docker container for easy deployment
  • 📜 OpenAPI documentation for easy integration

Related work

About

RESTful API for vector similarity search. It uses the Python web framework FastAPI. This accelerates machine learning workflows that require vector similarity search using classification models.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published