update RTMPose SimCCPredictor: expose apply_softmax and fix visibility thresholding#3306
Open
deruyter92 wants to merge 4 commits into
Open
update RTMPose SimCCPredictor: expose apply_softmax and fix visibility thresholding#3306deruyter92 wants to merge 4 commits into
SimCCPredictor: expose apply_softmax and fix visibility thresholding#3306deruyter92 wants to merge 4 commits into
Conversation
the original visibility thresholding `locs[vals <= 0] = 1` makes sense for unnormalized logits, but after softmaxing this becomes effectively a no-op. The current commit changes this to a reasonable threshold for the case when apply_softmax=True
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts RTMPose’s SimCC decoding configuration and post-processing to make likelihood/visibility behavior reproducible across runs and to correct visibility masking when outputs are softmax-normalized.
Changes:
- Exposes
apply_softmax(and explicitly setsnormalize_outputs) in the default RTMPose config YAMLs to avoid silent behavior changes. - Updates
get_simcc_maximum()visibility masking by introducing a softmax-aware baseline threshold instead of<= 0.0.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py |
Adjusts SimCC visibility masking thresholding when apply_softmax is enabled. |
deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_x.yaml |
Exposes apply_softmax and normalize_outputs for the SimCC predictor in the X config. |
deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_s.yaml |
Exposes apply_softmax and normalize_outputs for the SimCC predictor in the S config. |
deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_m.yaml |
Exposes apply_softmax and normalize_outputs for the SimCC predictor in the M config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
C-Achard
approved these changes
May 12, 2026
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.
Motivation
A regression analysis revealed that naive training results in reduced mAP in recent versions of DeepLabCut (only scores and mAP are affected; keypoint predictions remain the same, so mAR, RMSE are stable).
Cause:
The cause could be pinpointed to the change in default value
apply_softmax=Trueintroduced in #3078. While this change is indeed required (output predictions should by default be normalized) this introduced two problems:apply_softmax=Truewithdecode_beta=150produces a sharp function which does not work well for all datasets. Sinceapply_softmaxis not exposed in the default config yaml, this causes a silent change in performance.locs[vals <= 0.0] = -1effectively is a no-op for the now normalized output values in range 0 to 1)Changes:
apply_softmax=Trueis now exposed in the default config yaml, to facilitate reproducible benchmark results with frozen configs.Note that the current PR does not alter the default value for the decode_beta parameter (might need further discussion and systematic testing), but for the current benchmarking results (see figure above), a value ~0.2 worked better than 300, and fully restored the original performance of before #3078
Update: a quick hyperparameter analysis was performed with different values of
decode_beta. See figures at the bottom. A separate PR will be opened to address this