From 55550c0f9baaaca243861561b681a60b97b47554 Mon Sep 17 00:00:00 2001 From: Kaiyuan Hu Date: Thu, 29 Dec 2022 19:44:41 +0800 Subject: [PATCH] Add PyOperator Signed-off-by: Kaiyuan Hu --- select_video.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/select_video.py b/select_video.py index a8413f6..e734633 100644 --- a/select_video.py +++ b/select_video.py @@ -16,10 +16,11 @@ from itertools import groupby from typing import List from towhee import register +from towhee.operator import PyOperator @register(output_schema=['vec']) -class SelectVideo: +class SelectVideo(PyOperator): def __init__(self, top_k: int, reduce_function: str = 'sum', reverse: bool = True): self.top_k = top_k self.reduce_function = reduce_function