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>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-22 08:34:38 +00:00
committed by GitHub
co-authored by kukulu00
parent db526b39b4
commit 005cc7b274
+3 -1
View File
@@ -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