diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 47a11cbc..43684a06 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -1,10 +1,10 @@ addict datasets 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 opencv-python-headless -Pillow +Pillow>=6.2.0 pyyaml requests tokenizers<=0.10.3 diff --git a/tests/pipelines/test_image_captioning.py b/tests/pipelines/test_image_captioning.py index 5584d0e2..76ffc79d 100644 --- a/tests/pipelines/test_image_captioning.py +++ b/tests/pipelines/test_image_captioning.py @@ -11,7 +11,7 @@ from modelscope.utils.constant import Tasks class ImageCaptionTest(unittest.TestCase): - @unittest.skip('skip long test') + @unittest.skip('skip before model is restored in model hub') def test_run(self): model = 'https://ofa-beijing.oss-cn-beijing.aliyuncs.com/checkpoints/caption_large_best_clean.pt' diff --git a/tests/preprocessors/test_image.py b/tests/preprocessors/test_image.py new file mode 100644 index 00000000..cfa7b11d --- /dev/null +++ b/tests/preprocessors/test_image.py @@ -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()