mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 03:59:23 +01:00
21 lines
468 B
Python
21 lines
468 B
Python
# 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('data/test/images/image_matting.png')
|
|
self.assertTrue(isinstance(img, PIL.Image.Image))
|
|
self.assertEqual(img.size, (948, 533))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|