File size: 742 Bytes
1cbb7a3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
---
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)
``` |