Giter Site home page Giter Site logo

nachiket92 / conv-social-pooling Goto Github PK

View Code? Open in Web Editor NEW
327.0 11.0 98.0 30 KB

Code for model proposed in: Nachiket Deo and Mohan M. Trivedi,"Convolutional Social Pooling for Vehicle Trajectory Prediction." CVPRW, 2018

License: MIT License

Python 80.46% MATLAB 19.54%

conv-social-pooling's Introduction

Convolutional Social Pooling

Code for model proposed in [1]. Implemented in Pytorch 0.4.0

[1] Nachiket Deo and Mohan M. Trivedi,"Convolutional Social Pooling for Vehicle Trajectory Prediction." CVPRW, 2018

conv-social-pooling's People

Contributors

nachiket92 avatar thelastpolaris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

conv-social-pooling's Issues

Use cpu instead of gpu

I don't have NVIDIA graphic installed on my system. I'm wondering if I can run this code with a limited dataset on CPU instead of GPU?

Dataset

Hey thanks for sharing the code. Any plan on releasing the preprocessed dataset. The .mat files?

Future trajectory encoding

What kind of future traj do we need for evaluation? ego-vehicle or surrounding vehicle?

utils.py line 80:
def getFuture(self, vehId, t,dsId): vehTrack = self.T[dsId-1][vehId-1].transpose() refPos = vehTrack[np.where(vehTrack[:, 0] == t)][0, 1:3] stpt = np.argwhere(vehTrack[:, 0] == t).item() + self.d_s enpt = np.minimum(len(vehTrack), np.argwhere(vehTrack[:, 0] == t).item() + self.t_f + 1) fut = vehTrack[stpt:enpt:self.d_s,1:3]-refPos return fut

Maneuver output

Hi ,
I want know what the relationship between output channels of lat_pred and lon_pred and the maneuver, I intend to use this maneuver to get the most possible predict trajectory.
waiting for your answer .

what is the meaning of the function logsumexp

Why is the difference required after the maximum value is taken

the code is following

## Helper function for log sum exp calculation:
def logsumexp(inputs, dim=None, keepdim=False):
    if dim is None:
        inputs = inputs.view(-1)
        dim = 0
    s, _ = torch.max(inputs, dim=dim, keepdim=True)
    outputs = s + (inputs - s).exp().sum(dim=dim, keepdim=True).log()
    if not keepdim:
        outputs = outputs.squeeze(dim)
    return outputs

image

nll

Why my training results differ greatly from the results of the original paper, mainly nll. What's wrong with rmse

preprocess_data.m

The program with 6 workers has been running for 40 hours and still hasn't finished.
What's wrong?

Considering seq2seq model

First of all, congratulations for this fantastic work!

Regarding the encoder-decoder architecture, have you ever considered using a seqquence-2-sequence model? In a seq2seq model, the decoder's input at t=n is the output of the decoder itself at t=n-1. I don't know whether it would be of any benefit, and it complicates the training and inference a little bit (typically, teacher forcing mode is used)

FileNotFoundError: [Errno 2] No such file or directory: 'data/TrainSet.mat'

Hello,
could you also please upload the dependent files,
Thanks in advance!

Error log

/home/npv0/exp/pytorch/venvpytorch/bin/python /home/npv0/exp/conv-social-pooling/train.py
Traceback (most recent call last):
File "/home/npv0/exp/pytorch/venvpytorch/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 33, in _open_file
return open(file_like, 'rb'), True
FileNotFoundError: [Errno 2] No such file or directory: 'data/TrainSet.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/npv0/exp/conv-social-pooling/train.py", line 44, in
trSet = ngsimDataset('data/TrainSet.mat')
File "/home/npv0/exp/conv-social-pooling/utils.py", line 14, in init
self.D = scp.loadmat(mat_file)['traj']
File "/home/npv0/exp/pytorch/venvpytorch/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 141, in loadmat
MR, file_opened = mat_reader_factory(file_name, appendmat, **kwargs)
File "/home/npv0/exp/pytorch/venvpytorch/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 64, in mat_reader_factory
byte_stream, file_opened = _open_file(file_name, appendmat)
File "/home/npv0/exp/pytorch/venvpytorch/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 39, in _open_file
return open(file_like, 'rb'), True
FileNotFoundError: [Errno 2] No such file or directory: 'data/TrainSet.mat'

plot the heat map

how to plot the heat map just like the Figure.5 in your paper?
is there any demo or tutorial?
thanks.

