fabro66 / GAST-Net-3DPoseEstimation

A Graph Attention Spatio-temporal Convolutional Networks for 3D Human Pose Estimation in Video (GAST-Net)
MIT License
313 stars 70 forks source link

How to get trajectory #9

Closed wangtss closed 3 years ago

wangtss commented 3 years ago

I notice that your real time demo contains 3D trajectory, do you plan to release the trajectory model?

fabro66 commented 3 years ago

This trajectory is only about (x, y) and does not include depth information. However, we can explore how to use existing prior knowledge to design a 3D trajectory model.

The following is the single-person trajectory transform function:

def revise_skes_real_time(prediction, re_kpts, width):
    ratio_2d_3d_width = ratio_2d_3d * (width / 1920)
    # prediction: (M, N, 3)
    new_prediction = np.zeros((len(prediction), 17, 3), dtype=np.float32)
    for i in range(len(prediction)):
        new_prediction[i] = prediction[i]

        initial_distance = re_kpts[i]
        initial_distance = np.mean(initial_distance[[1, 4, 11, 14], :], axis=0)
        new_prediction[i, :, 0] -= (initial_distance[0] - 2*width/5) / ratio_2d_3d_width
        new_prediction[i, :, 1] += (initial_distance[1] - width/5) / ratio_2d_3d_width

    new_prediction[:, :, 2] -= np.amin(new_prediction[:, :, 2])

    return new_prediction
wangtss commented 3 years ago

Thanks!!! helps a lot