All Projects → GestureGeneration → Speech_driven_gesture_generation_with_autoencoder

GestureGeneration / Speech_driven_gesture_generation_with_autoencoder

Licence: Apache-2.0 license
This is the official implementation for IVA '19 paper "Analyzing Input and Output Representations for Speech-Driven Gesture Generation".

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Speech driven gesture generation with autoencoder

probabilistic nlg
Tensorflow Implementation of Stochastic Wasserstein Autoencoder for Probabilistic Sentence Generation (NAACL 2019).
Stars: ✭ 28 (-63.16%)
Mutual labels:  autoencoder, generation
speech-driven-hand-gesture-generation-demo
This repository contains the gesture generation model from the paper "Moving Fast and Slow" (https://www.tandfonline.com/doi/full/10.1080/10447318.2021.1883883) trained on the English dataset
Stars: ✭ 19 (-75%)
Mutual labels:  gesture-controller, gesture-generation
maui
Multi-omics Autoencoder Integration: Deep learning-based heterogenous data analysis toolkit
Stars: ✭ 42 (-44.74%)
Mutual labels:  autoencoder
interactiveviewer gallery
Enhancements to interactiveviewer: picture and video preview, support two-finger gesture zoom, double-click to zoom, switch left and right。图片预览,视频预览,图片视频混合预览
Stars: ✭ 45 (-40.79%)
Mutual labels:  gesture
GestureLockView
九宫格手势解锁控件
Stars: ✭ 39 (-48.68%)
Mutual labels:  gesture
catseye
Neural network library written in C and Javascript
Stars: ✭ 29 (-61.84%)
Mutual labels:  autoencoder
erdiagram
Entity-Relationship diagram code generator library
Stars: ✭ 28 (-63.16%)
Mutual labels:  generation
mapbox-gestures-android
The Mapbox Gestures for Android library makes it easy to detect and handle user gestures on an Android device.
Stars: ✭ 25 (-67.11%)
Mutual labels:  gesture
deep-steg
Global NIPS Paper Implementation Challenge of "Hiding Images in Plain Sight: Deep Steganography"
Stars: ✭ 43 (-43.42%)
Mutual labels:  autoencoder
myo-armband-nn
Gesture recognition using myo armband via neural network (tensorflow library).
Stars: ✭ 33 (-56.58%)
Mutual labels:  gesture
autoencoders tensorflow
Automatic feature engineering using deep learning and Bayesian inference using TensorFlow.
Stars: ✭ 66 (-13.16%)
Mutual labels:  autoencoder
VisualML
Interactive Visual Machine Learning Demos.
Stars: ✭ 104 (+36.84%)
Mutual labels:  autoencoder
table-evaluator
Evaluate real and synthetic datasets with each other
Stars: ✭ 44 (-42.11%)
Mutual labels:  generation
autoencoder for physical layer
This is my attempt to reproduce and extend the results in the paper "An Introduction to Deep Learning for the Physical Layer" by Tim O'Shea and Jakob Hoydis
Stars: ✭ 43 (-43.42%)
Mutual labels:  autoencoder
Low-Poly-Procedural-Generation
Low Poly Terrain generation in Unity adapted from Sebastian Langue's series
Stars: ✭ 51 (-32.89%)
Mutual labels:  generation
ilvr adm
ILVR: Conditioning Method for Denoising Diffusion Probabilistic Models (ICCV 2021 Oral)
Stars: ✭ 133 (+75%)
Mutual labels:  generation
mae-scalable-vision-learners
A TensorFlow 2.x implementation of Masked Autoencoders Are Scalable Vision Learners
Stars: ✭ 54 (-28.95%)
Mutual labels:  autoencoder
iMoney
iMoney 金融项目
Stars: ✭ 55 (-27.63%)
Mutual labels:  gesture
libwifi
An 802.11 Frame Generation and Parsing Library in C
Stars: ✭ 27 (-64.47%)
Mutual labels:  generation
shared-latent-space
Shared Latent Space VAE's
Stars: ✭ 15 (-80.26%)
Mutual labels:  autoencoder

Aud2Repr2Pose: Analyzing input and output representations for speech-driven gesture generation

Taras Kucherenko, Dai Hasegawa, Gustav Eje Henter, Naoshi Kaneko, Hedvig Kjellström

ImageOfIdea

This repository contains Keras and Tensorflow based implementation of the speech-driven gesture generation by a neural network which was published at International Conference on Intelligent Virtual Agents (IVA'19) and the extention was published in International Journal of Human-Computer Interaction in 2021.

The project website contains all the information about this project, including video explanation of the method and the paper.

Demo on another dataset

This model has been applied to English dataset.

The demo video as well as the code to run the pre-trained model are online.

Requirements

  • Python 3

Initial setup

install packages

# if you have GPU
pip install tensorflow-gpu==1.15.2

# if you don't have GPU
pip install tensorflow==1.15.2

pip install -r requirements.txt

install ffmpeg

# macos
brew install ffmpeg
# ubuntu
sudo add-apt-repository ppa:jonathonf/ffmpeg-4
sudo apt-get update
sudo apt-get install ffmpeg

 


 

How to use this repository?

0. Notation

We write all the parameters which needs to be specified by a user in the capslock.

1. Download raw data

  • Clone this repository
  • Download a dataset from https://www.dropbox.com/sh/j419kp4m8hkt9nd/AAC_pIcS1b_WFBqUp5ofBG1Ia?dl=0
  • Create a directory named dataset and put two directories motion/ and speech/ under dataset/

2. Split dataset

  • Put the folder with the dataset in the data_processing directory of this repo: next to the script prepare_data.py
  • Run the following command
python data_processing/prepare_data.py DATA_DIR
# DATA_DIR = directory to save data such as 'data/'

Note: DATA_DIR is not a directory where the raw data is stored (the folder with data, "dataset" , has to be stored in the root folder of this repo). DATA_DIR is the directory where the postprocessed data should be saved. After this step you don't need to have "dataset" in the root folder any more. You should use the same DATA_DIR in all the following scripts.

After this command:

  • train/ test/ dev/ are created under DATA_DIR/
    • in inputs/ inside each directory, audio(id).wav files are stored
    • in labels/ inside each directory, gesture(id).bvh files are stored
  • under DATA_DIR/, three csv files gg-train.csv gg-test.csv gg-dev.csv are created and these files have paths to actual data

3. Convert the dataset into vectors

python data_processing/create_vector.py DATA_DIR N_CONTEXT
# N_CONTEXT = number of context, in our experiments was set to '60'
# (this means 30 steps backwards and forwards)

Note: if you change the N_CONTEXT value - you need to update it in the train.py script.

(You are likely to get a warning like this "WARNING:root:frame length (5513) is greater than FFT size (512), frame will be truncated. Increase NFFT to avoid." )

As a result of running this script

  • numpy binary files X_train.npy, Y_train.npy (vectord dataset) are created under DATA_DIR
  • under DATA_DIR/test_inputs/ , test audios, such as X_test_audio1168.npy , are created
  • when N_CONTEXT = 60, the audio vector's shape is (num of timesteps, 61, 26)
  • gesture vector's shape is(num of timesteps, 384) - 384 = 64joints × (x,y,z positions + x,y,z velocities)

If you don't want to customize anything - you can skip reading about steps 4-7 and just use already prepared scripts at the folder example_scripts

 

4. Learn motion representation by AutoEncoder

Create a directory to save training checkpoints such as chkpt/ and use it as CHKPT_DIR parameter.

Learn dataset encoding

python motion_repr_learning/ae/learn_dataset_encoding.py DATA_DIR -chkpt_dir=CHKPT_DIR -layer1_width=DIM

The optimal dimensionality (DIM) in our experiment was 325

Encode dataset

Create DATA_DIR/DIM directory

python motion_repr_learning/ae/encode_dataset.py DATA_DIR -chkpt_dir=CHKPT_DIR -restore=True -pretrain=False -layer1_width=DIM

More information can be found in the folder motion_repr_learning

5. Learn speech-driven gesture generation model

python train.py MODEL_NAME EPOCHS DATA_DIR N_INPUT ENCODE DIM
# MODEL_NAME = hdf5 file name such as 'model_500ep_posvel_60.hdf5'
# EPOCHS = how many epochs do we want to train the model (recommended - 100)
# DATA_DIR = directory with the data (should be same as above)
# N_INPUT = how many dimension does speech data have (default - 26)
# ENCODE = weather we train on the encoded gestures (using proposed model) or on just on the gestures as their are (using baseline model)
# DIM = how many dimension does encoding have (ignored if you don't encode)

6. Predict gesture

python predict.py MODEL_NAME INPUT_SPEECH_FILE OUTPUT_GESTURE_FILE
# Usage example
python predict.py model.hdf5 data/test_inputs/X_test_audio1168.npy data/test_inputs/predict_1168_20fps.txt
# You need to decode the gestures
python motion_repr_learning/ae/decode.py DATA_DIR ENCODED_PREDICTION_FILE DECODED_GESTURE_FILE -restore=True -pretrain=False -layer1_width=DIM -chkpt_dir=CHKPT_DIR -batch_size=8 

Note: This can be used in a for loop over all the test sequences. Examples are provided in the example_scripts folder of this directory

# The network produces both coordinates and velocity
# So we need to remove velocities
python helpers/remove_velocity.py -g PATH_TO_GESTURES

7. Quantitative evaluation

Use scripts in the evaluation folder of this directory.

Examples are provided in the example_scripts folder of this repository

8. Qualitative evaluation

Use animation server

 

Citation

If you use this code in your research please cite the paper:

@article{kucherenko2021moving,
  title={Moving fast and slow: Analysis of representations and post-processing in speech-driven automatic gesture generation},
  author={Kucherenko, Taras and Hasegawa, Dai and Kaneko, Naoshi and Henter, Gustav Eje and Kjellstr{\"o}m, Hedvig},
  journal={International Journal of Human–Computer Interaction},
  doi={10.1080/10447318.2021.1883883},
  year={2021}
}

Contact

If you encounter any problems/bugs/issues please contact me on Github or by emailing me at [email protected] for any bug reports/questions/suggestions. I prefer questions and bug reports on Github as that provides visibility to others who might be encountering same issues or who have the same questions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].