Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the likelihood computation in SimCCPredictor to make it consistent with the MMPose decoding logic. The main issue was that likelihoods were either exceeding 1 (returning raw logits) or were extremely small due to improper softmax application across the entire SimCC space.
- Updates
SimCCPredictorto usesigmaanddecode_betaparameters for proper likelihood scaling - Changes default behavior to
apply_softmax=Truefor proper probability computation - Adds new
sigmaanddecode_betaparameters to RTMPose configuration files
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py | Core fix - adds sigma/decode_beta scaling and changes default apply_softmax to True |
| Multiple RTMPose config files | Adds sigma and decode_beta parameters to model configurations |
| Multiple other files | Cleanup of superanimal_humanbody specific code and infrastructure improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
|
cc @maximpavliv can you adress copilots suggestions? |
Contributor
Author
@MMathisLab yes, done! |
AlexEMG
approved these changes
Sep 16, 2025
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
The likelihoods (confidences) produced by
SimCCPredictorwere not consistent with the expected behavior of SimCC decoding.apply_softmax=True, likelihoods were extremely small (~1e-3). This is expected mathematically (softmax distributes probability mass across the entire SimCC space), but not useful as a visibility/confidence measure.normalize_outputs=True, most likelihoods were exactly 1, because normalization simply divided by the maximum logit value.This mismatch originated from how the raw SimCC representation vectors (logits over discretized x/y coordinates) were converted into coordinates and visibility scores.
See the original MMPose predictor implementation for reference.
Changes
This PR brings
SimCCPredictorcloser to the original MMPose decoding logic:1. Added parameters
sigma: variance of the Gaussian used to generate SimCC labels during training. This controls the expected sharpness of the label distribution.decode_beta: scaling factor applied together withsigmato logits before softmax. It acts like an inverse temperature in softmax: sharpening peaked distributions (visible keypoints) and flattening diffuse ones (occluded keypoints).Together,
sigma * decode_betaensures that visibility/confidence is decoded consistently with the label distribution used in training.2. Likelihood computation
normalize_outputs=False(which is the default): the raw logits are scaled by (sigma * decode_beta) before callingget_simcc_maximumwithapply_softmax=True. This matches the MMPose decoding step and yields meaningful visibility/confidence scores in[0,1].3. Default behavior
apply_softmaxnow defaults toTrue(to ensure proper probabilities rather than raw logits are returned).normalize_outputsstill defaults toFalse.Outcome
[0,1].normalize_outputsfor compatibility with previous behavior, but it is discouraged for real confidence estimation.