Giter Site home page Giter Site logo

umasaki1182 / realtime-yukarin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hiroshiba/realtime-yukarin

0.0 1.0 0.0 1.01 MB

ディープラーニング声質変換を使って、リアルタイムで声質変換する

License: MIT License

Python 99.79% Shell 0.21%

realtime-yukarin's Introduction

realtime-yukarin

ディープラーニング声質変換を使って、リアルタイムで声質変換する。

推奨環境

  • Windows
  • GeForce GTX 1060
  • 6GB 以上の GPU メモリ
  • Intel Core i7-7700 CPU @ 3.60GHz
  • Python 3.6.x

準備

必要なライブラリのインストール

pip install -r requirements.txt

学習済みモデルの準備

実行するために必要なデータは、yukarinbecome-yukarinの学習済みモデルと設定ファイル、 yukarinで得られる、入力・目標音声の周波数の統計量のファイルです。

ここでは、次のようにファイル名を設定したとします。

説明 ファイル名
入力音声の周波数の統計量のファイル ./sample/input_statistics.npy
目標音声の周波数の統計量のファイル ./sample/tareget_statistics.npy
yukarin用のモデル ./sample/model_stage1/predictor.npz
yukarin用の設定ファイル ./sample/model_stage1/config.json
become-yukarin用のモデル ./sample/model_stage2/predictor.npz
become-yukarin用の設定ファイル ./sample/model_stage2/config.json

確認

./check.pyを実行して、用意したファイルで正しく動くか確認します。 次の例では、input.wavの音声データ5秒を声質変換し、音声データをoutput.wavに出力します。

python check.py \
    --input_path 'input.wav' \
    --input_time_length 5 \
    --output_path 'output.wav' \
    --input_statistics_path './sample/model_stage1/predictor.npz' \
    --target_statistics_path './sample/model_stage1/config.json' \
    --stage1_model_path './sample/model_stage2/predictor.npz' \
    --stage1_config_path './sample/model_stage2/config.json' \
    --stage2_model_path './sample/input_statistics.npy' \
    --stage2_config_path './sample/tareget_statistics.npy' \

動かない場合はGithubのIssueで質問することができます。

実行

リアルタイム声質変換を実行するには、設定ファイルconfig.yamlを作成し、./run.pyを実行します。

python run.py ./config.yml

設定ファイルの説明

# 入力サウンドデバイスの名前。部分一致。詳細は下記
input_device_name: str

# 出力サウンドデバイスの名前。部分一致。詳細は下記
output_device_name: str

# 入力音声サンプリングレート
input_rate: int

# 出力音声サンプリングレート
output_rate: int

# 音響特徴量のframe_period
frame_period: int

# 一度に変換する音声の長さ(秒)。長すぎると遅延が増え、短すぎると処理が追いつかない
buffer_time: float

or crepe  # 基本周波数を求める手法。CREPEは別途ライブラリが必要、詳細はrequirements.txt
extract_f0_mode: worl

# 一度に合成する音声の長さ(サンプル数)
vocoder_buffer_size: int

# 入力音声データの振幅スケーリング。1以上だと音を大きくし、1未満だと小さくする
input_scale: float

# 出力音声データの振幅スケーリング。1以上だと音を大きくし、1未満だと小さくする
output_scale: float

# 入力音声データが無音だとみなされる閾値(db)。小さいほど無音に判定されやすい
input_silent_threshold: float

# 出力音声データが無音だとみなされる閾値(db)。小さいほど無音に判定されやすい
output_silent_threshold: float

# エンコード時の前後オーバーラップ(秒)
encode_extra_time: float

# コンバート時の前後オーバーラップ(秒)
convert_extra_time: float

# デコード時の前後オーバーラップ(秒)
decode_extra_time: float

# 学習済みモデルのファイル
input_statistics_path: str
target_statistics_path: str
stage1_model_path: str
stage1_config_path: str
stage2_model_path: str
stage2_config_path: str

サウンドデバイスの名前

下の例だと、Logicool Speakerがサウンドデバイスの名前。

License

MIT License

realtime-yukarin's People

Contributors

hiroshiba avatar

Watchers

James Cloos 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.