GithubHelp home page GithubHelp logo

cock-puncher / differentiablecloth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from williamljb/differentiablecloth

0.0 0.0 0.0 31.78 MB

Makefile 0.10% HTML 6.54% C++ 52.49% C 4.02% Python 0.29% Batchfile 0.02% MATLAB 0.01% Shell 0.03% Mathematica 36.45% Haskell 0.04%

differentiablecloth's Introduction

Differentiable Cloth Simulation for Inverse Problems

Junbang Liang, Ming C. Lin, Vladlen Koltun. NeurIPS 2019.

Project Page

Requirements

  • Python 3.6.4
  • PyTorch tested on version 1.0.1
  • CUDA 9.2.148
  • cuDNN 7.0.5
  • Pybind11
  • BLAS
  • Boost
  • freeglut
  • gfortran
  • LAPACK
  • libpng

Build

  1. Build the dependencies:
cd ${root}/arcsim/dependencies; make
  1. Setup python libraries:
cd ${root}; make

To use the simulator:

import torch
import arcsim

For APIs of the simulator, please refer to pybind/bind.cpp.

Demo

As the first step, link the simulation-related directories to the demo path:

cd demo
ln -s ../arcsim/conf .
ln -s ../arcsim/meshes .
ln -s ../arcsim/materials .

Simple Optimization of Gravity Force

The goal is to optimize the gravity force so that the center of mass of the cloth has the largest z coordinate after 1 second. Execution command:

python demo_gravity.py

Collision Stress Test

This is the ablation study mentioned in the paper. To see the backward timing, first uncomment Line 17 of pysim/collision_py.py. Execution command:

python demo_collision.py ${log_dir}

Material Parameter Optimization

The goal is to optimize the density, stretching and bending parameters of the cloth so that the cloth behaves the same as observed. Execution command:

python demo_wind.py ${log_dir} ${observed_data_dir} ${gt_material_file}

Motion Control

The goal is to find appropriate control forces (expressed as additional velocity very step) of the four corners of the cloth so that the cloth can be lifted and dropped down to the given basket, while avoiding the obstacles on the way. Execution command:

python demo_throw.py ${log_dir}

There is another approach of this task which is to use a simple neural network to decide the forces:

python demo_embed.py ${log_dir}

Citation

If you use this code for your research, please consider citing:

@inProceedings{liang2019differentiable,
  title={Differentiable Cloth Simulation for Inverse Problems},
  author = {Junbang Liang and Ming C. Lin and Vladlen Koltun},
  booktitle={Conference on Neural Information Processing Systems (NeurIPS)},
  year={2019}
}

differentiablecloth's People

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.