Git Product home page Git Product logo

aaai2024-cpabmm's Introduction

Continuous Piecewise-Affine Based Motion Model for Image Animation (AAAI 2024)

Hexiang Wang, Fengqi Liu, Qianyu Zhou, Ran Yi, Xin Tan, and Lizhuang Ma

image

Introduction

Abstract

Image animation aims to bring static images to life according to driving videos and create engaging visual content that can be used for various purposes such as animation, entertainment, and education. Recent unsupervised methods utilize affine and thin-plate spline transformations based on keypoints to transfer the motion in driving frames to the source image. However, limited by the expressive power of the transformations used, these methods always produce poor results when the gap between the motion in the driving frame and the source image is large. To address this issue, we propose to model motion from the source image to the driving frame in highly-expressive diffeomorphism spaces. Firstly, we introduce Continuous Piecewise-Affine based (CPAB) transformation to model the motion and present a well-designed inference algorithm to generate CPAB transformation from control keypoints. Secondly, we propose a SAM-guided keypoint semantic loss to further constrain the keypoint extraction process and improve the semantic consistency between the corresponding keypoints on the source and driving images. Finally, we design a structure alignment loss to align the structure-related features extracted from driving and generated images, thus helping the generator generate results that are more consistent with the driving action. Extensive experiments on four datasets demonstrate the effectiveness of our method against state-of-the-art competitors quantitatively and qualitatively.

This work has been accepted by AAAI 2024.

Examples of image animation

image

Installation

Clone this project in recursive mode:

git clone --recursive https://github.com/DevilPG/AAAI2024-CPABMM.git

For detailed information about the CPAB transformation library, please refer to libcpab.

Please run the project in python3 environment. To install the dependencies run:

pip install -r requirements.txt

Configuration

Configuration files are in the config folder, one for each dataset, named as config/dataset_name.yaml.

Datasets

For detailed information of four datasets used in this paper, please follow TPSMM.

Training

To train a model on specific dataset run:

python run.py --config config/dataset_name.yaml --log_dir dir_to_save_log_files --tag id_for_training_task

Training AVD network

To train a model on specific dataset run:

python run.py --mode train_avd --checkpoint '{checkpoint_folder}/checkpoint.pth.tar' --config config/dataset_name.yaml

Evaluation on video reconstruction

To evaluate the model on video reconstruction task run:

CUDA_VISIBLE_DEVICES=0 python run.py --mode reconstruction --config config/dataset_name.yaml --checkpoint '{checkpoint_folder}/checkpoint.pth.tar'

To compute quantitative metrics, please follow instructions from pose-evaluation.

Image animation demo

To generate a animation video with a source image and a driving video run:

python demo.py --config config/dataset_name.yaml --checkpoint {checkpoint_folder}/checkpoint.pth.tar --source_image path_to_source_img --driving_video path_to_driving_video

Citation

If you find this code helpful for your research, please cite:

@article{wang2024cpabmm,
  title={Continuous Piecewise-Affine Based Motion Model for Image Animation},
  author={Hexiang Wang and Fengqi Liu and Qianyu Zhou and Ran Yi and Xin Tan and Lizhuang Ma},
  journal={arXiv preprint arXiv:2401.09146},
  year={2024}
}

aaai2024-cpabmm's People

Contributors

devilpg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

whuhxb

aaai2024-cpabmm's Issues

求代码

KeypointSemanticLoss模块的代码好像没上传耶

实验设备

您好 请问您是用了多少资源跑实验的呢?

Question about ablation study?

In Table 2 of the parper, what the differernce betweeen the last two rows. What does full model have more than CPAB, Global and Struct Loss ?

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.