There is a newer version of the record available.

Published October 20, 2025 | Version v0.8.22
Software Open

Sports2D: Compute 2D human pose and angles from a video or a webcam

Description

Miscelaneous

  • Rewrote the compute_floor_line function (see below)
  • Rewrote sorting algorithm (see below)
  • Better excluded estimates, based on min_chunk_size instead of a threshold of 10 valid frames
  • Made the person selection UI more computationally efficient
  • Last frame is the end of the video if not specified by time_range
  • Handled edge case with save_plots and show_plots
  • Ignored numpy "Mean of empty slice" warning

Rewrote the compute_floor_line function

This function is used to compute the angle and the level of the floor. This will also be useful to generate and/or import a calibration file. Here is how it works:

  • Trim the trial around the frames where the person is actually in the camera view
  • Remove the frames with low confidence
  • Compute the speed of the big toe points, and select the frames where it is below 1 m/s. Assume that this is when the foot is touching the floor. --> Unchanged

Instead of the first 2 steps, I used to only remove all the NaNs from the trial, which could lead to wrong speed estimates if some frames were skipped.

Rewrote the sorting algorithm to better handle some swap issues

  • Added a distance constraint, so that if the best association between a frame and the next one is too far, it creates a new person instead
  • Switched to frame-by-frame median keypoint distance (instead of mean), in order not to ignore outliers
  • Ran non-maximum suppression (NMS) for bounding boxes recomputed from keypoints instead of straight from the person detector, which is more accurate and prevents having 2 boxes for the same person
  • Added a likelihood threshold in the keypoints used to recompute the bounding boxes to ignore points that were probably wrongly estimated
  • This made me rewrite the algorithm from scratch, but with the same logic. Among other edits: I used the Hungarian algorithm from scipy.optimize.linear_sum_assignment, so my custom greedy min_with_single_indices function is not required anymore. This is very slightly slower with 2-3 people in the scene, but faster in crowded scenes.

Full Changelog: https://github.com/davidpagnon/Sports2D/compare/v0.8.21...v0.8.22

Notes

If you use this software, please cite our article in the Journal of Open Source Software.

Files

davidpagnon/Sports2D-v0.8.22.zip

Files (9.9 MB)

Name Size Download all
md5:ae99eb312afd674b211b29c0d31032a4
9.9 MB Preview Download

Additional details

Related works