plai-group / flexible-video-diffusion-modeling

MIT License
111 stars 14 forks source link

What the function of actions_*.npy in CARLA Town 01 dataset? #4

Closed JunyaoHu closed 1 year ago

JunyaoHu commented 1 year ago

It seems that actions_*.npy and coords_*.npy are same things.

import numpy as np

actions = np.load('./CARLA_Town_01/no-traffic/actions_1.npy')

print(np.min(actions), np.max(actions), actions.shape)
# -1.5735552285261643 159.9499969482422 (1000, 11)

actions[100]
# array([ 1.33071884e+02,  5.94759941e+01,  1.83124538e-03, -4.79936576e-04,
#         2.94598984e-02, -3.94147841e-05,  0.00000000e+00,  2.00000000e+01,
#         1.36390244e+02,  5.94943962e+01,  0.00000000e+00])

coords = np.load('./CARLA_Town_01/no-traffic/coords_1.npy')

print(np.min(coords), np.max(coords), coords.shape)
# -1.5735552285261643 159.9499969482422 (1000, 11)

coords[100]
# array([ 1.33071884e+02,  5.94759941e+01,  1.83124538e-03, -4.79936576e-04,
#         2.94598984e-02, -3.94147841e-05,  0.00000000e+00,  2.00000000e+01,
#         1.36390244e+02,  5.94943962e+01,  0.00000000e+00])

(actions == coords).all()
#  True
wsgharvey commented 1 year ago

Thanks for pointing this out, it seems there are extra columns in the coords files that we hadn't intended to include. The first two columns in either tensor are the (x,y) coordinates describing the car's position (that we use as described in Section 5 of the paper). So to get them you can just use e.g. coords = np.load('./CARLA_Town_01/no-traffic/coords_1.npy')[:, :2]

We never use the actions_*.npy files. We released them to make possible e.g. action-conditional video generation in future work but I would have to look in more detail to figure out why they are the same as the coords_*.npy files and what exactly the other columns mean.