Git Product home page Git Product logo

v-cdn's Introduction

Causal Discovery in Physical Systems from Videos

Yunzhu Li, Antonio Torralba, Animashree Anandkumar, Dieter Fox, and Animesh Garg

NeurIPS 2020 [website] [arXiv] [video]

Demo

Unsupervised Keypoint Detection

  • From left to right:
  • (1) Input image
  • (2) Overlay of the detected keypoints and the input image
  • (3) The corresponding heatmap of the keypoints
  • (4) The reconstructed image
  1. Multi-Body Interaction

  1. Fabric Manipulation

Discover The Causal Summary Graph and Dynamics Prediction

  1. Multi-Body Interaction
  • From left to right:
  • (1) Ground truth graph
  • (2) Predicted Graph
  • (3) Overlay of the predicted keypoint movements and the true future

  1. Fabric Manipulation
  • From left to right:
  • (1) Predicted Graph
  • (2) Overlay of the predicted keypoint movements and the true future
  • (3) Ground truth keypoint movements

Installation

This codebase is tested with Ubuntu 18.04 LTS, Python 3.7.4, PyTorch 1.6.0, and CUDA 11.0.

Generate Demo Using Pre-trained Models

We provide pretrained models in the two environments to generate the demos. The checkpoints for unsupervised keypoint detection are stored in the dump_{env}/train_{env}_kp_*/net_kp_epoch_*_iter_*.pth, checkpoints for causal discovery and dynamics prediction are stored in dump_{env}/train_{env}_dy_*/net_dy_epoch_*_iter_*.pth.

We provide the following scripts to perform unsupervised keypoint detection with the pretrained model. The results will be stored in dump_{env}/eval_{env}_kp_demo_*/.

bash scripts/demo_Ball_kp.sh
bash scripts/demo_Cloth_kp.sh

The following scripts perform unsupervised keypoint detection, then discover the causal summary graph and predict the future. The results will be stored in dump_{env}/eval_{env}_dy_demo_*/.

bash scripts/demo_Ball_dy.sh
bash scripts/demo_Cloth_dy.sh

Evaluation Using Pre-trained Models

You will need to download the data from the followings links.

The organization of the codebase should follow the following structure, where data_{enc}/ contains the raw images and metadata for each episode, data_{env}_nKp_*/ contains pre-stored keypoints detected by the pretrained perception module.

- v-cdn/
    - data/
        - data_Ball/
            - demo/
            - train/
            - valid/
            - stat.h5
        - data_Ball_nKp_5/
            - train/
            - valid/
        - data_Cloth/
        - data_Cloth_nKp_10/
    - dump_Ball/
    - dump_Cloth/
    - config.py
    - data.py
    ...

The following scripts generate and store the keypoints to data/data_{env}_nKp_*/ using the pretrained unsupervised keypoint detection model. It will speed up the training process of the discovery and the dynamics modules. You can switch the option --eval_set from valid to train, and --store_ed_idx to an appropriate number to generate files for different data partitions.

bash scripts/eval_Ball_kp.sh
bash scripts/eval_Cloth_kp.sh

The following scripts evaluate the pretrained discovery and dynamics modules.

bash scripts/eval_Ball_dy.sh
bash scripts/eval_Cloth_dy.sh

Training the Perception, the Discovery, and the Dynamics Modules

You will have to first download and organize the data following the instructions in the previous section.

The following scripts train the perception module for unsupervised keypoint detection. In the Ball environment, you can switch the option --gen_data from 0 to 1 to generate new data.

bash scripts/train_Ball_kp.sh
bash scripts/train_Cloth_kp.sh

The following scripts train the discovery and the dynamics modules together. It will speed up the training process if you load from pre-stored keypoints. data_{env}_nKp_*/ in the downloaded data contains pre-stored keypoints detected using our pretrained perception module. You can also regenerate the keypoints following the instructions in the previous section.

When training the discovery and the dynamics modules using the following scripts, set the option --preload_kp as 1 to allow the script to load the stored keypoints.

bash scripts/train_Ball_dy.sh
bash scripts/train_Cloth_dy.sh

Citing Our Paper

If you find this codebase useful in your research, please consider citing:

@article{li2020causal,
    title={Causal discovery in physical systems from videos},
    author={Li, Yunzhu and Torralba, Antonio and Anandkumar, Anima and Fox, Dieter and Garg, Animesh},
    journal={Advances in Neural Information Processing Systems},
    volume={33},
    year={2020}
}

For any questions, please contact Yunzhu Li ([email protected]).

Related Work

[1] Unsupervised Learning of Object Keypoints for Perception and Control [paper]

[2] Neural Relational Inference for Interacting Systems [paper]

v-cdn's People

Contributors

yunzhuli avatar jqz-brown avatar

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.