Browse Source

[to #43259593] fix typo

master
Yingda Chen 3 years ago
parent
commit
856c4323b7
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      modelscope/pipelines/cv/image_colorization_pipeline.py
  2. +1
    -1
      modelscope/pipelines/cv/image_matting_pipeline.py

+ 1
- 1
modelscope/pipelines/cv/image_colorization_pipeline.py View File

@@ -88,7 +88,7 @@ class ImageColorizationPipeline(Pipeline):
img = input.convert('LA').convert('RGB') img = input.convert('LA').convert('RGB')
elif isinstance(input, np.ndarray): elif isinstance(input, np.ndarray):
if len(input.shape) == 2: if len(input.shape) == 2:
img = cv2.cvtColor(input, cv2.COLOR_GRAY2BGR)
input = cv2.cvtColor(input, cv2.COLOR_GRAY2BGR)
img = input[:, :, ::-1] # in rgb order img = input[:, :, ::-1] # in rgb order
img = PIL.Image.fromarray(img).convert('LA').convert('RGB') img = PIL.Image.fromarray(img).convert('LA').convert('RGB')
else: else:


+ 1
- 1
modelscope/pipelines/cv/image_matting_pipeline.py View File

@@ -46,7 +46,7 @@ class ImageMattingPipeline(Pipeline):
logger.info('load model done') logger.info('load model done')


def preprocess(self, input: Input) -> Dict[str, Any]: def preprocess(self, input: Input) -> Dict[str, Any]:
img = LoadImage.convert_to_img(input)
img = LoadImage.convert_to_ndarray(input)
img = img.astype(np.float) img = img.astype(np.float)
result = {'img': img} result = {'img': img}
return result return result


Loading…
Cancel
Save