From 0ae94190cd810817e1cc4cff0ab21fcb90644a63 Mon Sep 17 00:00:00 2001 From: Nacriema Date: Sun, 11 Feb 2024 15:16:23 +0000 Subject: [PATCH 1/2] fix bug when no detected person in video --- demo/demo_skeleton.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/demo/demo_skeleton.py b/demo/demo_skeleton.py index 52022ac6..2e2cd095 100644 --- a/demo/demo_skeleton.py +++ b/demo/demo_skeleton.py @@ -213,6 +213,8 @@ def pose_tracking(pose_results, max_tracks=2, thre=30): new_track['track_id'] = num_tracks new_track['data'] = [(idx, poses[j])] tracks.append(new_track) + if num_joints is None: + return None, None tracks.sort(key=lambda x: -len(x['data'])) result = np.zeros((max_tracks, len(pose_results), num_joints, 3), dtype=np.float16) for i, track in enumerate(tracks[:max_tracks]): @@ -284,9 +286,11 @@ def main(): fake_anno['keypoint'] = keypoint fake_anno['keypoint_score'] = keypoint_score - results = inference_recognizer(model, fake_anno) - - action_label = label_map[results[0][0]] + if fake_anno['keypoint'] is None: + action_label = '' + else: + results = inference_recognizer(model, fake_anno) + action_label = label_map[results[0][0]] pose_model = init_pose_model(args.pose_config, args.pose_checkpoint, args.device) From d4a6620ed40b9afac7978558b750e390254db7a9 Mon Sep 17 00:00:00 2001 From: kennymckormick Date: Mon, 19 Feb 2024 14:49:59 +0800 Subject: [PATCH 2/2] fix lint --- README.md | 2 +- demo/demo_skeleton.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2fa19848..b9d2ca7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PYSKL +# PYSKL [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revisiting-skeleton-based-action-recognition/skeleton-based-action-recognition-on-ntu-rgbd)](https://paperswithcode.com/sota/skeleton-based-action-recognition-on-ntu-rgbd?p=revisiting-skeleton-based-action-recognition) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/dg-stgcn-dynamic-spatial-temporal-modeling/skeleton-based-action-recognition-on-ntu-rgbd-1)](https://paperswithcode.com/sota/skeleton-based-action-recognition-on-ntu-rgbd-1?p=dg-stgcn-dynamic-spatial-temporal-modeling) diff --git a/demo/demo_skeleton.py b/demo/demo_skeleton.py index 2e2cd095..93867f54 100644 --- a/demo/demo_skeleton.py +++ b/demo/demo_skeleton.py @@ -213,7 +213,7 @@ def pose_tracking(pose_results, max_tracks=2, thre=30): new_track['track_id'] = num_tracks new_track['data'] = [(idx, poses[j])] tracks.append(new_track) - if num_joints is None: + if num_joints is None: return None, None tracks.sort(key=lambda x: -len(x['data'])) result = np.zeros((max_tracks, len(pose_results), num_joints, 3), dtype=np.float16)