From 7e51ef22d1e4d54a7606d11319ec738682926068 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Mon, 28 Mar 2022 15:28:34 +0800 Subject: [PATCH] Update Signed-off-by: Jael Gu --- timm_image.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/timm_image.py b/timm_image.py index f937cab..2d46205 100644 --- a/timm_image.py +++ b/timm_image.py @@ -57,7 +57,7 @@ class TimmImage(NNOperator): def __call__(self, img: numpy.ndarray) -> numpy.ndarray: if hasattr(img, 'mode'): if img.mode not in ['RGB', 'BGR']: - log.error(f'Invalid image mode: expect "RGB" but receive "{img.mode}".') + log.error(f'Invalid image mode: expect "RGB" or "BGR" but receive "{img.mode}".') raise AssertionError(f'Invalid image mode "{img.mode}".') elif img.mode == 'BGR': img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) @@ -79,14 +79,13 @@ class TimmImage(NNOperator): # if __name__ == '__main__': -# import cv2 # from towhee._types import Image # # # path = '/path/to/image' # img = cv2.imread(path) # img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) -# img = Image(img, 'RGB') +# img = Image(img) # # op = TimmImage('resnet50') # out = op(img)