Git Product home page Git Product logo

rohanchandra30 / tracknpred Goto Github PK

View Code? Open in Web Editor NEW
193.0 7.0 64.0 143.59 MB

This is the code base for our ACM CSCS 2019 paper: "RobustTP: End-to-End Trajectory Prediction for Heterogeneous Road-Agents in Dense Traffic with Noisy Sensor Inputs". This codebase contains implementations for several trajectory prediction methods including Social-GAN and TraPHic.

Home Page: https://arxiv.org/pdf/1907.08752.pdf

Python 62.38% CMake 4.96% Makefile 4.90% C 5.04% C++ 22.54% MATLAB 0.18%
social-gan trajectory-prediction deep-learning social-lstm yolo road-agents prediction cvpr traphic icra

tracknpred's Introduction

TrackNPred: A Software Framework for End-to-End Trajectory Prediction

This is the code base for our ACM CSCS 2019 paper,

RobustTP: End-to-End Trajectory Prediction for Heterogeneous Road-Agents in Dense Traffic with Noisy Sensor Inputs.
Rohan Chandra, Uttaran Bhattacharya, Christian Roncal, Aniket Bera, Dinesh Manocha

Please cite our work if you found this useful:

@article{chandra2019robusttp,
  title={RobustTP: End-to-End Trajectory Prediction for Heterogeneous Road-Agents in Dense Traffic with Noisy Sensor Inputs},
  author={Chandra, Rohan and Bhattacharya, Uttaran and Roncal, Christian and Bera, Aniket and Manocha, Dinesh},
  journal={arXiv preprint arXiv:1907.08752},
  year={2019}
}

A Visualized Approach to Deep Learning

Overview

We present RobustTP, an end-to-end algorithm for predicting future trajectories of road-agents in dense traffic with noisy sensor input trajectories obtained from RGB cameras (either static or mov-ing) through a tracking algorithm. In this case, we consider noise as the deviation from the ground truth trajectory. The amount of noise depends on the accuracy of the tracking algorithm. Our approach is designed for dense heterogeneous traffic, where the road agents corresponding to a mixture of buses, cars, scooters, bicycles, or pedestrians. RobustTP is an approach that first computes trajectories using a combination of a non-linear motion model and a deep learning-based instance segmentation algorithm. Next,these noisy trajectories are trained using an LSTM-CNN neural network architecture that models the interactions between road-agents in dense and heterogeneous traffic. We also release a software framework, TrackNPred. The framework consists of implementations of state-of-the-art tracking and trajectory predictionmethods and tools to benchmark and evaluate them on real-world dense traffic datasets

TrackNPred currently supports the following:

  1. Tracking by Detection:

  1. Trajectory Prediction

If you want to use TraPHic ONLY, then use this repository as it's easier.

Dependencies

Support Python 3.5 and above. For a list of dependencies see requirements.txt

Installing Dependencies:

  1. Create a conda environement
    conda create --name <env name e.g. tnp>
  2. Source into the environment
    source activate <env name>
  3. Install the set of requirements
    cd /path/to/requirements_file
    conda install --file requirements.txt

Note that a lot of the requirements will not be installed by default. These need to installed manually as described later.

Dataset

  • Currently we only accept .mp4 file.
  • The mp4 file must consist of a string and a number after that string.
  • We need to create a folder that has the same name as the video file and put the video in that folder.
  • The datafolder needs to exist in the Direcotry specified in the GUI/commandline.
    Example: if the data directory is resources/data/TRAF, and the video name is TRAFx.mp4, then the location of the video should be resources/data/TRAF/TRAFx/TRAFx.mp4.
  • Note that currently, all the data has to reside inside resources/data.
  • All of the files generated will be in the corresponding datafolder.

