• Stars
    star
    356
  • Rank 119,446 (Top 3 %)
  • Language
    Python
  • License
    Other
  • Created about 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

All about ZeroEggs

ZEGGS

ZeroEGGS: Zero-shot Example-based Gesture Generation from Speech

Paper

This repository contains the code for the ZeroEGGS project from this article. It also contains our stylized speech and gesture dataset

IMAGE ALT TEXT

Click to watch the video demo

Environment Setup

Create and activate a virtual environment to work in, e.g. using Conda:

conda create -n zeggs python=3.8
conda activate zeggs

Install CUDA and PyTorch 1.12.x For CUDA 11.3, this would look like:

conda install pytorch torchvision cudatoolkit=11.3 -c pytorch

Install the remaining requirements with pip:

pip install -r requirements.txt

You may need to install sox on your system

ZEGGS Dataset

zeggs_data

ZEGGS dataset contains 67 sequences of monologues performed by a female actor speaking in English and covers 19 different motion styles.

The following styles are present in the ZEGGS dataset:

Style Length (mins) Style Length (mins)
Agreement 5.25 Pensive 6.21
Angry 7.95 Relaxed 10.81
Disagreement 5.33 Sad 11.80
Distracted 5.29 Sarcastic 6.52
Flirty 3.27 Scared 5.58
Happy 10.08 Sneaky 6.27
Laughing 3.85 Still 5.33
Oration 3.98 Threatening 5.84
Neutral 11.13 Tired 7.13
Old 11.37 Total 134.65

Access to the data

This repository contains large files. In order to clone this repository including the the large zip files, you need to use git lfs. If you still get errors, directly download zip files.

The speech and gesture data are contained in the ./data/Zeggs_data.zip, ./data/Zeggs_data.z01, and ./data/Zeggs_data.z02 files. You must put all of these parts to the same folder, and extract .zip file by WinRAR or Winzip.

When you extract the zip file, there are two folders:

  • original folder contains the original data where the animation and audio files are in their raw version and not processed.

  • clean contains aligned animation and audio data and without unwanted audio of other speaker. For more details on how these files have been processed check data_pipeline.py

All the animation sequences are in the BVH file format and all the audio data are in WAV format.

Data Preparation

Extract the data from the Zeggs_data.zip file and place it in the data folder. Next run:

python data_pipeline.py

This processes data and creates the necessary files for training and evaluation in the "processed" folder. You can customize the data pipeline by changing data_pipeline_conf.json config file. Two suggested configurations are provided in the configs folder. You should change the configuration file name in the script.

Training

You can use pre-trained models stored in ./data/outputs/saved_models. However, if you want to train the model from scratch, run:

python ./main.py -o <configs> -n <run_name>

For example, to train the model with the default configuration, run:

python ./main.py -o "../configs/configs_v1.json" -n "zeggs_v1"

Inference

After training is finished or using provided pretrained models (provided in ./data/outputs), you can generate gestures given speech and style as input using generate.py. The output will be save in bvh format. For full functionality (blending, transitions, using pre-extracted style encodings, etc. ) you need to directly use generate_gesture function. Otherwise, you can use CLI as explained below.

Using the CLI

You can run the inference using the CLI in two ways:

1. Generating a single sample from a single audio/style pair

The CLI command looks like this:

python ./generate.py -o <options file> -s <style file> -a <audio file>

where options file is similar to the training config file but contains the path to the saved pretrained models and other required data. For example, you can run:

python ./generate.py -o "../data/outputs/v1/options.json" -s "../data/clean/067_Speech_2_x_1_0.bvh" -a "../data/clean/067_Speech_2_x_1_0.wav"

To get more help on how to set other parameters such as seed, temperature, output file name, etc., run the command below:

python ./generate.py -h.

2. Generating a batch of samples from a CSV file

You can generate a batch of animated gestures from a csv file containing audio and style file paths along with other parameters by running:

python ./generate.py -o <options file> -c <CSV file>

For example, you can run:

python ./generate.py -o "../data/outputs/v1/options.json" -c "../data/test/evaluation_example_based.csv"

Rendering

The compatible FBX files (male and female characters) along with a MotionBuilder bvh2fbx script is provided in ./bvh2fbx folder. You need to modify the path to your python environment and also the FBX character in bvh2fbx.py and the paths to the MotionBuilder plugins and executable in bvh2fbx.bat scripts. Put all the pairs of bvh and wav files (with the same name) in the ./bvh2fbx/Rendered folder and run bvh2fbx.bat script.

LaForgeCharacters

Citation

If you use this code and dataset, please cite our paper

