Code Monkey home page Code Monkey logo

wav2vec2fbx's Introduction

Wav2Vec2FBX

Generate an FBX of a phoneme lip-sync animation from an sigle audio file, using Wav2Vec2 to analyze the phonemes for helps the animators starts with very basic animation.

alt text

Table of contents

Installation

Environment

Virtual environment, Python 3.7 is highly recommended, as it is supported by the FBX Python SDK.

Clone repository

git clone https://github.com/yamahigashi/Wav2Vec2FBX.git
cd Wav2Vec2FBX
pip install requirements.txt

FBX python SDK

https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-0 download FBX SDK from autodesk and place libraries (fbx.pyd, FbxCommon.py and fbxsip.pyd) into lib folder.

Run

python main.py input_audio.wav

This will generate input_audio.fbx in the same folder as the input file.

Configuration

The behaviour can be changed by the configuration file assets/config.toml.

keyframes settings

[keyframes]
# ipa と無口を補完するフレーム
interpolation = 5

# 複数口形素からなる ipa を補完するフレーム
consecutive_viseme_frame = 3

audio settings section

Describes settings for preprocessing an audio file. It splits the file based on the silence, and if it is still too long, splits the file based on the settings.

[audio_settings]

# 無音期間を判定する際の最小ミリセク  (初期値 500)
min_silence_len_ms = 500

# 無音判定 (初期値 -36)
silence_thresh_db = -36

# 最長オーディオファイル。これ以上は複数に分割して処理 (初期値 5000)
maximum_duration_ms = 5000   

ipa to arpabet table settings

The phonemes to morphemes correspondence table. The phonemes determined by Wav2Vec are mapped to oral morphemes. The list of morphonemes can be given as.

[ipa_to_arpabet]
'ɔ'      = ["a"]
'ɑ'     = ["a"]
'i'      = ["i"]
# Long Vowels
'e ː'   = ["e", "e"]
'o ː'   = ["o", "o"]

# -------- snip --------------

Build binary using cx_Freeze

You can deploy this package as binary for the environment without python using cx_Freeze.

python setup.py build

This will generate binary for your platform.

References

wav2vec2fbx's People

Contributors

yamahigashi avatar

Stargazers

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

Watchers

 avatar  avatar  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.