From 005cc7b2741698a518414278eb9909f5d3863bbf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 08:34:38 +0000 Subject: [PATCH] Clarify fallback decoder scaling Agent-Logs-Url: https://github.com/IBB666/IBB_POSE/sessions/be2c1a27-aacc-43a8-adc6-0bb4dbae296e Co-authored-by: kukulu00 <1170651+kukulu00@users.noreply.github.com> --- models/HeatmapHead.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/HeatmapHead.py b/models/HeatmapHead.py index eb22380..753499c 100644 --- a/models/HeatmapHead.py +++ b/models/HeatmapHead.py @@ -97,6 +97,8 @@ class _FallbackUDPHeatmap: if 0 < y < height - 1: ys[idx] += np.sign(heatmaps[idx, y + 1, x] - heatmaps[idx, y - 1, x]) * 0.25 + # Match MMPose UDPHeatmap decoding, which maps heatmap coordinates from + # the [0, W-1] / [0, H-1] grid back into input image space. scale = self.input_size / np.maximum(self.heatmap_size - 1.0, 1.0) keypoints = np.stack((xs, ys), axis=-1) * scale @@ -269,7 +271,7 @@ class _FallbackHeatmapHead(nn.Module): idx = int(key_parts[1]) except ValueError as exc: raise RuntimeError( - f"Incompatible decoder checkpoint key: {key!r}. " + f"Incompatible state_dict key: {key!r}. " "Expected a numeric final_layer index." ) from exc num_conv_layers = len(self.conv_layers) if isinstance(self.conv_layers, nn.Sequential) else 0