logo
junjie.jiang 2 years ago
parent
commit
18504af3f1
  1. 10
      image_decode_cv2.py

10
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

Loading…
Cancel
Save