|
@ -13,10 +13,6 @@ from towhee.utils import ndarray_utils |
|
|
from towhee.utils.log import engine_log |
|
|
from towhee.utils.log import engine_log |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register( |
|
|
|
|
|
input_schema=[(str, (1,))], |
|
|
|
|
|
output_schema=[(Image, (-1, -1, 3))] |
|
|
|
|
|
) |
|
|
|
|
|
class ImageDecoder(PyOperator): |
|
|
class ImageDecoder(PyOperator): |
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
super().__init__() |
|
|
super().__init__() |
|
@ -51,6 +47,12 @@ class ImageDecoder(PyOperator): |
|
|
rgb_cv_image = cv2.cvtColor(bgr_cv_image, cv2.COLOR_BGR2RGB) |
|
|
rgb_cv_image = cv2.cvtColor(bgr_cv_image, cv2.COLOR_BGR2RGB) |
|
|
return Image(rgb_cv_image, 'RGB') |
|
|
return Image(rgb_cv_image, 'RGB') |
|
|
|
|
|
|
|
|
|
|
|
def input_schema(self): |
|
|
|
|
|
return [(str, (1,))] |
|
|
|
|
|
|
|
|
|
|
|
def output_schema(self): |
|
|
|
|
|
return [(Image, (-1, -1, 3))] |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def shared_type(self): |
|
|
def shared_type(self): |
|
|
return SharedType.Shareable |
|
|
return SharedType.Shareable |
|
|