@article{ghorbani2022zeroeggs,
  author = {Ghorbani, Saeed and Ferstl, Ylva and Holden, Daniel and Troje, Nikolaus F. and Carbonneau, Marc-André},
  title = {ZeroEGGS: Zero-shot Example-based Gesture Generation from Speech},
  journal = {Computer Graphics Forum},
  volume = {42},
  number = {1},
  pages = {206-216},
  keywords = {animation, gestures, character control, motion capture},
  doi = {https://doi.org/10.1111/cgf.14734},
  url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/cgf.14734},
  eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/cgf.14734},
  year = {2023}
}

© [2022] Ubisoft Entertainment. All Rights Reserved

More Repositories

1

mixer

Add-on for real-time collaboration in Blender.
Python
1,316
star
2

massgate

Massgate is the online backend server for the Massive Entertainment game World in Conflict, and is now open-source to make it possible for anyone to host their own Massgate server.
C++
1,124
star
3

ubisoft-laforge-animation-dataset

Ubisoft La Forge - Animation Dataset
Python
954
star
4

Sharpmake

Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.
C#
910
star
5

mobydq

🐳 Tool to automate data quality checks on data pipelines
Vue
245
star
6

shotmanager

Shot Manager is a Blender add-on that introduces a true shot entity in Blender scenes, as well as a wide and powerful set of tools to build and edit sequences in real-time directly in the 3D context.
Python
197
star
7

ubisoft-laforge-daft-exprt

PyTorch Implementation of Daft-Exprt: Robust Prosody Transfer Across Speakers for Expressive Speech Synthesis
Python
118
star
8

NGitLab

.NET client for GitLab
C#
114
star
9

task-scheduler

TaskScheduler is a set of algorithms working together for asynchronous threaded code execution.
C++
84
star
10

vrtist

Virtual Reality tool for storytelling
C#
60
star
11

vulnmine

Vulnmine searches for vulnerable hosts using MS SCCM host / software inventory data with NIST NVD Vulnerability feed data.
Python
38
star
12

ubisoft-laforge-disentanglement-metrics

Python
32
star
13

ubisoft-laforge-Poisson-Filters

Code for "Compact Poisson Filters for Fast Fluid Simulation", ACM SIGGRAPH 2022 Conference.
HLSL
30
star
14

GitTimeLapseView

GitTimeLapseView is a visual diff tool that adds a timeline to your blame view
C#
29
star
15

videotracks

Video Tracks is a Blender add-on that provides track headers to the channels of the VSE.
Python
27
star
16

ubisoft-laforge-FFHQ-UV-Intrinsics

FFHQ-UV-Intrinstics: A dataset containing intrinsic face decomposition for 10k subjects of FFHQ-UV
26
star
17

stampinfo

Stamp Info is a Blender add-on that ensures the tracking of the rendered images by writing all the meta information directly on them, on specific areas such as their top and bottom.
Python
21
star
18

DirectBehaviorSpecification

Code to reproduce the Arena environment experiments from Direct Behavior Specification via Constrained Reinforcement Learning.
ASP.NET
19
star
19

ubisoft-laforge-asaf

Asaf
Python
16
star
20

ubisoft-laforge-face-editing-face-editing-using-part-based-optimization-of-the-latent-space

Face Editing Using Part-Based Optimization of the Latent Space
Python
14
star
21

assetbank

Blender add-on to manage asset banks and import or link 3D objects into Blender scenes.
Python
10
star
22

SmartNavMapGenerator

C#
9
star
23

ubisoft-laforge-climate-change-dataset

data set with Images extracted in WD2 engine
8
star
24

ubisoft-laforge-predictionperformance

Replication package for the paper: "Performance Prediction From Source Code Is Task and Domain Specific"
Python
7
star
25

usd-lod-schema-proposal

An open discussion to define a schema for Level Of Details in USD
7
star
26

ubisoft-laforge-PredictiveDeadReckoning

code from Predictive Dead Reckoning for Online Peer-to-Peer Games publication
Python
7
star
27

SmartNavEnvironment

C#
6
star
28

quartz-tezos-contracts

Ubisoft Quartz smart contract sources and build tools
JavaScript
5
star
29

ubisoft-laforge-lookat

Roff
4
star
30

ubisoft-laforge-brownbuild

Python
3
star
31

ubisoft-laforge-french-homograph-dataset

Complementary dataset for La Forge Speech Synthesis System for Blizzard Challenge 2023
2
star
32

genesis-contracts

Solidity
2
star
33

ubisoft-laforge-CrashReportPriorizationForLargeScaleScheduledLaunches

supporting material for Crash Report Prioritization for Large-Scale Scheduled Launches
Jupyter Notebook
1
star
34

ubisoft-laforge-toxbuster

Python
1
star
35

Ubisoft-LaForge-ToxPlainerDataSet

Dataset supporting "Unveiling Identity Biases in Toxicity Detection : A Game-Focused Dataset and Reactivity Analysis Approach"
1
star