mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

[Bug] PoseTrack18 evaluate AP=0.00 i may fixed

Open abc5z7 opened this issue 1 year ago • 0 comments

Prerequisite

  • [X] I have searched Issues and Discussions but cannot get the expected help.
  • [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmpose).

Environment

mmpose==0.29.0+

Reproduces the problem - code sample

Head AP: 0.0000, Shou AP: 0.0000, Elb AP: 0.0000, Wri AP: 0.0000, Hip AP: 0.0000, Knee AP: 0.0000, Ankl AP: 0.0000, Total AP: 0.0000

Reproduces the problem - command or script

both in tools/train.py or tools/test.py

Reproduces the problem - error message

2024-06-30 11:32:31,352 - mmpose - INFO - Saving checkpoint at 120 epochs 2024-06-30 12:03:02,610 - mmpose - INFO - Epoch(val) [120][745] Head AP: 0.0000, Shou AP: 0.0000, Elb AP: 0.0000, Wri AP: 0.0000, Hip AP: 0.0000, Knee AP: 0.0000, Ankl AP: 0.0000, Total AP: 0.0000

Additional information

when i train or val on PoseTrack18, it alway get a result of AP=0.0000 then i check this filemmpose/datasets/datasets/top_down/topdown_posetrack18_video_dataset.py, and find something wrong with im['id']. after self._get_mapping_id_name in Kpt2dSviewRgbVidTopDownDataset, the image['id'] will ascending order from 1, no matter what it is before such as 10019200000. so keypoint_results never match the correct image duo to a non-existent id. when i fix the bug as the code below, it works!

# note: the code is mmpose=0.x
class TopDownPoseTrack18VideoDataset(Kpt2dSviewRgbVidTopDownDataset):
#    def _write_keypoint_results(keypoint_results, gt_folder, pred_folder):
    def _write_keypoint_results(self, keypoint_results, gt_folder, pred_folder):
        ...
            for image in gt['images']:
                im = {}
#                im['id'] = image['id']
                im['id'] = self.name2id[image['file_name']]
                im['file_name'] = image['file_name']
                images.append(im)
                img_kpts = keypoint_results[im['id']]
        ...

all my running is on mmpose==0.x. Although i not have a try on mmpose==1.x but i do think it get the same problem and a same solution.

abc5z7 avatar Jul 18 '24 05:07 abc5z7