Usage

  1. Inside the conda environment, run python setup.py to get resources folder containing dataset and model weights.
  2. . Try to run python main.py. It will run into an error stating that a dependency was not found.
  3. Manually install the dependency with conda install DEPENDENCY (occasionally with conda install -c CHANNEL DEPENDENCY, where the channel name can be found by searching for the dependency file in the Anaconda cloud).
  4. Repeat Steps 2-3 till all dependency issues are resolved and the GUI opens.
  5. We provide the options of GUI and command line control:
    Examples:
    • Run python main.py to get the GUI, which will give you the options you can choose.
    • Run python main_cmd.py -l 11 -l 12 to run dataset TRAF11 and TRAF12 in command line.
    • Run python main_cmd.py -l 11 --detection False --tracking False --train True --eval True to only run prediction training and evaluating on dataset TRAF11 in command line.
      • -l is required. It takes in a series of numbers and specifies which dataset you want to run.
      • Other flags are not required, but you can play around the options that was provided in the GUI. Please see how they are defined in the main_cmd.py file.

Results

Our trajectory prediction algorithm outperforms state-of-the-art methods for end-to-end trajectory prediction using sensor inputs. We achieve an improvementof upto 18% in average displacement error and an improvement of up to 35.5% in final displacement error at the end of the prediction window (5 seconds) over the next best method. All experiments were set up on an Nvidia TiTan Xp GPU.

We evaluate RobustTP with methods that use manually annotated trajectory histories, on the TRAF Dataset. The results are reported in the following format: ADE/FDE, where ADE is the average displacement RMSE over the 5 seconds of prediction and FDE is the final displacement RMSE at the end of 5 seconds. We observe that RobustTP is at par with the stat-of-the-art:

RNN-ED S-GAN CS-LSTM TraPHic RobustTP
3.24/5.16 2.76/4.79 1.15/3.35 0.78/2.44 1.75/3.42

We also evaluate RobustTP using trajectory histories that are computed by two detection methods: Mask R-CNN and YOLO:

Using Mask R-CNN Using YOLO

TrackNPred is developed and maintained by-

  1. Tianrui Guan.
  2. Christian Roncal.

tracknpred's People

Contributors

christian-rncl avatar rayguan97 avatar rohanchandra30 avatar uttaranb127 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

tracknpred's Issues

Social Lstm model

Couldn't train Social-LSTM model from the command line as code is not available. Could you please provide code to train Social-LSTM

Questions about the paper code

Hello, congratulations on your excellent results. I'm very interested in your research, but TraPHic: Trajectory Prediction in Dense and Heterogeneous Traffic Using Weighted Interactions. The website of this paper is invalid, could you please provide it again? Thank you very much

I am facing an error related to libgtk2.0-dev and pkg-config

Hi,

I get the below error when i try to execute train script from the framework.

[ERROR] OpenCV(4.1.1) /io/opencv/modules/highgui/src/window.cpp:693: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'
[ERROR] Traceback (most recent call last):
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/control/trainThread.py", line 126, in run
[ERROR] self.track(self.args)
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/control/trainThread.py", line 94, in track
[ERROR] self.model.tracking(dataDir, data_folder, thread=self)
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/model/model.py", line 129, in tracking
[ERROR] densepeds(dataDir, data_folder, display, thread)
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/model/Tracking/DensePeds.py", line 307, in densepeds
[ERROR] run(sequence_dir, detection_file, output_file, matlab_file, min_conf, nms, min_det_ht, max_cos_dist, nn_budget, disp, thread)
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/model/Tracking/DensePeds.py", line 228, in run
[ERROR] visualizer.run(frame_callback, thread)
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/model/Tracking/application_util/visualization.py", line 152, in run
[ERROR] self.viewer.run(lambda: self._update_fun(frame_callback, thread))
[ERROR] File "/home/deepaknayak/Documents/openproject-status/TrackNPred/model/Tracking/application_util/image_viewer.py", line 506, in run
[ERROR] key = cv2.waitKey(remaining_time)
[ERROR] cv2.error: OpenCV(4.1.1) /io/opencv/modules/highgui/src/window.cpp:693: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'

Kindly help..

Results for Traphic

