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

about threshold setting for detect keypoints

lucaskyle opened this issue · 3 comments

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.

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.

Hope, it is clear now.

@Daniil-Osokin
thanks for the response !