|
|
@@ -16,6 +16,10 @@ class ImageCartoonTest(unittest.TestCase, DemoCompatibilityCheck): |
|
|
|
|
|
|
|
def setUp(self) -> None: |
|
|
|
self.model_id = 'damo/cv_unet_person-image-cartoon_compound-models' |
|
|
|
self.model_id_3d = 'damo/cv_unet_person-image-cartoon-3d_compound-models' |
|
|
|
self.model_id_handdrawn = 'damo/cv_unet_person-image-cartoon-handdrawn_compound-models' |
|
|
|
self.model_id_sketch = 'damo/cv_unet_person-image-cartoon-sketch_compound-models' |
|
|
|
self.model_id_artstyle = 'damo/cv_unet_person-image-cartoon-artstyle_compound-models' |
|
|
|
self.task = Tasks.image_portrait_stylization |
|
|
|
self.test_image = 'https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/image_cartoon.png' |
|
|
|
|
|
|
@@ -31,6 +35,30 @@ class ImageCartoonTest(unittest.TestCase, DemoCompatibilityCheck): |
|
|
|
Tasks.image_portrait_stylization, model=self.model_id) |
|
|
|
self.pipeline_inference(img_cartoon, self.test_image) |
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
|
def test_run_modelhub_3d(self): |
|
|
|
img_cartoon = pipeline( |
|
|
|
Tasks.image_portrait_stylization, model=self.model_id_3d) |
|
|
|
self.pipeline_inference(img_cartoon, self.test_image) |
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
|
def test_run_modelhub_handdrawn(self): |
|
|
|
img_cartoon = pipeline( |
|
|
|
Tasks.image_portrait_stylization, model=self.model_id_handdrawn) |
|
|
|
self.pipeline_inference(img_cartoon, self.test_image) |
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
|
def test_run_modelhub_sketch(self): |
|
|
|
img_cartoon = pipeline( |
|
|
|
Tasks.image_portrait_stylization, model=self.model_id_sketch) |
|
|
|
self.pipeline_inference(img_cartoon, self.test_image) |
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
|
def test_run_modelhub_artstyle(self): |
|
|
|
img_cartoon = pipeline( |
|
|
|
Tasks.image_portrait_stylization, model=self.model_id_artstyle) |
|
|
|
self.pipeline_inference(img_cartoon, self.test_image) |
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
|
def test_run_modelhub_default_model(self): |
|
|
|
img_cartoon = pipeline(Tasks.image_portrait_stylization) |
|
|
|