MCPcopy Index your code
hub / github.com/albertpumarola/GANimation

github.com/albertpumarola/GANimation @main sqlite

repository ↗ · DeepWiki ↗
153 symbols 364 edges 24 files 11 documented · 7%
README

GANimation: Anatomically-aware Facial Animation from a Single Image

[Project] [Paper]

Official implementation of GANimation. In this work we introduce a novel GAN conditioning scheme based on Action Units (AU) annotations, which describe in a continuous manifold the anatomical facial movements defining a human expression. Our approach permits controlling the magnitude of activation of each AU and combine several of them. For more information please refer to the paper.

This code was made public to share our research for the benefit of the scientific community. Do NOT use it for immoral purposes.

GANimation

Prerequisites

  • Install PyTorch (version 0.3.1), Torch Vision and dependencies from http://pytorch.org
  • Install requirements.txt (pip install -r requirements.txt)

Data Preparation

The code requires a directory containing the following files: - imgs/: folder with all image - aus_openface.pkl: dictionary containing the images action units. - train_ids.csv: file containing the images names to be used to train. - test_ids.csv: file containing the images names to be used to test.

An example of this directory is shown in sample_dataset/.

To generate the aus_openface.pkl extract each image Action Units with OpenFace and store each output in a csv file the same name as the image. Then run:

python data/prepare_au_annotations.py

Run

To train:

bash launch/run_train.sh

To test:

python test --input_path path/to/img

Citation

If you use this code or ideas from the paper for your research, please cite our paper:

@article{Pumarola_ijcv2019,
    title={GANimation: One-Shot Anatomically Consistent Facial Animation},
    author={A. Pumarola and A. Agudo and A.M. Martinez and A. Sanfeliu and F. Moreno-Noguer},
    booktitle={International Journal of Computer Vision (IJCV)},
    year={2019}
}

Core symbols most depended-on inside this repo

forward
called by 6
models/ganimation.py
save
called by 5
models/models.py
_do_if_necessary_saturate_mask
called by 5
models/ganimation.py
mkdir
called by 4
utils/util.py
plot_scalars
called by 3
utils/tb_visualizer.py
get_by_name
called by 3
data/dataset.py
set_input
called by 3
models/models.py
get_current_errors
called by 3
models/models.py

Shape

Method 115
Function 20
Class 18

Languages

Python100%

Modules by API surface

models/models.py27 symbols
models/ganimation.py27 symbols
data/dataset.py12 symbols
data/dataset_aus.py11 symbols
networks/networks.py9 symbols
utils/tb_visualizer.py8 symbols
options/base_options.py8 symbols
train.py7 symbols
test.py7 symbols
utils/util.py6 symbols
utils/face_utils.py6 symbols
networks/generator_wasserstein_gan.py6 symbols

For agents

$ claude mcp add GANimation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact