Daniil-Osokin / lightweight-human-pose-estimation-3d-demo.pytorch

Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Apache License 2.0
653 stars 137 forks source link

about threshold setting for detect keypoints #81

Closed lucaskyle closed 2 years ago

lucaskyle commented 2 years ago

thx for the great works!

I checked the 2d results, then I found there is no limit for heatmap score in extract_keypoints

Sometimes the results were bad, because it wrongly detected bad points. i just reject low score points by doing this.

      keypoint_with_score_and_id = (keypoints[i][0], keypoints[i][1], heatmap[keypoints[i][1], keypoints[i][0]],
                                      total_keypoint_num + keypoint_num)
        if heatmap[keypoints[i][1], keypoints[i][0]]<=0.2:
            continue
        keypoints_with_score_and_id.append(keypoint_with_score_and_id)
  1. it may reduce fp points
  2. it may speed up group_keypoints function

Also, i found a parameter like minPeaksDistance in cpp code, but in python the value was like

       for j in range(i+1, len(keypoints)):
            if math.sqrt((keypoints[i][0] - keypoints[j][0]) ** 2 +
                         (keypoints[i][1] - keypoints[j][1]) ** 2) < 6:
                suppressed[j] = 1

the value 6 should be according to the size of the output heatmap, right? Rather than a fixed number, the value should be adjusted accordingly.

Daniil-Osokin commented 2 years ago

Hi, thanks for the response! The threshold for keypoints closeness depends on gaussians size in heatmaps, they set during generation of gold data in training. So it is independent from input image/output heatmap size.

Daniil-Osokin commented 2 years ago

Hope, it is clear now.

lucaskyle commented 2 years ago

@Daniil-Osokin thanks for the response !