统一关键点检测输出key的名字
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10359335
master
| @@ -222,7 +222,7 @@ TASK_OUTPUTS = { | |||||
| # 3D human body keypoints detection result for single sample | # 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], # joints of per image | ||||
| # [[x, y, z]*17], | # [[x, y, z]*17], | ||||
| # ... | # ... | ||||
| @@ -236,7 +236,7 @@ TASK_OUTPUTS = { | |||||
| # and is only avaialbe when the "render" option is enabled. | # and is only avaialbe when the "render" option is enabled. | ||||
| # } | # } | ||||
| Tasks.body_3d_keypoints: | 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 | # 2D hand keypoints result for single sample | ||||
| # { | # { | ||||
| @@ -180,7 +180,7 @@ class Body3DKeypointsPipeline(Pipeline): | |||||
| return res | return res | ||||
| def postprocess(self, input: Dict[str, Any], **kwargs) -> Dict[str, Any]: | 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']: | if not input['success']: | ||||
| pass | pass | ||||
| @@ -197,7 +197,7 @@ class Body3DKeypointsPipeline(Pipeline): | |||||
| self.render_prediction(pred_3d_pose, output_video_path) | self.render_prediction(pred_3d_pose, output_video_path) | ||||
| res[OutputKeys.OUTPUT_VIDEO] = 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 | res[OutputKeys.TIMESTAMPS] = self.timestamps | ||||
| return res | return res | ||||
| @@ -21,7 +21,7 @@ class Body3DKeypointsTest(unittest.TestCase, DemoCompatibilityCheck): | |||||
| def pipeline_inference(self, pipeline: Pipeline, pipeline_input): | def pipeline_inference(self, pipeline: Pipeline, pipeline_input): | ||||
| output = pipeline(pipeline_input, output_video='./result.mp4') | 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}') | print(f'result 3d points shape {poses.shape}') | ||||
| @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') | @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') | ||||