Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リアルタイム特化推論の追加 #371

Merged
merged 3 commits into from
Jul 4, 2023

Conversation

nadare881
Copy link
Contributor

リアルタイム推論に向けた高速化したinfer関数の実装中です。
この実装中に現在の実装における問題点が見つかりました。

faissのretrievalのあとpitchを小さくしてsilent frontに通し、inferencerに与えるfeatsやpitchの長さを短くしています。
rvcのinferencerはdecoderにおいてtransformerやwavenetで遠くのピッチや特徴量を見るのですが、現在の実装であるとbuffer sizeが小さいほど推論が不安定になり、ふにゃふにゃした声になってしまいます。

そこで、リアルタイム推論の関数で高速化しつつ、silent frontを廃止し入力に長めのデータを入れることでbuffer sizeが小さい時の安定性を上げます。

現在作成済みのonnxはもう一度作り直さないと遅くなってしまうかもしれないですが、よろしくお願いいたします。

@nadare881 nadare881 changed the title リアルタイム特化推論の追加 + silent frontの廃止 リアルタイム特化推論の追加 Jul 1, 2023
@nadare881
Copy link
Contributor Author

nadare881 commented Jul 1, 2023

advanced settingにsilent frontの設定があるのでそれを使います

silent_front→ ピッチの推定とfaissのretrievalに影響、過去の特徴を使いまわす(feature qualityみたいな名前にしたい)

@nadare881 nadare881 marked this pull request as ready for review July 1, 2023 07:46
@nadare881
Copy link
Contributor Author

silent frontでピッチ推定の高速化をしつつ、過去のピッチと検索特徴量を使いまわすように変更しました。
また、RVCのinfer関数を高速化して、推論時に高速に動くようにしました。

onnxについては変更ありません。onnxは従来とほぼ同等の動きをします。

あみたろさんのRVC V2モデル、onnxモデル、自作ピッチ無しv2モデルで動作確認済みです。

@nadare881 nadare881 marked this pull request as ready for review July 1, 2023 08:14
@w-okada
Copy link
Owner

w-okada commented Jul 1, 2023

ありがとうございます!
確認します!

@w-okada w-okada merged commit fa07de8 into w-okada:master Jul 4, 2023
@w-okada
Copy link
Owner

w-okada commented Jul 4, 2023

遅くなりました。
こちらでも動作確認できましたのでマージしました。

@@ -97,13 +103,14 @@ def exec(

# RVC QualityがOnのときにはsilence_frontをオフに。
silence_front = silence_front if repeat == 0 else 0
pitchf = pitchf if repeat == 0 else torch.zeros([pitchf.shape[0], pitchf.shape[1] * 2])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの変更がバグっているので修正する

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants