Coder Social home page Coder Social logo

jianwen-xie / dynamic_generator Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 6.0 113.41 MB

Learning Dynamic Generator Model by Alternating Back-Propagation Through Time

Home Page: http://www.stat.ucla.edu/~jxie/DynamicGenerator/DynamicGenerator.html

License: MIT License

Python 100.00%

dynamic_generator's Introduction

Learning Dynamic Generator Model by Alternating Back-Propagation Through Time

This repository contains a tensorflow implementation for the paper "Learning Dynamic Generator Model by Alternating Back-Propagation Through Time".

Project Page: (http://www.stat.ucla.edu/~jxie/DynamicGenerator/DynamicGenerator.html)

Reference

@article{DG,
    author = {Xie, Jianwen and Gao, Ruiqi and Zheng, Zilong and Zhu, Song-Chun and Wu, Ying Nian},
    title = {Learning Dynamic Generator Model by Alternating Back-Propagation Through Time},
    journal={The Thirty-Third AAAI Conference on Artificial Intelligence (AAAI)},
    year = {2019}
}

Requirements

Usage

(1) For dynamic texture synthesis

(i) Training

First, prepare your data into a folder, for example ./trainingVideo/dynamicTexture/fire

To train a model with dynamic texture fire:

$ python main_dyn_G.py --category fire --isTraining True

The training results will be saved in ./output_synthesis/fire/final_result.

The learned models will be saved in ./output_synthesis/fire/model.

(ii) Testing for dynamic texture synthesis

$ python main_dyn_G.py --category fire --isTraining False --num_sections_in_test 4 --num_batches_in_test 2 --ckpt_name model.ckpt-2960

the 'num_sections_in_test' indicates the number of trucations of the synthesized video

the 'num_batches_in_test' indicates the number of independent synthesized videos

testing results will be saved in ./output_synthesis/fire/final_result_testing.

(iii) Results

       

For each category, the first one is the observed video, and the other three are synthesized videos generated by the learned model. The observed video is of 60 frames in length, while the two synthesized videos are of 120 frames in length.

(2) For action pattern synthesis

(i) Training

First, prepare your data into a folder, for example ./trainingVideo/action_dataset/animal30_running

To train a model with dataset animal30_running:

$ python main_dyn_G_motion.py --category animal30_running --isTraining True

The training results will be saved in ./output_synthesis/animal30_running/final_result.

The learned models will be saved in ./output_synthesis/animal30_running/model.

(ii) Testing

$ python main_dyn_G_motion.py --category animal30_running --isTraining False --num_sections_in_test 2 --num_batches_in_test 2 --ckpt_name model.ckpt-6990

testing results will be saved in ./output_synthesis/animal30_running/final_result_testing.

(iii) Results

Synthesizing animal actions (animal action dataset). The first row shows the observed videos, while the second and third rows display two corresponding synthesized videos for each obcerved video. The number of frames of the observed video is less than that of the synthesized video in the experiment of synthesizing human actions.

(3) For recovery

(i) Training and recovering

Using external mask file

Type 1: missing frames

$ python main_dyn_G_recovery.py --category ocean --isTraining True  --training_mode incomplete --mask_type external --mask_file missing_frame_type.mat

Type 2: single region masks

$ python main_dyn_G_recovery.py --category ocean --isTraining True  --training_mode incomplete --mask_type external --mask_file region_type.mat
Using mask generated by the code

Type 1: missing frames

$ python main_dyn_G_recovery.py --category ocean --isTraining True  --training_mode incomplete --mask_type missingFrames

Type 2: single region masks

$ python main_dyn_G_recovery.py --category ocean --isTraining True  --training_mode incomplete --mask_type randomRegion

The results will be saved in ./output_recovery/ocean/final_result.

(ii) Results

   
   

In each example, the first one is the occluded training video, and the second one is the recovered result.

(4) For background inpainting

(i) Inpainting

$ python main_dyn_G_background_inpainting.py --category boats --isTraining True  --training_mode incomplete --mask_type external --mask_file mask128.mat

The results will be saved in ./output_background_inpainting/boats/final_result.

(ii) Results

   

In each example, the first one is the original video, the second one is the result where the target object is removed by our algorithm. (Left) removing a walking person in front of fountain. (Right) removing a moving boat in the lake.

Q & A

For any questions, please contact Jianwen Xie ([email protected]), Ruiqi Gao ([email protected]) and Zilong Zheng ([email protected])

dynamic_generator's People

Contributors

jianwen-xie avatar zilongzheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.