baseline not included

I was wondering if you could include the code for the CV Kalman filter as well that you used in your results table?

Dataset Problem

First of all, this is a fantastic work!
I have downloaded ‘Next_Generation_Simulation__NGSIM__Vehicle_Trajectories_and_Supporting_Data.csv’ dataset, but it can't match your code. I heard that the dataset had been updated.
So, could you please give us a dataset link which includes 6 txt? Or just give us your dataset detail format. I know you mentioned some in preprocess_data.m, but that is too rough. Or just upload example txt, please!

Result of the evaluate.py

Thanks for your contribution.
I have a question about the result of evaluate.py.
Why do I get a tensor after I run the evaluate.py?
And my result is as follows.
In my opinion, the result should be the values of loss and accuracy as well as the results of train.py.
Result of the evaluate

Meaning of fut_pred in details

The decode() function, in the highwayNet class, is the one returning the future trajectory predicted. Before returning the trajectory, fut_pred is modified by outputActivation() in utils.py.
The return value of outputActivation() is a concatenation of muX, muY, sigX, sigY and rho. The comment above tells us this output layer comes from Graves, 2015 but I don't understand the meaning of these 5 variables.

Can you explain to me the meaning of these variables?

NLL loss has negative values

When evaluating my trained model with NLL as metric, I realize negative values for early timesteps (such as -3.27 at 1 second). This would my predicted probability for the gt trajectory point is in the area of 1000 instead of a maximum of 1. I trained the model on a custom dataset and not on NGSIM. Any ideas where this comes from?

File Not present

Hi,

I have downloaded all the zip files as well as the large csv file "Next_Generation_Simulation__NGSIM__Vehicle_Trajectories_and_Supporting_Data.csv" , but i couldnt find few parameters such as {DatasetID, Lateral maneuver, Longitudinal maneuver}. May i know where i can find those data fields?

As mentioned in the "preprocess_data.m" the below files are not present in the zip files which i have downloaded.
us101_1 = 'raw/us101-0750-0805.txt';
us101_2 = 'raw/us101-0805-0820.txt';
us101_3 = 'raw/us101-0820-0835.txt';
i80_1 = 'raw/i80-1600-1615.txt';
i80_2 = 'raw/i80-1700-1715.txt';
i80_3 = 'raw/i80-1715-1730.txt';

Kindly help.

About output

Could you tell me if your output consists of future X and Y co-ordinates of predicted vehicles or not and if yes where is it?
I've taught it is in fut-pred vector but it seems not.

evaluate.py

Hi,
In the 'evaluate' program, what are the meanings of the two parameters, 'in_length = 16' and 'out_length = 25'? Don't we want to predict the vehicle trajectory in the next 5s? Why 'out'_length = 25?

How to get the raw input files?

Hi, I couldn't find the below files from NGSIM website. Could you provide me the link for those data? Thanks!

us101_1 = 'raw/us101-0750-0805.txt';
us101_2 = 'raw/us101-0805-0820.txt';
us101_3 = 'raw/us101-0820-0835.txt';
i80_1 = 'raw/i80-1600-1615.txt';
i80_2 = 'raw/i80-1700-1715.txt';
i80_3 = 'raw/i80-1715-1730.txt';

Covariance matrix not positive semidefinite

When I try to compute the explicit probabilities of the bivariate gaussian distribution, I first define the covariance matrix as [[1/sigX, rho], [rho, 1/sigY]]. This is working for most of the predictions. However, sometimes this matrix is not positive semidefinite which throws an error. Any clue on what am I doing wrong?

Inconsistency between X and Y loss

utils lines 170, 172 (for feet, meters respectively) have
0.5*torch.pow(sigY, 2)*torch.pow(y-muY, 2) for Y
but
torch.pow(sigX, 2) * torch.pow(x - muX, 2) for X

Standard deviation in prediction decreases for points further in the future

The figure below shows the bivariant gauss distribution of the model's prediction. It contains the 25 timesteps of the most likely maneuver (fut_pred_max). The model was trained with default settings on the NGSIM data set as described.
As you see in the figure, predicted points that are nearer in the future have a higher variance than points that are further in the future. Looking at the pure number confirms this.

How is this possible? Usually, the further the prediction is in the future the less certain you are about the exact position. So the variance should increase over time. Any help is appreciated!

soc_pool

The seq2seq model function

Hi,
How are the encoder and decoder functions defined, and how are the hidden states of each time step transformed into background variables.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.