2023-09-25 21:09:18 +08:00
|
|
|
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
from modelscope.pipelines import pipeline
|
|
|
|
|
from modelscope.utils.constant import Tasks
|
|
|
|
|
from modelscope.utils.test_utils import test_level
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Human3DAnimationTest(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
def setUp(self) -> None:
|
|
|
|
|
self.model_id = 'damo/cv_3d-human-animation'
|
|
|
|
|
self.task = Tasks.human3d_animation
|
|
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
|
|
|
|
def test_run_modelhub(self):
|
|
|
|
|
human3d = pipeline(self.task, model=self.model_id)
|
|
|
|
|
input = {
|
|
|
|
|
'dataset_id': 'damo/3DHuman_synthetic_dataset',
|
2024-07-23 22:26:12 +08:00
|
|
|
'case_id': '000146', # 3f2a7538253e42a8
|
2023-09-25 21:09:18 +08:00
|
|
|
'action_dataset': 'damo/3DHuman_action_dataset',
|
|
|
|
|
'action': 'SwingDancing',
|
|
|
|
|
'save_dir': 'outputs',
|
2023-11-08 21:11:21 +08:00
|
|
|
'blender': 'blender',
|
2023-09-25 21:09:18 +08:00
|
|
|
}
|
|
|
|
|
output = human3d(input)
|
|
|
|
|
print('saved animation file to %s' % output)
|
|
|
|
|
|
|
|
|
|
print('human3d_animation.test_run_modelhub done')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|