BII-wushuang / Lie-Group-Motion-Prediction

Code for CVPR2019 Towards Natural and Accurate Future Motion Prediction of Humans and Animals
https://coderstellaj.github.io/Hierarchical-Motion-Recurrent-Network-Website/
MIT License
98 stars 18 forks source link

how to calculate errors in 3D coordinate #8

Open Droliven opened 2 years ago

Droliven commented 2 years ago

After restoring your pretrained model and setting the random seed, I calculate the 3D coordinate error between y_t_xyz and y_p_xyz using the following L2-norm, code

def xyz_error(gt, out):
    '''
    gt: B, 100, 66
    '''
    batch_size, seq_len, features = gt.shape
    t_3d = np.zeros(seq_len)

    gt = gt.reshape(batch_size, seq_len, -1, 3) # B, 100, 22, 3
    out = out.reshape(batch_size, seq_len, -1, 3) # B, 100, 22, 3
    for k in np.arange(0, seq_len):
        t_3d[k] = np.mean(np.linalg.norm(gt[:, k, :, :].reshape(-1, 3) - out[:, k, :, :].reshape(-1, 3), 2, axis=1))
    return t_3d

the results are larger than those in your paper, I want to know how do you calculate errors in 3D coordinate ? have you scaled the source data?

3d

eular

Droliven commented 2 years ago

Since the 3D coordinate error of your model has a large performance gain of other baselines, i am so interested with the reason inside.

Droliven commented 2 years ago

And why the performance gain of eular error is not that large, compared with 3D coordinate error?

BII-wushuang commented 2 years ago

I remember the 3D joint positions L2 metric were evaluated with the following matlab script. We didn't scale the data but we performed Procrustes alignment, i.e. the global rotation and translation were set to 0 throughout.

And why the performance gain of eular error is not that large, compared with 3D coordinate error?

The Euler metric is not linear with respect to the 3D joint positions L2 metric. In fact the Euler mean angle error is not a geometrically meaningful metric (the geodesic error would be more geometrically meaningful in angular space whereas the L2 error would be good in 3D joint coordinates space). As such, we do not expect the performance gains between the two metrics to be linearly correlated.