Towhee
branch0.8.1

User Guide:

  • User Guide

User API:

  • towhee
  • towhee.DataCollection
  • Built-in Operators

Developer API:

  • towhee.operator
  • trainer package
  • trainer.optimization package
  • trainer.utils package

Full API:

  • towhee
    • towhee.add_cache_path
    • towhee.build_docker_image
    • towhee.dataset
    • towhee.update_default_cache
    • towhee.command
    • towhee.dag
    • towhee.data
    • towhee.dataframe
    • towhee.engine
    • towhee.errors
    • towhee.functional
    • towhee.hparam
    • towhee.hub
      • towhee.hub.builtin
        • towhee.hub.builtin.operators
        • towhee.hub.builtin.pipelines
      • towhee.hub.file_manager
      • towhee.hub.operator_manager
      • towhee.hub.pipeline_manager
      • towhee.hub.preclude
      • towhee.hub.repo_manager
    • towhee.models
    • towhee.operator
    • towhee.pipeline_format
    • towhee.serve
    • towhee.trainer
    • towhee.types
    • towhee.utils
Towhee
  • »
  • towhee »
  • towhee.hub »
  • towhee.hub.builtin »
  • towhee.hub.builtin.operators »
  • towhee.hub.builtin.operators.milvus_search »
  • towhee.hub.builtin.operators.milvus_search.milvus_search
  • Edit on GitHub

towhee.hub.builtin.operators.milvus_search.milvus_search¶

class towhee.hub.builtin.operators.milvus_search.milvus_search(collection, **kwargs)[source]¶

Bases: object

Search for embedding vectors in Milvus. Note that the Milvus collection has data before searching, refer to DataCollection Mixin to_milvus.

Parameters:
  • collection (str or pymilvus.Collection) – The collection name or pymilvus.Collection in Milvus.

  • kwargs –

    The kwargs with collection.search, refer to https://milvus.io/docs/v2.0.x/search.md#Prepare-search-parameters. And the anns_field defaults to the vector field name, limit defaults to 10, and metric_type in param defaults to ‘L2’ if there has no index(FLAT), and for default index param:

    IVF_FLAT: {“params”: {“nprobe”: 10}}, IVF_SQ8: {“params”: {“nprobe”: 10}}, IVF_PQ: {“params”: {“nprobe”: 10}}, HNSW: {“params”: {“ef”: 10}}, IVF_HNSW: {“params”: {“nprobe”: 10, “ef”: 10}}, RHNSW_FLAT: {“params”: {“ef”: 10}}, RHNSW_SQ: {“params”: {“ef”: 10}}, RHNSW_PQ: {“params”: {“ef”: 10}}, ANNOY: {“params”: {“search_k”: 10}}.

```python import towhee from pymilvus import connections connections.connect(host=’localhost’, port=’19530’) (

towhee.glob[‘path’](‘./*.jpg’)

.image_decode[‘path’, ‘img’]() .image_embedding.timm[‘img’, ‘vec’](model_name=’resnet50’) .milvus_search[‘vec’, ‘results’](collection=’test’) .to_list()

Methods

Attributes

metainfo

__call__(*args, **kws)¶

Call self as a function.

__init__(collection, **kwargs)[source]¶
Fork me on GitHub
Next Previous

© Copyright 2022 Zilliz. All rights reserved.. Revision 30b04ca1.

Read the Docs v: branch0.8.1
Versions
latest
main
branch0.8.1
branch0.8.0
branch0.7
branch0.6
Downloads
On Read the Docs
Project Home
Builds