Skip to content

Pose Metrics, PoseProcessors, and DTW#19

Merged
AmitMY merged 28 commits intosign-language-processing:mainfrom
cleong110:dtw_metrics
Mar 19, 2025
Merged

Pose Metrics, PoseProcessors, and DTW#19
AmitMY merged 28 commits intosign-language-processing:mainfrom
cleong110:dtw_metrics

Conversation

@cleong110
Copy link
Copy Markdown
Contributor

@cleong110 cleong110 commented Mar 7, 2025

Working on Pose Metrics, which use PoseProcessors, which will allow us to run DTW first, then call distance measures

Code broken out from #4

@cleong110 cleong110 marked this pull request as ready for review March 10, 2025 19:58
@cleong110
Copy link
Copy Markdown
Contributor Author

@AmitMY Could use your thoughts on the following:

  • PoseMetric's main distinction from BaseMetric is that it runs poseprocessors first
  • However some poseprocessors operate on exactly 1, exactly 2, or all of the poses. For example the reduce to intersection one only makes sense if all hypotheses and references go through at once.
  • fastdtw requires you to pass it exactly two 1-D arrays, you cannot pass it the whole hyp_data and ref_data. I added code to iterate accordingly over keypoint trajectories.
  • fastdtw seems pretty slow! It takes nearly a minute to run on my laptop for just two poses.
  • DTWMeasure is currently inheriting from AggregatedPowerDistancesMeasure but that doesn't seem quite right.

Currently the score with signatures looks like this:

DTWPowerDistance|hb:no|pre:[normalize_poses|s:1,reduce_poses_to_intersection,remove_world_landmarks,hide_legs|remove:yes]|distance_measure:{power_distance|pow:2.0|dflt:0.0|agg:mean} = 5.923352071881241

Copy link
Copy Markdown
Contributor

@AmitMY AmitMY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite an easy merge. just run black, and some minor comments

@cleong110
Copy link
Copy Markdown
Contributor Author

@AmitMY before making any code changes, what are your thoughts on #19 (comment)

@AmitMY
Copy link
Copy Markdown
Contributor

AmitMY commented Mar 14, 2025

PoseMetric's main distinction from BaseMetric is that it runs poseprocessors first

Good

However some poseprocessors operate on exactly 1, exactly 2, or all of the poses. For example the reduce to intersection one only makes sense if all hypotheses and references go through at once.

I think that's fine, we can always call the processor with all available poses we have, and then process them either in a batch or separately depending on the processor (you wrote that code)

fastdtw requires you to pass it exactly two 1-D arrays, you cannot pass it the whole hyp_data and ref_data. I added code to iterate accordingly over keypoint trajectories.

I see what you did. There's advantages and disadvantages to working in 1D. working in 178D is probably more accurate for the entire body, but doesn't allow different phonemes to happen at different times (face movement and hand movement for example) - but single keypoint trajectory can also be optimized for strange unaligned outputs, where there is no structure...

fastdtw seems pretty slow! It takes nearly a minute to run on my laptop for just two poses.

Strange. should be much faster.

DTWMeasure is currently inheriting from AggregatedPowerDistancesMeasure but that doesn't seem quite right.

You don't have to inherit there. can extend Mesaure if you prefer.

@AmitMY AmitMY merged commit 1e6d9f7 into sign-language-processing:main Mar 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants