realcrane / Human-Trajectory-Prediction-via-Neural-Social-Physics

Our ECCV 2022 paper Human Trajectory Prediction via Neural Social Physics
128 stars 19 forks source link

Question about test in train_nsp_w.py #20

Open godnuan opened 1 year ago

godnuan commented 1 year ago

Hi, thanks for your great work and for releasing the code! In the test function, I noticed that predictions is generated through the ground truth traj, is this not very reasonable?

for t in range(best_of_n): alpha_recon = model_cvae.forward(x, device=device) alpha_step[t, :, :] = alpha_recon alpha_step[-1,:,:] = torch.zeros_like(alpha_step[-1,:,:]) prediction_correct = alpha_step / params['data_scale'] + prediction predictions_norm = torch.norm((prediction_correct - traj[:, 8, :2]), dim=-1) values, indices = torch.min(predictions_norm, dim=0) # peds ns_recon_best = prediction_correct[indices, [x for x in range(len(traj))], :] # peds*2 predictions[:, 0, :] = ns_recon_best

for t in range(best_of_n): alpha_recon = model_cvae.forward(x, device=device) alpha_step[t, :, :] = alpha_recon alpha_step[-1, :, :] = torch.zeros_like(alpha_step[-1, :, :]) prediction_correct = alpha_step / params['data_scale'] + prediction predictions_norm = torch.norm((prediction_correct - traj[:, 8+m, :2]), dim=-1) values, indices = torch.min(predictions_norm, dim=0) # peds ns_recon_best = prediction_correct[indices, [x for x in range(len(traj))], :] # peds*2 predictions[:, m, :] = ns_recon_best

JiangbeiYue commented 1 year ago

Hi,

Using the traj to find the best prediction after using CVAE is just an efficient way to calculate the best ADE and FDE under the ultra-sampling setting detailed in our paper. It is just a way of computing the metric. Our model doesn’t need the ground truth for prediction.

zpn108 commented 2 months ago

I have the same question, I think the current_step and current_vel is from ns_recon_best which is gotted from a selected point nearest to the ground truth, so the prediction use the ground truth info. Looking forward to your reply,thanks @JiangbeiYue