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/9041194master
| @@ -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 | ||||
| @@ -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' | ||||
| @@ -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() | |||||