I trained the Traphic model but the results are not printed, how to see the results
Screenshot 2022-05-16 at 4 45 13 PM
?

Environment of

Hello,
I tried to run the code on Nvidia Jetson but I had issues with installing the libraries from the requirements file that built for intel processors like openMP and MKL.
So i want to know what are the hardware requirements or restrictions for the framework? and is those libraries are necessary for running the code or I can exclude them ?
thanks

Segmentation fault (core dumped)

is there any problem of it.
when i want to create environment from tracknpred.yml, i cross some error. so i create another one named as tracknp. then i install the need dependency by manually. so the problem coming! can you tell me how i can figure it .
or can you give another .yml in the linux ubuntu-16. thank you very much.

Screenshot from 2021-08-19 19-40-51

Trajectory prediction results

First of all, congrats for the strong work here. However, as far as I inspected the code, the prediction module offers only an evaluation function, which doesn't offer much information. Is there an easy way to modify the code in order to see for each frame the center of the predicted objects, for example, in order to compare it with the actual center of the object? Also, the prediction is done for 3 seconds in the future? I want to make some experiments regarding trajectory prediction and it would be nice if I could use your project, but I need to vary the prediction time and also to see for each frame the predicted objects/ the predicted center for the objects, in order to compute the difference between the predicted center and the ground truth. I am interested specifically in car prediction. I see that you use Mean Suared Error and that the magic happens in maskedMSETest, however I don't really know what is the link between frames, object coordinates and the tensors x, y, muX, muY. Any help in order to detect the predicted objects and to change the prediction time will be greatly appreciated.

L.E.: How is the MSE computed? It takes only the detected objects and their centers?

Missing the deep_sort_app

Hi:
thank you for your code, now when I check this script 'generate_videos.py', I didn't found the 'deep_sort_app'. so can you tell me where can I download it?
thank you very much

Question regardin DeepSort implementation

Hi, I have one question regarding the features for the deep association metric on DeepSort. I've noticed you used the CNN to get the features used in DeepSort wich was trained in the MARS dataset. This dataset is meant for person re-identification. Then my question is: How do you deal with object of different classes? I mean, do you use the same network (trained for person re-identification) to generate the deep feature descriptor of objects such as cars?

Thanks in advance!

2D Image Space to 3D World Coordinate Space

Hi,

I need to see how you've implemented the 2D image space to the 3D world coordinate space conversion in TraPHic. Where exactly (which file, which lines) is this happening?

Thank you!

Error while running main_cmd.py

I have the resources folder downloaded using 'python3 setup.py'. Now when i run the command 'python3 main_cmd.py --list 13 --detection False --tracking False --train True --eval True' i have an error
"DeprecationWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead.
DeprecationWarning)
usage: main_cmd.py [-h] [--dataset_name DATASET_NAME] [--delim DELIM]
[--loader_num_workers LOADER_NUM_WORKERS]
[--obs_len OBS_LEN] [--pred_len PRED_LEN] [--skip SKIP]
[--batch_size BATCH_SIZE] [--num_iterations NUM_ITERATIONS]
[--num_epochs NUM_EPOCHS] [--embedding_dim EMBEDDING_DIM]
[--num_layers NUM_LAYERS] [--dropout DROPOUT]
[--batch_norm BATCH_NORM] [--mlp_dim MLP_DIM]
[--encoder_h_dim_g ENCODER_H_DIM_G]
[--decoder_h_dim_g DECODER_H_DIM_G] [--noise_dim NOISE_DIM]
[--noise_type NOISE_TYPE] [--noise_mix_type NOISE_MIX_TYPE]
[--clipping_threshold_g CLIPPING_THRESHOLD_G]
[--g_learning_rate G_LEARNING_RATE] [--g_steps G_STEPS]
[--pooling_type POOLING_TYPE]
[--pool_every_timestep POOL_EVERY_TIMESTEP]
[--bottleneck_dim BOTTLENECK_DIM]
[--neighborhood_size NEIGHBORHOOD_SIZE]
[--grid_size GRID_SIZE] [--d_type D_TYPE]
[--encoder_h_dim_d ENCODER_H_DIM_D]
[--d_learning_rate D_LEARNING_RATE] [--d_steps D_STEPS]
[--clipping_threshold_d CLIPPING_THRESHOLD_D]
[--l2_loss_weight L2_LOSS_WEIGHT] [--best_k BEST_K]
[--output_dir OUTPUT_DIR] [--print_every PRINT_EVERY]
[--checkpoint_every CHECKPOINT_EVERY]
[--checkpoint_name CHECKPOINT_NAME]
[--checkpoint_start_from CHECKPOINT_START_FROM]
[--restore_from_checkpoint RESTORE_FROM_CHECKPOINT]
[--num_samples_check NUM_SAMPLES_CHECK] [--use_gpu USE_GPU]
[--timing TIMING] [--gpu_num GPU_NUM]
[--model_path MODEL_PATH] [--num_samples NUM_SAMPLES]
[--dset_type DSET_TYPE]
main_cmd.py: error: unrecognized arguments: --list 13 --detection False --tracking False --train True --eval True".
How to get rid of this error?

