bird-dataset-vector / README.md
smenon8's picture
Update README.md
1cbb7a3 verified
metadata
license: mit

Vector Database

This is a chromadb based vector database containing indexed embeddings from the hugging face dataset: "Somnath01/Birds_Species".

Usage

import chromadb
from huggingface_hub import snapshot_download

vector_db_path = snapshot_download(
                  repo_id=vector_dataset.hf_dataset_path,
                  repo_type="dataset"
                )

client = chromadb.PersistentClient(
            path=os.path.join(vector_db_path, 
                              "bird_vector_db"))

collection = client.get_collection(name="BIRD")

# get 512*512 image feature vector

neighbors = collection.query(
                query_embeddings=[img_features[0].tolist()],
                n_results = 2)