Browse Source

[to #42670107] restore pydataset test

* pydataset unitest
        Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9132896
master
feiwu.yfw yingda.chen 3 years ago
parent
commit
b8ba35bd27
3 changed files with 2 additions and 4 deletions
  1. +1
    -1
      modelscope/utils/registry.py
  2. +1
    -1
      tests/pipelines/test_image_matting.py
  3. +0
    -2
      tests/pydatasets/test_py_dataset.py

+ 1
- 1
modelscope/utils/registry.py View File

@@ -78,7 +78,7 @@ class Registry(object):
f'{self._name}[{default_group}] and will '
'be overwritten')
logger.warning(f'{self._modules[default_group][module_name]}'
'to {module_cls}')
f'to {module_cls}')
# also register module in the default group for faster access
# only by module name
self._modules[default_group][module_name] = module_cls


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

@@ -60,7 +60,7 @@ class ImageMattingTest(unittest.TestCase):
cv2.imwrite('result.png', result['output_png'])
print(f'Output written to {osp.abspath("result.png")}')

@unittest.skipUnless(test_level() >= 2, 'skip test in current test level')
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
def test_run_with_modelscope_dataset(self):
dataset = PyDataset.load('beans', split='train', target='image')
img_matting = pipeline(Tasks.image_matting, model=self.model_id)


+ 0
- 2
tests/pydatasets/test_py_dataset.py View File

@@ -33,8 +33,6 @@ class ImgPreprocessor(Preprocessor):

class PyDatasetTest(unittest.TestCase):

@unittest.skipUnless(test_level() >= 2,
'skip test due to dataset api problem')
def test_ds_basic(self):
ms_ds_full = PyDataset.load('squad')
ms_ds_full_hf = hfdata.load_dataset('squad')


Loading…
Cancel
Save