davrempe / predicting-physical-dynamics

Code for "Predicting the Physical Dynamics of Unseen 3D Objects" presented at WACV 2020.
MIT License
19 stars 4 forks source link

Predicting the Physical Dynamics of Unseen 3D Objects

WACV 2020

Davis Rempe, Srinath Sridhar, He Wang, Leonidas J. Guibas

Teaser

This repository contains the code and dataset used in the paper "Predicting the Physical Dynamics of Unseen 3D Objects" presented at WACV 2020. See the project page for more details.

Setup

This code has been tested on Ubuntu 16.04 using Python 2.7 and Tensorflow 1.13.1 with CUDA 10.0. After installing CUDA, all dependencies can be installed from the root of this repo with:

pip install -r requirements.txt

Downloads

In order to run the code, you must download and place a few things in the repo:

Structure

The important parts of this repository are as follows:

Running

Below are directions to train, test, and visualize results from our method.

Training and Testing

To train our model, use a command similar to:

python scripts/train/topple_aa_train_classify.py @./data/configs/Cube5k.train.cfg

where all flags for training are passed in via the given configuration file after @. To see the possible options for training and understand the configuration file please see the data readme. The command for training our model on any datset is more or less the same, the only differences being the --data_list and --norm_info flags which are configured differently for each dataset.

To test the trained model, use the command:

python scripts/test/topple_aa_test_classify.py @./data/configs/Cube5k.test.cfg

Similar to the train command, all flags are contained in the configuration file. Different evaluations are performed based on the given flags; see the data readme for full details.

If running into issues with pickle, you may need to regenerate some preprocessing done on the data (used to normalize for training/evaluation). For example for the cube data run:

python scripts/data/calc_normalization_info.py --data_list ./data/sim/dataset_lists/Cube5k/all.txt --info_out ./data/sim/normalization_info/cube_5k.pkl

Visualization

For visualizing predicted trajectories, we use the Unity game engine. We have tested our Unity project on version 2017.3.1f1 on Windows 10, but it is a small project and should work in other versions. The visualization is meant to be run on output predictions from the test script using the --output_pred flag. To visualize results, place the required meshes mentioned earlier in viz_unity/DataIn.

After installing Unity, open the project (with base directory at viz_unity/VizPredictions) and in the editor double-click to open Scenes/TumbleVizPred. To run the visualization script:

The program will load in each predicted and ground truth trajectory, visualize them, and save the rendered frames.

Citation

If you use this code, please cite our work:

@inproceedings{RempeDynamics2020,
    author={Rempe, Davis and Sridhar, Srinath and Wang, He and Guibas, Leonidas J.},
    title={Predicting the Physical Dynamics of Unseen 3D Objects},
    journal={Proceedings of the Winter Conference on Applications of Computer Vision (WACV)},
    year={2020}
}