2gauravc / w_yrs_poc1

0 stars 0 forks source link

KeyError after identifying critical frames #6

Closed 2gauravc closed 3 years ago

2gauravc commented 3 years ago

Reference Video: vjump-t1a.mov

Console Output

CRITICAL FRAMES IDENTIFIED: Squat posture: frame 1 Jump Peak posture: frame 1 Landing posture: frame 58

Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2891, in get_loc return self._engine.get_loc(casted_key) File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 1032, in pandas._libs.hashtable.Int64HashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 1039, in pandas._libs.hashtable.Int64HashTable.get_item KeyError: 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "main_program.py", line 158, in run_vjump_analysis() File "main_program.py", line 123, in run_vjump_analysis if my_video.need_to_impute_critical_frames() == False: File "/home/ubuntu/w_yrs_poc1/code/VJump/VJump.py", line 278, in need_to_impute_critical_frames if self.df_vid_points.loc[temp_frame + adj, critical_points].isna().sum() == 0: File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 873, in getitem return self._getitem_tuple(key) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1044, in _getitem_tuple return self._getitem_lowerdim(tup) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 786, in _getitem_lowerdim section = self._getitem_axis(key, axis=i) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1110, in _getitem_axis return self._get_label(key, axis=axis) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1059, in _get_label return self.obj.xs(label, axis=axis) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 3488, in xs loc = self.index.get_loc(key) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2893, in get_loc raise KeyError(key) from err KeyError: 0

Log Output

03-Oct-20 09:44:53 - DEBUG - Locating body points - frame 81 of 81. 03-Oct-20 09:45:04 - DEBUG - Successfully located body points in video. 03-Oct-20 09:45:04 - DEBUG - Starting to identify critical frames in video. 03-Oct-20 09:45:04 - DEBUG - Successfully identified critical frames in video. 03-Oct-20 09:45:04 - DEBUG - Squat posture frame = 1 03-Oct-20 09:45:04 - DEBUG - Jump Peak posture frame = 1 03-Oct-20 09:45:04 - DEBUG - Landing posture frame = 58 03-Oct-20 09:45:04 - DEBUG - Starting to access vertical jump success criteria file. 03-Oct-20 09:45:04 - DEBUG - Successfully accessed vertical jump success criteria file. 03-Oct-20 09:45:04 - DEBUG - Starting to assess need for data imputation in critical frames. 03-Oct-20 09:45:04 - DEBUG - Starting adjustment of critical frames to nearby frames to avoid data imputation.

2gauravc commented 3 years ago

Closed. Fixed by introducing a check in vjump.py before assigning jump_squat_frame_adjusters list.