Code Monkey home page Code Monkey logo

ykotseruba / pedestrianactionbenchmark Goto Github PK

View Code? Open in Web Editor NEW
49.0 1.0 16.0 25.59 MB

Code and models for the WACV 2021 paper "Benchmark for evaluating pedestrian action prediction"

Home Page: https://openaccess.thecvf.com/content/WACV2021/papers/Kotseruba_Benchmark_for_Evaluating_Pedestrian_Action_Prediction_WACV_2021_paper.pdf

License: MIT License

Python 97.67% Shell 2.33%
action-prediction deep-learning benchmark jaad pie attention wacv2021

pedestrianactionbenchmark's Introduction

Pedestrian Crossing Action Prediction Benchmark

Benchmark for evaluating pedestrian action prediction algorithms that inlcude code for training, testing and evaluating baseline and state-of-the-art models for pedestrian action prediction on PIE and JAAD datasets.

Paper: I. Kotseruba, A. Rasouli, J.K. Tsotsos, Benchmark for evaluating pedestrian action prediction. WACV, 2021 (see citation information below).

Installation instructions

  1. Download and extract PIE and JAAD datasets.

    Follow the instructions provided in https://github.com/aras62/PIE and https://github.com/ykotseruba/JAAD.

  2. Download Python data interface.

    Copy pie_data.py and jaad_data.py from the corresponding repositories into PedestrianActionBenchmark directory.

  3. Install docker (see instructions for Ubuntu 16.04 and Ubuntu 20.04).

  4. Change permissions for scripts in docker folder:

    chmod +x docker/*.sh
    
  5. Build docker image

    docker/build_docker.sh
    

    Optionally, you may set custom image name and/or tag using this command (e.g. to use two GPUs in parallel):

    docker/build_docker.sh -im <image_name> -t <tag>
    

Running instructions using Docker

Run container in interactive mode:

Set paths for PIE and JAAD datasets in docker/run_docker.sh (see comments in the script).

Then run:

docker/run_docker.sh

Train and test models

Use train_test.py script with config_file:

python train_test.py -c <config_file>

For example, to train PCPA model run:

python train_test.py -c config_files/PCPA.yaml

The script will automatially save the trained model weights, configuration file and evaluation results in models/<dataset>/<model_name>/<current_date>/ folder.

See comments in the configs_default.yaml and action_predict.py for parameter descriptions.

Model-specific YAML files contain experiment options exp_opts that overwrite options in configs_default.yaml.

Test saved model

To re-run test on the saved model use:

python test_model.py <saved_files_path>

For example:

python test_model.py models/jaad/PCPA/01Oct2020-07h21m33s/

Authors

Please email [email protected] or [email protected] if you have any issues with running the code or using the data.

License

This project is licensed under the MIT License - see the LICENSE file for details

Citation

If you use the results, analysis or code for the models presented in the paper, please cite:

@inproceedings{kotseruba2021benchmark,
	title={{Benchmark for Evaluating Pedestrian Action Prediction}},
	author={Kotseruba, Iuliia and Rasouli, Amir and Tsotsos, John K},
	booktitle={Proceedings of the IEEE Winter Conference on Applications of Computer Vision (WACV)},
	pages={1258--1268},
	year={2021}
}

If you use model implementations provided in the benchmark, please cite the corresponding papers

  • ATGC [1]
  • C3D [2]
  • ConvLSTM [3]
  • HierarchicalRNN [4]
  • I3D [5]
  • MultiRNN [6]
  • PCPA [7]
  • SFRNN [8]
  • SingleRNN [9]
  • StackedRNN [10]
  • Two_Stream [11]

[1] Amir Rasouli, Iuliia Kotseruba, and John K Tsotsos. Are they going to cross? A benchmark dataset and baseline for pedestrian crosswalk behavior. ICCVW, 2017.

[2] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani,and Manohar Paluri. Learning spatiotemporal features with 3D convolutional networks. ICCV, 2015.

[3] Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung,Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. NeurIPS, 2015.

[4] Yong Du, Wei Wang, and Liang Wang. Hierarchical recurrent neural network for skeleton based action recognition. CVPR, 2015

[5] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? A new model and the kinetics dataset. CVPR, 2017.

[6] Apratim Bhattacharyya, Mario Fritz, and Bernt Schiele. Long-term on-board prediction of people in traffic scenes under uncertainty. CVPR, 2018.

[7] Iuliia Kotseruba, Amir Rasouli, and John K Tsotsos, Benchmark for evaluating pedestrian action prediction. WACV, 2021.

[8] Amir Rasouli, Iuliia Kotseruba, and John K Tsotsos. Pedestrian Action Anticipation using Contextual Feature Fusion in Stacked RNNs. BMVC, 2019

[9] Iuliia Kotseruba, Amir Rasouli, and John K Tsotsos. Do They Want to Cross? Understanding Pedestrian Intention for Behavior Prediction. In IEEE Intelligent Vehicles Symposium (IV), 2020.

[10] Joe Yue-Hei Ng, Matthew Hausknecht, Sudheendra Vi-jayanarasimhan, Oriol Vinyals, Rajat Monga, and GeorgeToderici. Beyond short snippets: Deep networks for video classification. CVPR, 2015.

[11] Karen Simonyan and Andrew Zisserman. Two-stream convolutional networks for action recognition in videos. NeurIPS, 2014.

pedestrianactionbenchmark's People

Contributors

ykotseruba 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

Watchers

 avatar

pedestrianactionbenchmark's Issues

environment requirement (tensorflow+cuda+cudnn)

Hi! Yulia,

I met the problem in the environment configuration. Could you tell me the exact version of CUDA and Cudnn you use in your PCPA model's training process? I used TF2.1+CUDAtoolkit10.1+Cudnn7.6.5 but meet the unknown problem of initialization of Cudnn. Btw, I used Anaconda rather than Docker. Is there anything I need to take care of?

Thanks,
Haolin

code of PedFormer

Hello, Iuliia
I am a newly enrolled graduate student from China, and I am very interested in your research direction. You have done quite excellent work. Recently, I have been reading your paper "PedFormer: Pedestrian Behavior Prediction via Cross-Modal Attention Modulation and Gated Multitask Learning." I am very eager to implement this work, but unfortunately, I was not successful. Could you please provide the source code for me? Thank you very much!
changsheng luo

Questions about the benchmark

Hi,
Your work is excellent and impressive. Establishing a benchmark for pedestrian action prediction is urgent because many papers use different methods of evaluation. But I have some questions about the benchmark mentioned in paper.

First, a pedestrian had the intention to cross but he(she) did not cross at last for some reason. Such samples are set to “Not-crossing”. But at that moment, this pedestrian really wanted to cross the road. Could you explain these samples?

Second, besides pedestrian action prediction, is pedestrian action detection also important? If a pedestrian is crossing the road, prediction is no meaning but action detection or recognition is necessary. So is necessary to add action detection or recognition in the benchmark?

Thanks!

Results without DataGenerator

Hello,

I have a question regarding the usage of the DataGenerator in the PCPA Modell.

When I use the DataGenerator I get very good results, but a high loss (0,13). When DataGenerator = False the results are very bad, but the loss is very low (0,003).

DataGenerator = True:
image

DataGenerator = False
image

Shouldn't the results be almost identical? What could be the reason for this?

Many greetings
Moritz

Request: pre-trained models

Hello,

Would it be possible to put a zip file with all the pretrained models evaluated on the paper?
Thank you very much :)

some errors about docker

hi!I meet a puzzle problem when I run docker/build_docker.sh. Could you give me some help? thanks!
1638593578552

About pose data

Hi,

Thank you very much for your very intersting and excellent work!

I am wondering could you please provide some explanations about the pose data you provided, for example the data in the features/jaad/poses folder?

In the paper you mentioned you extract pose data using OpenPose, are the pose data (18 joints) included there? In addition, what is the meaning of 'pose_set01'?

Many thanks! Looking forward to your reply!

Bests,
Xingchen

Troubles with testing the PCPA and SFRNN model

Hi,

Thank you very much for your nice work!

I tried to train and test the PCPA and SFRNN model with the provided config_files.

When I try to test the models, I get the following error:

image

can you help me with this?

about i3d

Hi @PaulAdamastor,
Thank you for your interest in our work.

I'm not getting this error when I run the code of both models. Are you using the latest annotations and data loading functions (pie_data.py and jaad_data.py)?

To use I3D with the optical flow you can modify the C3D config as follows: change the model to I3D and obs_input_type to [local_context_flow]. Any type with visual features should work if you append _flow to it.
However, the code expects the optical flow to be precomputed. We used FlowNet2.

Originally posted by @ykotseruba in #12 (comment)

About the performance of PCPA

Hi!

I used local context, speed, box, and pose in PCPA and trained the PCPA model with epoch = 80, LR = 5e-7. But I cannot get ACC = 0.85 in JAAD test dataset as described in the paper (I only got acc = 0. 79). Is there any detail I missed in the training process?

Thanks,
Haolin

Asking about C3D and PCPA

Hi,

I am looking into your model and benchmark. Since you might be experienced in this topic, I'd like to ask about some details in C3D and PCPA model. From the aspect of coding, there are two operations: 1. directly using C3D model by calling C3D class; 2.keeping C3D model in PCPA class with removing other features: speed, box, pose as well as the attention modules. Will these two operations get same results? In my view, they both use only C3D model for prediction. Otherwise, do they have differences in detail?

I am interested in these models and want to do some exploration based on your repo. Could you answer it for me?

Thanks,
Haolin

Results Visualization

Hello,Excuse me,
As shown in your paper, how do you extract a sample of pedestrians crossing or not crossing the street from the dataset and compare it with the results obtained from the model test? The test program is for the entire dataset, how to extract the test results for a certain pedestrian?

Having Troubles Training TwoStream ATGC

Hello,

thank you for the nice code and benchmark!
I've tried running a few training but I have issues with some models:

ATGC and TwoStream both give me the error:
"'walking': data_raw['actions'].copy(),
KeyError: 'actions'"

Could you help me with that?

And I didn't really understand how to use optical flow with I3D, could you provide me a config file?

Best regards,

About the performance of PCPA

Hi,
After I retrained PCPA with the settings in the paper, the performance was not as good as the data in the paper. While you were answering your other question, I noticed that the performance on JAAD would drop due to some issues, but it was still higher than my results. I use the windows system to train and do not use docker. I want to know if this is the main reason and whether using docker will affect the experimental results.
Thanks for your answer.

Update configs in PCPA.yaml

The configs in PCPA.yaml such as learning rate, epochs are different from that in the paper, especially for JAAD_behave, JADD_all datasets. Could you please update the configs for reproducing the results easily ?

Testing issue with PCPA model

@ykotseruba I am geeting error when I am trying to test PCPA model. I did setup environment according to your docker file.
Please let me know if you have solution for this.
Thanks!

ValueError: Data is expected to be in format x, (x,), (x, y), or (x, y, sample_weight), found: (array([[[[[18.83785077, 19.85873724, 23.39030612],
[18.83785077, 19.85873724, 23.39030612],
[18.83785077, 19.85873724, 23.39030612],
...,
[18.83785077, 19.85873724, 23.39030612],
[18.83785077, 19.85873724, 23.39030612],
[18.83785077, 19.85873724, 23.39030612]],

     [[18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      ...,
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612]],

     [[18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      ...,
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612]],

     ...,

     [[18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      ...,
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612]],

     [[18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      ...,
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612]],

     [[18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      ...,
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612],
      [18.83785077, 19.85873724, 23.39030612]]],


    [[[20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      ...,
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778]],

     [[20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      ...,
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778]],

     [[20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      ...,
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778]],

     ...,

     [[20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      ...,
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778],
      [20.46348852, 21.41812819, 25.08585778]],

About the performance of PCPA on JAAD-beh

Dear authors,

I am wondering if that is possible for you to provide your pretrained model of PCPA on the JAAD-beh dataset?

I have trained this model using the same parameters, however the results I obtained are much worse than what you reported in your paper. I got acc = 0.5, auc = 0.47, f1 = 0.59, precision = 0.6, recall = 0.58.

I wish to produce some qualitative comparison with PCPA, but it might be unfair (for example maybe I missed something so I do not obtain good performance) to use the PCPA results produced by myself.

Many thanks for your help!
Xingchen

About PIE dataset split

Hi,

In your paper, I find this sentence:

"In the PIE dataset, we follow the data split defined in [42]: videos from set01, set02 and set06 are used for training, set04 and set05 for validation and set03 for testing. The number of pedestrian tracks in PIE is 880, 243 and 719 in train, validation and test sets."

After running codes, the PIE dataset split is different from the paper. Videos from set01, set02 and set04 are used for training, set05 and set06 for validation and set03 for testing. But the number of pedestrian is consistent. Finally, I find these codes in pie_data.py.

    def _get_image_set_ids(self, image_set):
        """
        Returns default image set ids
        :param image_set: Image set split
        :return: Set ids of the image set
        """
        image_set_nums = {'train': ['set01', 'set02', 'set04'],
                          'val': ['set05', 'set06'],
                          'test': ['set03'],
                          'all': ['set01', 'set02', 'set03',
                                  'set04', 'set05', 'set06']}
        return image_set_nums[image_set]

Do I understand correctly? Could you tell me which PIE dataset split is correct?

Thanks a lot!

Imbalance of C/NC samples

Hi,
I split PIE and JAAD dataset as your paper and codes. But I find imbalance of C/NC samples.
In PIE dataset, the numbers of different samples are as follows:

NC C
Train 3576 1194
Test 2742 1074

In JAAD_beh dataset, , the numbers of different samples are as follows:

NC C
Train 374 1760
Test 704 1177

In PIE dataset, the number of NC samples is far more than the number of C samples. In JAAD dataset, the number of C samples is more than the number of NC samples. I think it is harmful to train a model. Is the split result correct? Could you please explain this distribution?

The meaning of overlap

Hi,

Thank you very much for your nice work!

Could you please tell what is the meaning of the 'overlap' in your paper and your code?

For example, in your paper you said 'The sample overlap is set to 0.6 for PIE and 0.8 for JAAD'. This is also set in the yaml file.

Many thanks again!
Bests,
Xingchen

Pedestrians who are already crossing in the past observations

Hi,
I have noticed that, in some examples, in the 16 past frames, the pedestrian is in the middle of the street and is already crossing.
Is it correct to have this type of behavior in the examples? I thought that the crossing behavior will happen only in the future frames.
For now, I've seen it in JAAD split. I share some frames.
Maybe I am doing something wrong but I am checking it right before the function train_model.fit() and I didn't modify the rest of the code.
Thank you very much for your time.

crossing_jaad_first
crossing_jaad_second

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.