sports2d 0.8.12__tar.gz → 0.8.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {sports2d-0.8.12 → sports2d-0.8.13}/PKG-INFO +1 -1
  2. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/process.py +13 -3
  3. {sports2d-0.8.12 → sports2d-0.8.13}/sports2d.egg-info/PKG-INFO +1 -1
  4. {sports2d-0.8.12 → sports2d-0.8.13}/.github/workflows/continuous-integration.yml +0 -0
  5. {sports2d-0.8.12 → sports2d-0.8.13}/.github/workflows/joss_pdf.yml +0 -0
  6. {sports2d-0.8.12 → sports2d-0.8.13}/.github/workflows/publish-on-release.yml +0 -0
  7. {sports2d-0.8.12 → sports2d-0.8.13}/.gitignore +0 -0
  8. {sports2d-0.8.12 → sports2d-0.8.13}/CITATION.cff +0 -0
  9. {sports2d-0.8.12 → sports2d-0.8.13}/Content/Demo_plots.png +0 -0
  10. {sports2d-0.8.12 → sports2d-0.8.13}/Content/Demo_results.png +0 -0
  11. {sports2d-0.8.12 → sports2d-0.8.13}/Content/Demo_terminal.png +0 -0
  12. {sports2d-0.8.12 → sports2d-0.8.13}/Content/Person_selection.png +0 -0
  13. {sports2d-0.8.12 → sports2d-0.8.13}/Content/Video_tuto_Sports2D_Colab.png +0 -0
  14. {sports2d-0.8.12 → sports2d-0.8.13}/Content/joint_convention.png +0 -0
  15. {sports2d-0.8.12 → sports2d-0.8.13}/Content/paper.bib +0 -0
  16. {sports2d-0.8.12 → sports2d-0.8.13}/Content/paper.md +0 -0
  17. {sports2d-0.8.12 → sports2d-0.8.13}/Content/sports2d_blender.gif +0 -0
  18. {sports2d-0.8.12 → sports2d-0.8.13}/Content/sports2d_opensim.gif +0 -0
  19. {sports2d-0.8.12 → sports2d-0.8.13}/LICENSE +0 -0
  20. {sports2d-0.8.12 → sports2d-0.8.13}/README.md +0 -0
  21. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Demo/Config_demo.toml +0 -0
  22. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Demo/demo.mp4 +0 -0
  23. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Sports2D.ipynb +0 -0
  24. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Sports2D.py +0 -0
  25. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Utilities/__init__.py +0 -0
  26. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Utilities/common.py +0 -0
  27. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Utilities/filter.py +0 -0
  28. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/Utilities/tests.py +0 -0
  29. {sports2d-0.8.12 → sports2d-0.8.13}/Sports2D/__init__.py +0 -0
  30. {sports2d-0.8.12 → sports2d-0.8.13}/pyproject.toml +0 -0
  31. {sports2d-0.8.12 → sports2d-0.8.13}/setup.cfg +0 -0
  32. {sports2d-0.8.12 → sports2d-0.8.13}/sports2d.egg-info/SOURCES.txt +0 -0
  33. {sports2d-0.8.12 → sports2d-0.8.13}/sports2d.egg-info/dependency_links.txt +0 -0
  34. {sports2d-0.8.12 → sports2d-0.8.13}/sports2d.egg-info/entry_points.txt +0 -0
  35. {sports2d-0.8.12 → sports2d-0.8.13}/sports2d.egg-info/requires.txt +0 -0
  36. {sports2d-0.8.12 → sports2d-0.8.13}/sports2d.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sports2d
3
- Version: 0.8.12
3
+ Version: 0.8.13
4
4
  Summary: Compute 2D human pose and angles from a video or a webcam.
5
5
  Author-email: David Pagnon <contact@david-pagnon.com>
6
6
  Maintainer-email: David Pagnon <contact@david-pagnon.com>
@@ -1830,7 +1830,7 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
1830
1830
  if fill_large_gaps_with.lower() == 'last_value':
1831
1831
  for col in all_frames_X_person_interp.columns:
