Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -674,9 +674,6 @@ def voice_conversion(source, target, diffusion_steps, length_adjust, inference_c
|
|
674 |
).export(format="mp3", bitrate=bitrate).read()
|
675 |
yield mp3_bytes, None
|
676 |
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
import gradio as gr
|
681 |
|
682 |
gallery_data = {"sikokumetan": {"webp": "default/sikokumetan.webp", "mp3": "default/sikokumetan.mp3"}}
|
@@ -726,63 +723,3 @@ if __name__ == "__main__":
|
|
726 |
gallery.select(update_reference, outputs=inputs[1])
|
727 |
|
728 |
interface.launch()
|
729 |
-
with gr.Blocks() as interface:
|
730 |
-
gr.Interface(fn=voice_conversion, description=description, inputs=inputs, outputs=[
|
731 |
-
gr.Audio(label="ストリーム出力音声", streaming=True, format='mp3'),
|
732 |
-
gr.Audio(label="完全出力音声", streaming=False, format='wav')
|
733 |
-
], title="Seed Voice Conversion", examples=examples, cache_examples=False)
|
734 |
-
|
735 |
-
with gr.Row():
|
736 |
-
gallery = gr.Gallery(label="ギャラリー", show_label=True, value=[gallery_data["sikokumetan"]["webp"]])
|
737 |
-
|
738 |
-
gallery.select(update_reference, outputs=inputs[1])
|
739 |
-
|
740 |
-
interface.launch()import gradio as gr
|
741 |
-
|
742 |
-
gallery_data = {"sikokumetan": {"webp": "default/sikokumetan.webp", "mp3": "default/sikokumetan.mp3"}}
|
743 |
-
|
744 |
-
def update_reference(evt: gr.SelectData):
|
745 |
-
selected_image = evt.value
|
746 |
-
for key, value in gallery_data.items():
|
747 |
-
if value["webp"] == selected_image:
|
748 |
-
print(f"選択された画像: {selected_image}, 対応するMP3: {value['mp3']}")
|
749 |
-
return value["mp3"]
|
750 |
-
print("対応するMP3が見つかりませんでした。")
|
751 |
-
return ""
|
752 |
-
|
753 |
-
if __name__ == "__main__":
|
754 |
-
description = ("Zero-shot音声変換モデル(学習不要)。ローカルでの利用方法は[GitHubリポジトリ](https://github.com/Plachtaa/seed-vc)をご覧ください。"
|
755 |
-
"参考音声が25秒を超える場合、自動的に25秒にクリップされます。"
|
756 |
-
"また、元音声と参考音声の合計時間が30秒を超える場合、元音声は分割処理されます。")
|
757 |
-
|
758 |
-
inputs = [
|
759 |
-
gr.Audio(type="filepath", label="元音声"),
|
760 |
-
gr.Audio(type="filepath", label="参考音声"),
|
761 |
-
gr.Slider(minimum=1, maximum=200, value=10, step=1, label="拡散ステップ数", info="デフォルトは10、50~100が最適な品質"),
|
762 |
-
gr.Slider(minimum=0.5, maximum=2.0, step=0.1, value=1.0, label="長さ調整", info="1.0未満で速度を上げ、1.0以上で速度を遅くします"),
|
763 |
-
gr.Slider(minimum=0.0, maximum=1.0, step=0.1, value=0.7, label="推論CFG率", info="わずかな影響があります"),
|
764 |
-
gr.Checkbox(label="F0条件付きモデルを使用", value=False, info="歌声変換には必須です"),
|
765 |
-
gr.Checkbox(label="F0自動調整", value=True, info="F0をおおよそ調整して目標音声に合わせます。F0条件付きモデル使用時にのみ有効です"),
|
766 |
-
gr.Slider(label='音程変換', minimum=-24, maximum=24, step=1, value=0, info="半音単位の音程変換。F0条件付きモデル使用時にのみ有効です"),
|
767 |
-
]
|
768 |
-
|
769 |
-
examples = [["examples/source/yae_0.wav", "examples/reference/dingzhen_0.wav", 25, 1.0, 0.7, False, True, 0],
|
770 |
-
["examples/source/jay_0.wav", "examples/reference/azuma_0.wav", 25, 1.0, 0.7, True, True, 0],
|
771 |
-
["examples/source/Wiz Khalifa,Charlie Puth - See You Again [vocals]_[cut_28sec].wav",
|
772 |
-
"examples/reference/teio_0.wav", 100, 1.0, 0.7, True, False, 0],
|
773 |
-
["examples/source/TECHNOPOLIS - 2085 [vocals]_[cut_14sec].wav",
|
774 |
-
"examples/reference/trump_0.wav", 50, 1.0, 0.7, True, False, -12],
|
775 |
-
]
|
776 |
-
|
777 |
-
with gr.Blocks() as interface:
|
778 |
-
gr.Interface(fn=voice_conversion, description=description, inputs=inputs, outputs=[
|
779 |
-
gr.Audio(label="ストリーム出力音声", streaming=True, format='mp3'),
|
780 |
-
gr.Audio(label="完全出力音声", streaming=False, format='wav')
|
781 |
-
], title="Seed Voice Conversion", examples=examples, cache_examples=False)
|
782 |
-
|
783 |
-
with gr.Row():
|
784 |
-
gallery = gr.Gallery(label="ギャラリー", show_label=True, value=[gallery_data["sikokumetan"]["webp"]])
|
785 |
-
|
786 |
-
gallery.select(update_reference, outputs=inputs[1])
|
787 |
-
|
788 |
-
interface.launch()
|
|
|
674 |
).export(format="mp3", bitrate=bitrate).read()
|
675 |
yield mp3_bytes, None
|
676 |
|
|
|
|
|
|
|
677 |
import gradio as gr
|
678 |
|
679 |
gallery_data = {"sikokumetan": {"webp": "default/sikokumetan.webp", "mp3": "default/sikokumetan.mp3"}}
|
|
|
723 |
gallery.select(update_reference, outputs=inputs[1])
|
724 |
|
725 |
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|