From 2e2f0b32a30d2243a72e7a467cd0adb1688c7080 Mon Sep 17 00:00:00 2001 From: Jaap de Ruyter Date: Thu, 30 Apr 2026 16:27:22 +0200 Subject: [PATCH 1/2] fix visibility thresholding for `apply_softmax=True` 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 --- deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py b/deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py index ad53061cc..b32f2f45d 100644 --- a/deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py +++ b/deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py @@ -138,7 +138,8 @@ def get_simcc_maximum( mask = max_val_x > max_val_y max_val_x[mask] = max_val_y[mask] vals = max_val_x - locs[vals <= 0.0] = -1 + threshold = 1.0 / simcc_x.shape[-1] if apply_softmax else 0.0 + locs[vals <= threshold] = -1 if N: locs = locs.reshape(N, K, 2) From 8e988d74e5f21622505d3880eba4cc30c41d3637 Mon Sep 17 00:00:00 2001 From: Jaap de Ruyter Date: Thu, 30 Apr 2026 16:30:53 +0200 Subject: [PATCH 2/2] rtmpose: expose default parameters in config yaml (e.g. `apply_softmax`) --- .../pose_estimation_pytorch/config/rtmpose/rtmpose_m.yaml | 2 ++ .../pose_estimation_pytorch/config/rtmpose/rtmpose_s.yaml | 2 ++ .../pose_estimation_pytorch/config/rtmpose/rtmpose_x.yaml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_m.yaml b/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_m.yaml index d2ed3ae52..23424451e 100644 --- a/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_m.yaml +++ b/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_m.yaml @@ -51,6 +51,8 @@ model: simcc_split_ratio: 2.0 sigma: [5.66, 5.66] decode_beta: 150.0 + apply_softmax: true + normalize_outputs: false input_size: [256, 256] in_channels: 768 out_channels: "num_bodyparts" diff --git a/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_s.yaml b/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_s.yaml index 463e10465..62c5fc1ca 100644 --- a/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_s.yaml +++ b/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_s.yaml @@ -51,6 +51,8 @@ model: simcc_split_ratio: 2.0 sigma: [5.66, 5.66] decode_beta: 150.0 + apply_softmax: true + normalize_outputs: false input_size: [256, 256] in_channels: 512 out_channels: "num_bodyparts" diff --git a/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_x.yaml b/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_x.yaml index f1d6f61e6..fde7a4da5 100644 --- a/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_x.yaml +++ b/deeplabcut/pose_estimation_pytorch/config/rtmpose/rtmpose_x.yaml @@ -51,6 +51,8 @@ model: simcc_split_ratio: 2.0 sigma: [6.93, 6.93] decode_beta: 150.0 + apply_softmax: true + normalize_outputs: false input_size: [384, 384] in_channels: 1280 out_channels: "num_bodyparts"