diff --git a/Sports2D/Demo/Config_demo.toml b/Sports2D/Demo/Config_demo.toml index 984f427..f94c522 100644 --- a/Sports2D/Demo/Config_demo.toml +++ b/Sports2D/Demo/Config_demo.toml @@ -24,7 +24,7 @@ pose_algo = 'BLAZEPOSE' # 'OPENPOSE' or 'BLAZEPOSE' # Install OpenPose from https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation/0_index.md # BODY_25 is standard, BODY_25B is more accurate but requires downloading the model from # https://github.com/CMU-Perceptual-Computing-Lab/openpose_train/blob/master/experimental_models/README.md - openpose_model = 'BODY_25B' + openpose_model = 'BODY_25' # Installation path of openpose (between single quotes) openpose_path = 'D:\softs\openpose-1.6.0-binaries-win64-gpu-flir-3d_recommended\openpose' diff --git a/Sports2D/detect_pose.py b/Sports2D/detect_pose.py index 993a13b..f4bde3b 100644 --- a/Sports2D/detect_pose.py +++ b/Sports2D/detect_pose.py @@ -285,6 +285,7 @@ def json_to_csv(json_path, frame_rate, pose_model, interp_gap_smaller_than, filt keypoints_names = [node.name for _, _, node in RenderTree(model) if node.id!=None] keypoints_names_rearranged = [y for x,y in sorted(zip(keypoints_ids,keypoints_names))] keypoints_nb = len(keypoints_ids) + print(keypoints_nb) # Retrieve coordinates logging.info('Sorting people across frames.') @@ -301,8 +302,12 @@ def json_to_csv(json_path, frame_rate, pose_model, interp_gap_smaller_than, filt keypt = np.array(keypt) # Make sure keypt is as large as the number of persons that need to be detected if len(keypt) < nb_persons_to_detect: - empty_keypt_to_add = np.concatenate( [[ np.zeros([25,3]) ]] * (nb_persons_to_detect-len(keypt)) ) - keypt = [np.concatenate([keypt, empty_keypt_to_add]) if keypt!=[] else empty_keypt_to_add][0] + # print('\n') + # print(nb_persons_to_detect) + # print(len(keypt)) + # print(repr(keypt)) + empty_keypt_to_add = np.concatenate( [[ np.zeros([keypoints_nb,3]) ]] * (nb_persons_to_detect-len(keypt)) ) + keypt = [np.concatenate([keypt, empty_keypt_to_add]) if list(keypt)!=[] else empty_keypt_to_add][0] if 'keyptpre' not in locals(): keyptpre = keypt # Associate persons across frames diff --git a/setup.cfg b/setup.cfg index 70a8469..14129aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = sports2d -version = 0.2.5 +version = 0.2.6 author = David Pagnon author_email = contact@david-pagnon.com description = Detect pose and compute 2D joint angles from a video.