rescource download

Can you provide a new download link for the resource folder? thank you very much.

Issue in tracking

I ran detection and tracking from scratch for TRAF13 dataset. Detection is done successfully but for tracking i am facing with the following error. Can you please guide how to get rid of this

finished detection for resources/data/TRAFF/TRAF13...
begin tracking for resources/data/TRAFF/TRAF13...
TRAF13
Processing TRAF13
2019-08-30 13:28:03.614975: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
DATASET densepeds: resources/data/TRAFF
Traceback (most recent call last):
File "main_cmd.py", line 109, in
model.tracking(args.dir, DATA_FOLDER.format(i), False)
File "/hdd/local/sda/rabia/TrackNPred/model/model.py", line 130, in tracking
densepeds(dataDir, data_folder, display, thread)
File "/hdd/local/sda/rabia/TrackNPred/model/Tracking/DensePeds.py", line 304, in densepeds
run(sequence_dir, detection_file, output_file, matlab_file, min_conf, nms, min_det_ht, max_cos_dist, nn_budget, disp, thread)
File "/hdd/local/sda/rabia/TrackNPred/model/Tracking/DensePeds.py", line 227, in run
visualizer.run(frame_callback, thread)
TypeError: run() takes 2 positional arguments but 3 were given
(trackNpred) rabia@vivace-server:~/TrackNPred$

Cannot find the previous responstory: "Forecasting Trajectory and Behavior of Road-Agents Using Spectral Clustering in Graph-LSTMs"

Hello rohanchandra,
Thanks for your great works on forecasting trajectory. Recently my team's project is related to your previous responstory named "Forecasting Trajectory and Behavior of Road-Agents Using Spectral Clustering in Graph-LSTMs", but it seems that the previous respontory disappears on Github. Does this mean the previous responstory is no longer open source? Looking forward to your kind reply!

Core dump error during training

The network successfully trains for few epochs (8-9) and then it throws an error Floating point exception (core dumped)
Can anyone help what could be the possible reason and how to fix it?

plot trajectories for moving camera videos?

Hi, I've read your paper. You plotted the future trajectories of the agents in the scene with a moving camera. Did you consider ego-motion while plotting the trajectories? Can you please share the code, if available?

How to do inference on sample video?

Kindly suggest how to do inference on sample video?
I pressed evaluate button, but GUI window closed after few seconds with message below:

/home/user/.local/lib/python3.5/site-packages/torch/nn/modules/rnn.py:54: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.5 and num_layers=1
"num_layers={}".format(dropout, num_layers))
[INFO: engine.py: 340]: Engine run starting with max_epochs=1.

Process finished with exit code 136 (interrupted by signal 8: SIGFPE)

KINDLY HELP

resources download problem

Downloading file from google drive...
tar: Error opening archive: Unrecognized archive format
'rm' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

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.