Code Monkey home page Code Monkey logo

skeleton-graph's Introduction

Skeleton-Graph: Long-Term 3D Motion Prediction From 2D Observations Using Deep Spatio-Temporal Graph CNNs Code instructions

Abduallah Mohamed, Huancheng Chen, Zhangyang Wang, Christian Claudel

The University of Texas at Austin

*To appear in the The ROAD Challenge: Event Detection for Situation Awareness in Autonomous Driving ICCV 2021 Workshop

Code for: "Skeleton-Graph: Long-Term 3D Motion Prediction From 2D Observations Using Deep Spatio-Temporal Graph CNNs", ICCV 2021 ROAD

Read the full paper here


Code Instructions:

Environment

Python3

We used pipreqs to generate the requirements.txt, thus we have the minimal packages needed.

Code structure

  • train.py //For training and evaluating the model

  • utils.py //For evaluation metrics

  • model.py //Our Skeleton-Graph model with all configurations

  • gtaimdset.py //GTA-IM dataset, with auto save for faster loading

  • proxdset.py //PROX dataset, with auto save for faster loading (might occupy a huge memeory)

  • The dataset folders GTAIMFPS5, PROX are included

  • To obtain the GTAIM dataset please check: https://github.com/ZheC/GTA-IM-Dataset#requesting-dataset

  • To obtain the PROX dataset please check: https://prox.is.tue.mpg.de/

    • PROX keypoints are zipped under PROX/PROX/keypoints.zip, this is important for results comparison and reproduction
    • For PROX, you will mainly need the recordings folder from their website

Running the code for training and evaluation

We mainly use a .sh files to execute multiple expriements in parallel.

The exprimenets are saved in checkpoint with unique id. Also, when the dataset is computed for the first time it takes a while. The data loader in the case of GTA-IM saves a copy for faster future loading, yet depednding on you PC mem you might want to disable this option by setting 'save=false' in the data loaders.

Training

For example to train on GTA-IM dataset with 1 second input(5 frames), 2 seconds output (5 frames) with 5/11 (5 sgcnn, 11 txcnn) layers execute this command.

CUDA_VISIBLE_DEVICES=1 python3 train.py --lr 0.01 --n_stgcnn 5 --n_txpcnn 11  --dataset GTA_IM --use_lrschd --num_epochs 450  --tag 1 
Testing

To evaluate/test simply use the same training settings and add --torso_joint 13 --eval_only, hinting to code to evaluate and select the torso joint for path evaluation. The command will be:

CUDA_VISIBLE_DEVICES=1 python3 train.py --torso_joint 13 --eval_only --lr 0.01 --n_stgcnn 5 --n_txpcnn 11  --dataset GTA_IM --use_lrschd --num_epochs 450  --tag 1 

You can explore the different .sh files in the sh folder for more examples.

Visualization

We use Open3d to visualize the prediction and target skeleton points. For running visualization.py, we need the same configuration to validation, just for generating the hash checkpoints filename. We load the trained model and get prediction and target, save them in lists.

For example:

CUDA_VISIBLE_DEVICES=1 python3 visualization.py --lr 0.01 --n_stgcnn 5 --n_txpcnn 11  --dataset GTA_IM --use_lrschd --num_epochs 450  --tag 1   --torso_joint 13 --eval_only 

in the code, we just load one of the batches, you can modify the 'batch_id' to get the batch you want. With the data of prediction and target, we can draw lines and points with Open3d and store them as npy and ply files. Match the frame you want to visualize, and load the corresponding line-set and point-set. For example: 'lineset_63.ply', 'lineset_target_63.ply', 'joints_63.npy', 'joints_target_63.npy'.

Notice: The drawing window is disabled in jupyter notebook.

Citation:

@article{DBLP:journals/corr/abs-2109-10257,
  author    = {Abduallah Mohamed and
               Huancheng Chen and
               Zhangyang Wang and
               Christian G. Claudel},
  title     = {Skeleton-Graph: Long-Term 3D Motion Prediction From 2D Observations
               Using Deep Spatio-Temporal Graph CNNs},
  journal   = {CoRR},
  volume    = {abs/2109.10257},
  year      = {2021},
  url       = {https://arxiv.org/abs/2109.10257},
  eprinttype = {arXiv},
  eprint    = {2109.10257},
  timestamp = {Mon, 27 Sep 2021 15:21:05 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2109-10257.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

skeleton-graph's People

Contributors

abduallahmohamed 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

Watchers

 avatar  avatar

skeleton-graph's Issues

Train.py issue

Hello,

when i run the train script i get this error :
File "train.py", line 93, in
loader_train = torch.utils.data.DataLoader(
File "C:\Anaconda3\envs\skeleton\lib\site-packages\torch\utils\data\dataloader.py", line 266, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore
File "C:\Anaconda3\envs\skeleton\lib\site-packages\torch\utils\data\sampler.py", line 103, in init
raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

How can I fix it please?

Thanks!

Question Architecture (images)

Hello,

Thank you for your amazing work! But I have a question. You use images in your architecture but in the code the configuration is set to False: Load_image, video_back and background_back are set set false in your code. How is this? Can you explain me please? Where is the part of the extract and use of images please? How you use your images please?

Thanks!

Reproducing issue on PROX dataset

Hi,

I encountered an issue during the experiment on the PROX dataset. Despite following the parameters provided in the paper, I couldn't reproduce the results outlined in the study. Consequently, I am reaching out to request detailed parameter settings and have attached a screenshot showcasing my best attempt on the PROX dataset.

Thank you very much!
Uploading result-1.PNG…

The predicted future motion

Hi,

I saw that you predict the future 3d human poses in the current frame's camera coordinate. My question is that the predicted future 3D motion results shown in your paper are in the world coordinate, so we need additional camera future positions to transform this coordinate system. Actually, this transformation matrix or camera position information is unavailable for your method in practice. Hence, how can your method predict these future human motion in the 3D scene?

Torso Joint

Hello,
What is the torso_joint please and whats is its value in the PROX dataset !
Thanks

Sequence prediction

Hello,

I have a question about your approach.

How many sequences did you use for the observation and then for the prediction phase for GTA dataset please?

How many frames do you use to observe and then predict for how many frames?

Best regards,

Loss function

Hello,

I don't understand well your loss function, Can you give me some details please! How you calculate the loss!

Another question: if I don't use the graph in my architecture, is it possible to use this same loss formula that you use please!

Thanks a lot!

Camera to world coordinates

Hello, I need to make a figure as your figure 1 please how can I make this please!
from what I understood it must the world coordinates but the predictions of your model are coordinated images. How can I do this conversion exactly with the matrix please!

Visualization problem

Hello,

When I run the visualization script: CUDA_VISIBLE_DEVICES=1 python3 visualization.py --lr 0.01 --n_stgcnn 5 --n_txpcnn 11 --dataset GTA_IM --use_lrschd --num_epochs 450 --tag 1 --torso_joint 13 --eval_only

I keep getting this error that I don't understand!
Capture d’écran 2022-11-28 111849

Can you help me please?

Best regards,

Prox Problem

Hello,

I tried to test on Prox dataset after downloading the recoding folder. Please can you share me the recoding folder you have been working on? Because by launching the training, I cannot launch it, it tells me that frame x does not exist in the folder!

Thanks in advance

GTAIMFPS5

Hello,

I have a question regarding the line in the train.py script : datasections = glob.glob('./GTAIMFPS5/*/').

GTAIMFPS5 must contain what exactly please? can you tell me how many files in total and contain what please? because I have the database but I did not understand what exactly I should choose to put.

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.