1832
1832
  first_run_start, last_run_end = indices_of_first_last_non_nan_chunks(all_frames_Y_person_interp[col])
1833
- for coord_df in [all_frames_X_person_interp, all_frames_Y_person_interp]:
1833
+ for coord_df in [all_frames_X_person_interp, all_frames_Y_person_interp, all_frames_Z_homog]:
1834
1834
  coord_df.loc[:first_run_start, col] = np.nan
1835
1835
  coord_df.loc[last_run_end:, col] = np.nan
1836
1836
  coord_df.loc[first_run_start:last_run_end, col] = coord_df.loc[first_run_start:last_run_end, col].ffill().bfill()
@@ -1956,7 +1956,13 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
1956
1956
  # Convert to meters
1957
1957
  px_to_m_i = [convert_px_to_meters(trc_data[i][kpt_name], first_person_height, height_px, cx, cy, -floor_angle_estim, visible_side=visible_side_i) for kpt_name in new_keypoints_names]
1958
1958
  trc_data_m_i = pd.concat([all_frames_time.rename('time')]+px_to_m_i, axis=1)
1959
- trc_data_m_i = trc_data_m_i.ffill(axis=0).bfill(axis=0)
1959
+ for c in 3*np.arange(len(trc_data_m_i.columns[3::3]))+1: # only X coordinates
1960
+ first_run_start, last_run_end = indices_of_first_last_non_nan_chunks(trc_data_m_i.iloc[:,c])
1961
+ trc_data_m_i.iloc[:first_run_start,c+2] = np.nan
1962
+ trc_data_m_i.iloc[last_run_end:,c+2] = np.nan
1963
+ trc_data_m_i.iloc[first_run_start:last_run_end,c+2] = trc_data_m_i.iloc[first_run_start:last_run_end,c+2].ffill().bfill()
1964
+ first_trim, last_trim = trc_data_m_i.isnull().any(axis=1).idxmin(), trc_data_m_i[::-1].isnull().any(axis=1).idxmin()
1965
+ trc_data_m_i = trc_data_m_i.iloc[first_trim:last_trim+1,:]
1960
1966
  px_to_m_unfiltered_i = [convert_px_to_meters(trc_data_unfiltered[i][kpt_name], first_person_height, height_px, cx, cy, -floor_angle_estim) for kpt_name in new_keypoints_names]
1961
1967
  trc_data_unfiltered_m_i = pd.concat([all_frames_time.rename('time')]+px_to_m_unfiltered_i, axis=1)
1962
1968
 
@@ -2048,7 +2054,11 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
2048
2054
  logging.info(f'- Person {i}: Interpolating missing sequences if they are smaller than {interp_gap_smaller_than} frames. Large gaps filled with {fill_large_gaps_with}.')
2049
2055
  all_frames_angles_person_interp = all_frames_angles_person.apply(interpolate_zeros_nans, axis=0, args = [interp_gap_smaller_than, 'linear'])
2050
2056
  if fill_large_gaps_with == 'last_value':
2051
- all_frames_angles_person_interp = all_frames_angles_person_interp.ffill(axis=0).bfill(axis=0)
2057
+ for col in all_frames_angles_person_interp.columns:
2058
+ first_run_start, last_run_end = indices_of_first_last_non_nan_chunks(all_frames_angles_person_interp[col])
2059
+ all_frames_angles_person_interp.loc[:first_run_start, col] = np.nan
2060
+ all_frames_angles_person_interp.loc[last_run_end:, col] = np.nan
2061
+ all_frames_angles_person_interp.loc[first_run_start:last_run_end, col] = all_frames_angles_person_interp.loc[first_run_start:last_run_end, col].ffill().bfill()
2052
2062
  elif fill_large_gaps_with == 'zeros':
2053
2063
  all_frames_angles_person_interp.replace(np.nan, 0, inplace=True)
2054
2064
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sports2d
3
- Version: 0.8.12
3
+ Version: 0.8.13
4
4
  Summary: Compute 2D human pose and angles from a video or a webcam.
5
5
  Author-email: David Pagnon <contact@david-pagnon.com>
6
6
  Maintainer-email: David Pagnon <contact@david-pagnon.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes