logo
Browse Source

Update code

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 2 years ago
parent
commit
d7d3a85906
  1. 13
      faiss.py

13
faiss.py

@ -18,19 +18,6 @@ class Faiss(PyOperator):
The path to faiss index file(defaults to './index.bin') or faiss index.
kwargs
The kwargs with index.search, refer to https://github.com/facebookresearch/faiss/wiki. And the parameter `k` defaults to 10.
Examples:
>>> import towhee
>>> res = (
... towhee.glob['path']('./*.jpg')
... .image_decode['path', 'img']()
... .image_embedding.timm['img', 'vec'](model_name='resnet50')
... .faiss_search['vec', 'results'](findex='./faiss/faiss.index')
... .to_list()
... )
[<Entity dict_keys(['path', 'img', 'vec', 'results'])>,
<Entity dict_keys(['path', 'img', 'vec', 'results'])>]
"""
def __init__(self, findex, **kwargs):
self.faiss_index = findex

Loading…
Cancel
Save