Skip to content

Commit

Permalink
Fix mapping error from mmpose's regression codec to SDK's components (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc authored and lvhan028 committed Mar 1, 2023
1 parent 0848795 commit 15be15b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mmdeploy/codebase/mmpose/deploy/pose_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ def get_postprocess(self, *args, **kwargs) -> Dict:
params['modulate_kernel'] = self.model_cfg.kernel_sizes[-1]
elif codec.type == 'SimCCLabel':
component = 'SimCCLabelDecode'
elif codec.type == 'RegressionLabel':
component = 'DeepposeRegressionHeadDecode'
elif codec.type == 'IntegralRegressionLabel':
component = 'DeepposeRegressionHeadDecode'
else:
raise RuntimeError(f'Unsupported codecs type: {codec.type}')
postprocess = dict(params=params, type=component)
Expand Down
2 changes: 2 additions & 0 deletions mmdeploy/codebase/mmpose/deploy/pose_detection_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def forward(self,
if codec.type == 'SimCCLabel':
batch_pred_x, batch_pred_y = batch_outputs
preds = self.head.decode((batch_pred_x, batch_pred_y))
elif codec.type in ['RegressionLabel', 'IntegralRegressionLabel']:
preds = self.head.decode(batch_outputs)
else:
preds = self.head.decode(batch_outputs[0])
results = self.pack_result(preds, data_samples)
Expand Down

0 comments on commit 15be15b

Please sign in to comment.