Skip to content

Instantly share code, notes, and snippets.

@gautham20
Created July 13, 2019 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gautham20/8c420f36b98b3e1d31cbef287d67f601 to your computer and use it in GitHub Desktop.
Save gautham20/8c420f36b98b3e1d31cbef287d67f601 to your computer and use it in GitHub Desktop.
from annoy import AnnoyIndex
feature_dim = len(img_repr_df['img_repr'][0])
t = AnnoyIndex(feature_dim, metric='euclidean')
for i, vector in enumerate(img_repr_df['img_repr']):
t.add_item(i, vector)
_ = t.build(inference_data.c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment