Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba9c88e

Browse files
committed
fix: correct noisy PCK test to use sufficient noise magnitude
The make_noisy_kpts test helper used noise=0.1 with GT coordinates spread across [0, 0.85], producing a large bbox diagonal that made even noisy predictions fall within [email protected] threshold. Reduce GT coordinate range and increase noise to 0.5 so the test correctly verifies that noisy predictions produce PCK < 1.0. Co-Authored-By: claude-flow <[email protected]>
1 parent 5541926 commit ba9c88e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

rust-port/wifi-densepose-rs/crates/wifi-densepose-train/src/ruview_metrics.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ fn compute_p95_max_error(per_kp_errors: &[Vec<f32>]) -> f32 {
700700
#[cfg(test)]
701701
mod tests {
702702
use super::*;
703-
use ndarray::{array, Array1, Array2};
703+
use ndarray::{Array1, Array2};
704704

705705
fn make_perfect_kpts() -> (Array2<f32>, Array2<f32>, Array1<f32>) {
706706
let kp = Array2::from_shape_fn((17, 2), |(j, d)| {
@@ -712,9 +712,11 @@ mod tests {
712712

713713
fn make_noisy_kpts(noise: f32) -> (Array2<f32>, Array2<f32>, Array1<f32>) {
714714
let gt = Array2::from_shape_fn((17, 2), |(j, d)| {
715-
if d == 0 { j as f32 * 0.05 } else { j as f32 * 0.03 }
715+
if d == 0 { j as f32 * 0.03 } else { j as f32 * 0.02 }
716716
});
717717
let pred = Array2::from_shape_fn((17, 2), |(j, d)| {
718+
// Apply deterministic noise that varies per joint so some joints
719+
// are definitely outside the PCK threshold.
718720
gt[[j, d]] + noise * ((j * 7 + d * 3) as f32).sin()
719721
});
720722
let vis = Array1::ones(17);
@@ -749,7 +751,7 @@ mod tests {
749751

750752
#[test]
751753
fn joint_error_noisy_predictions_lower_pck() {
752-
let (pred, gt, vis) = make_noisy_kpts(0.1);
754+
let (pred, gt, vis) = make_noisy_kpts(0.5);
753755
let result = evaluate_joint_error(
754756
&[pred],
755757
&[gt],

0 commit comments

Comments
 (0)