Created
July 13, 2019 08:22
-
-
Save gautham20/4a091c7505747e58152eea1f61d8f27a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_similar_images_annoy(img_index): | |
start = time.time() | |
base_img_id, base_vector, base_label = img_repr_df.iloc[img_index, [0, 1, 2]] | |
similar_img_ids = t.get_nns_by_item(img_index, 13) | |
end = time.time() | |
print(f'{(end - start) * 1000} ms') | |
return base_img_id, base_label, img_repr_df.iloc[similar_img_ids[1:]] | |
base_image, base_label, similar_images_df = get_similar_images_annoy(212693) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment