From 18504af3f1050e4cfb162b9ec34219d6d981a8f1 Mon Sep 17 00:00:00 2001 From: "junjie.jiang" Date: Wed, 27 Jul 2022 12:57:19 +0800 Subject: [PATCH] update --- image_decode_cv2.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/image_decode_cv2.py b/image_decode_cv2.py index 0e49b2e..5e07424 100644 --- a/image_decode_cv2.py +++ b/image_decode_cv2.py @@ -13,10 +13,6 @@ from towhee.utils import ndarray_utils from towhee.utils.log import engine_log -@register( - input_schema=[(str, (1,))], - output_schema=[(Image, (-1, -1, 3))] -) class ImageDecoder(PyOperator): def __init__(self): super().__init__() @@ -51,6 +47,12 @@ class ImageDecoder(PyOperator): rgb_cv_image = cv2.cvtColor(bgr_cv_image, cv2.COLOR_BGR2RGB) return Image(rgb_cv_image, 'RGB') + def input_schema(self): + return [(str, (1,))] + + def output_schema(self): + return [(Image, (-1, -1, 3))] + @property def shared_type(self): return SharedType.Shareable