Coder Social home page Coder Social logo

madeyerui / iccgan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xupei0610/iccgan

0.0 0.0 0.0 452.76 MB

[SCA2021] A GAN-Like Approach for Physics-Based Imitation Learning and Interactive Character Control

License: MIT License

Shell 0.03% JavaScript 1.38% C++ 62.67% Python 10.67% C 21.48% Objective-C 0.09% Lua 0.47% C# 2.30% MATLAB 0.01% CSS 0.01% TeX 0.03% Makefile 0.01% HTML 0.26% CMake 0.46% GLSL 0.04% Batchfile 0.04% Jupyter Notebook 0.07%

iccgan's Introduction

Interactive Character Control Generative Adversarial Network

Deprecated. Please visit https://github.com/xupei0610/CompositeMotion for our new implementation using IsaacGym.

This code repo is to support the paper A GAN-Like Approach for Physics-Based Imitation Learning and Interactive Character Control. [arXiv] [Youtube]

This paper has been accepted by Proceedings of the 20th ACM SIGGRAPH/Eurographics Symposium on Computer Animation (SCA 2021), and published at Proceedings of the ACM on Computer Graphics and Interactive Techniques, Volume 4, Issue 3 with cover image.

Abstract --We present a simple and intuitive approach for interactive control of physically simulated characters. Our work builds upon generative adversarial networks (GAN) and reinforcement learning, and introduces an imitation learning framework where an ensemble of classifiers and an imitation policy are trained in tandem given pre-processed reference clips. The classifiers are trained to discriminate the reference motion from the motion generated by the imitation policy, while the policy is rewarded for fooling the discriminators. Using our GAN-like approach, multiple motor control policies can be trained separately to imitate different behaviors. In runtime, our system can respond to external control signal provided by the user and interactively switch between different policies. Compared to existing method, our proposed approach has the following attractive properties: 1) achieves state-of-the-art imitation performance without manually designing and fine tuning a reward function; 2) directly controls the character without having to track any target reference pose explicitly or implicitly through a phase state; and 3) supports interactive policy switching without requiring any motion generation or motion matching mechanism. We highlight the applicability of our approach in a range of imitation and interactive control tasks, while also demonstrating its ability to withstand external perturbations as well as to recover balance. Overall, our approach has low runtime cost and can be easily integrated into interactive applications and games.

Dependencies

  • Pytorch 1.8
  • Numba 0.52
  • PyBullet 3.0.8

We recommend to install all the requirements through Conda by

$ conda create --name <env> --file requirements.txt -c pytorch -c conda-forge

and using our modified PyBullet by

$ pip install -e ./bullet3

We modify the Stable PD Controller implementation of Bullet3 regarding force clamp for spherical joints (Line 7310-7347 of examples/SharedMemory/PhysicsServerCommandProcessor.cpp).

Code Usage

To train a policy distributedly by running 8 workers:

$ python iccgan.py <motion> --rank 0 --world_size 8
$ python iccgan.py <motion> --rank 1 --world_size 8
$ python iccgan.py <motion> --rank 2 --world_size 8
$ python iccgan.py <motion> --rank 3 --world_size 8
$ python iccgan.py <motion> --rank 4 --world_size 8
$ python iccgan.py <motion> --rank 5 --world_size 8
$ python iccgan.py <motion> --rank 6 --world_size 8
$ python iccgan.py <motion> --rank 7 --world_size 8

To visualize a trained policy by running:

$ python iccgan.py <motion>

See envs/data/motions for supported motions in the name of <motion>.json.

To visualize pre-trained policies by

$ python iccgan.py <motion> --ckpt policies/<motion>

Citation

@article{iccgan,
    author = {Xu, Pei and Karamouzas, Ioannis},
    title = {A GAN-Like Approach for Physics-Based Imitation Learning and Interactive Character Control},
    year = {2021},
    publisher = {Association for Computing Machinery},
    volume = {4},
    number = {3},
    doi = {10.1145/3480148},
    journal = {Proceedings of the ACM on Computer Graphics and Interactive Techniques},
    articleno = {44},
    numpages = {22},
    keywords = {physics-based control, character animation, reinforcement learning, GAN}
}

iccgan's People

Contributors

xupei0610 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.