mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-10 04:22:33 +02:00
[to #42322933] unify keys forbody_3d_keypoints
统一关键点检测输出key的名字
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10359335
This commit is contained in:
@@ -222,7 +222,7 @@ TASK_OUTPUTS = {
|
||||
|
||||
# 3D human body keypoints detection result for single sample
|
||||
# {
|
||||
# "poses": [ # 3d pose coordinate in camera coordinate
|
||||
# "keypoints": [ # 3d pose coordinate in camera coordinate
|
||||
# [[x, y, z]*17], # joints of per image
|
||||
# [[x, y, z]*17],
|
||||
# ...
|
||||
@@ -236,7 +236,7 @@ TASK_OUTPUTS = {
|
||||
# and is only avaialbe when the "render" option is enabled.
|
||||
# }
|
||||
Tasks.body_3d_keypoints:
|
||||
[OutputKeys.POSES, OutputKeys.TIMESTAMPS, OutputKeys.OUTPUT_VIDEO],
|
||||
[OutputKeys.KEYPOINTS, OutputKeys.TIMESTAMPS, OutputKeys.OUTPUT_VIDEO],
|
||||
|
||||
# 2D hand keypoints result for single sample
|
||||
# {
|
||||
|
||||
@@ -180,7 +180,7 @@ class Body3DKeypointsPipeline(Pipeline):
|
||||
return res
|
||||
|
||||
def postprocess(self, input: Dict[str, Any], **kwargs) -> Dict[str, Any]:
|
||||
res = {OutputKeys.POSES: [], OutputKeys.TIMESTAMPS: []}
|
||||
res = {OutputKeys.KEYPOINTS: [], OutputKeys.TIMESTAMPS: []}
|
||||
|
||||
if not input['success']:
|
||||
pass
|
||||
@@ -197,7 +197,7 @@ class Body3DKeypointsPipeline(Pipeline):
|
||||
self.render_prediction(pred_3d_pose, output_video_path)
|
||||
res[OutputKeys.OUTPUT_VIDEO] = output_video_path
|
||||
|
||||
res[OutputKeys.POSES] = pred_3d_pose
|
||||
res[OutputKeys.KEYPOINTS] = pred_3d_pose
|
||||
res[OutputKeys.TIMESTAMPS] = self.timestamps
|
||||
return res
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Body3DKeypointsTest(unittest.TestCase, DemoCompatibilityCheck):
|
||||
|
||||
def pipeline_inference(self, pipeline: Pipeline, pipeline_input):
|
||||
output = pipeline(pipeline_input, output_video='./result.mp4')
|
||||
poses = np.array(output[OutputKeys.POSES])
|
||||
poses = np.array(output[OutputKeys.KEYPOINTS])
|
||||
print(f'result 3d points shape {poses.shape}')
|
||||
|
||||
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
||||
|
||||
Reference in New Issue
Block a user