Browse Source

[to #42461396] add Pillow version constraint and update hub version

1.  use Pillow >= 6.2.0
2. change skip test msg for image caption
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9041194
master
wenmeng.zwm 3 years ago
parent
commit
b4fc38e1b9
3 changed files with 25 additions and 3 deletions
  1. +2
    -2
      requirements/runtime.txt
  2. +1
    -1
      tests/pipelines/test_image_captioning.py
  3. +22
    -0
      tests/preprocessors/test_image.py

+ 2
- 2
requirements/runtime.txt View File

@@ -1,10 +1,10 @@
addict addict
datasets datasets
easydict easydict
https://maashub.oss-cn-hangzhou.aliyuncs.com/releases/maas_hub-0.1.0.dev0-py2.py3-none-any.whl
https://mindscope.oss-cn-hangzhou.aliyuncs.com/sdklib/maas_hub-0.2.2.dev0-py3-none-any.whl
numpy numpy
opencv-python-headless opencv-python-headless
Pillow
Pillow>=6.2.0
pyyaml pyyaml
requests requests
tokenizers<=0.10.3 tokenizers<=0.10.3


+ 1
- 1
tests/pipelines/test_image_captioning.py View File

@@ -11,7 +11,7 @@ from modelscope.utils.constant import Tasks


class ImageCaptionTest(unittest.TestCase): class ImageCaptionTest(unittest.TestCase):


@unittest.skip('skip long test')
@unittest.skip('skip before model is restored in model hub')
def test_run(self): def test_run(self):
model = 'https://ofa-beijing.oss-cn-beijing.aliyuncs.com/checkpoints/caption_large_best_clean.pt' model = 'https://ofa-beijing.oss-cn-beijing.aliyuncs.com/checkpoints/caption_large_best_clean.pt'




+ 22
- 0
tests/preprocessors/test_image.py View File

@@ -0,0 +1,22 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import unittest

import PIL

from modelscope.preprocessors import load_image
from modelscope.utils.logger import get_logger


class ImagePreprocessorTest(unittest.TestCase):

def test_load(self):
img = load_image(
'http://pai-vision-data-hz.oss-cn-zhangjiakou.aliyuncs.com/data/test/maas/image_matting/test.png'
)
self.assertTrue(isinstance(img, PIL.Image.Image))
self.assertEqual(img.size, (948, 533))


if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save