logo
Browse Source

Add PyOperator

Signed-off-by: Kaiyuan Hu <kaiyuan.hu@zilliz.com>
main
Kaiyuan Hu 2 years ago
parent
commit
55550c0f9b
  1. 3
      select_video.py

3
select_video.py

@ -16,10 +16,11 @@ from itertools import groupby
from typing import List from typing import List
from towhee import register from towhee import register
from towhee.operator import PyOperator
@register(output_schema=['vec']) @register(output_schema=['vec'])
class SelectVideo:
class SelectVideo(PyOperator):
def __init__(self, top_k: int, reduce_function: str = 'sum', reverse: bool = True): def __init__(self, top_k: int, reduce_function: str = 'sum', reverse: bool = True):
self.top_k = top_k self.top_k = top_k
self.reduce_function = reduce_function self.reduce_function = reduce_function

Loading…
Cancel
Save