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