Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -733,36 +733,21 @@ if __name__ == "__main__":
|
|
| 733 |
).launch()
|
| 734 |
|
| 735 |
|
| 736 |
-
|
| 737 |
-
|
| 738 |
import gradio as gr
|
| 739 |
|
| 740 |
-
|
| 741 |
-
gallery_data = [
|
| 742 |
-
{
|
| 743 |
-
"image": "default/sikokumetan.webp",
|
| 744 |
-
"mp3": "default/sikokumetan.mp3"
|
| 745 |
-
}
|
| 746 |
-
]
|
| 747 |
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
return None
|
| 754 |
-
|
| 755 |
-
# 出力の再定義 (重要)
|
| 756 |
-
outputs = [
|
| 757 |
-
gr.Audio(label="ストリーム出力音声", streaming=True, format='mp3'),
|
| 758 |
-
gr.Audio(label="完全出力音声", streaming=False, format='wav')
|
| 759 |
-
]
|
| 760 |
|
| 761 |
if __name__ == "__main__":
|
| 762 |
description = ("Zero-shot音声変換モデル(学習不要)。ローカルでの利用方法は[GitHubリポジトリ](https://github.com/Plachtaa/seed-vc)をご覧ください。"
|
| 763 |
"参考音声が25秒を超える場合、自動的に25秒にクリップされます。"
|
| 764 |
"また、元音声と参考音声の合計時間が30秒を超える場合、元音声は分割処理されます。")
|
| 765 |
-
|
| 766 |
inputs = [
|
| 767 |
gr.Audio(type="filepath", label="元音声"),
|
| 768 |
gr.Audio(type="filepath", label="参考音声"),
|
|
@@ -774,25 +759,24 @@ if __name__ == "__main__":
|
|
| 774 |
gr.Slider(label='音程変換', minimum=-24, maximum=24, step=1, value=0, info="半音単位の音程変換。F0条件付きモデル使用時にのみ有効です"),
|
| 775 |
]
|
| 776 |
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
return on_image_select(selected_image)
|
| 788 |
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
|
|
|
| 733 |
).launch()
|
| 734 |
|
| 735 |
|
|
|
|
|
|
|
| 736 |
import gradio as gr
|
| 737 |
|
| 738 |
+
gallery_data = {"sikokumetan": {"webp": "default/sikokumetan.webp", "mp3": "default/sikokumetan.mp3"}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 739 |
|
| 740 |
+
def update_reference(selected_image):
|
| 741 |
+
for key, value in gallery_data.items():
|
| 742 |
+
if value["webp"] == selected_image:
|
| 743 |
+
return value["mp3"]
|
| 744 |
+
return ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 745 |
|
| 746 |
if __name__ == "__main__":
|
| 747 |
description = ("Zero-shot音声変換モデル(学習不要)。ローカルでの利用方法は[GitHubリポジトリ](https://github.com/Plachtaa/seed-vc)をご覧ください。"
|
| 748 |
"参考音声が25秒を超える場合、自動的に25秒にクリップされます。"
|
| 749 |
"また、元音声と参考音声の合計時間が30秒を超える場合、元音声は分割処理されます。")
|
| 750 |
+
|
| 751 |
inputs = [
|
| 752 |
gr.Audio(type="filepath", label="元音声"),
|
| 753 |
gr.Audio(type="filepath", label="参考音声"),
|
|
|
|
| 759 |
gr.Slider(label='音程変換', minimum=-24, maximum=24, step=1, value=0, info="半音単位の音程変換。F0条件付きモデル使用時にのみ有効です"),
|
| 760 |
]
|
| 761 |
|
| 762 |
+
examples = [["examples/source/yae_0.wav", "examples/reference/dingzhen_0.wav", 25, 1.0, 0.7, False, True, 0],
|
| 763 |
+
["examples/source/jay_0.wav", "examples/reference/azuma_0.wav", 25, 1.0, 0.7, True, True, 0],
|
| 764 |
+
["examples/source/Wiz Khalifa,Charlie Puth - See You Again [vocals]_[cut_28sec].wav",
|
| 765 |
+
"examples/reference/teio_0.wav", 100, 1.0, 0.7, True, False, 0],
|
| 766 |
+
["examples/source/TECHNOPOLIS - 2085 [vocals]_[cut_14sec].wav",
|
| 767 |
+
"examples/reference/trump_0.wav", 50, 1.0, 0.7, True, False, -12],
|
| 768 |
+
]
|
| 769 |
|
| 770 |
+
outputs = [gr.Audio(label="ストリーム出力音声", streaming=True, format='mp3'),
|
| 771 |
+
gr.Audio(label="完全出力音声", streaming=False, format='wav')]
|
|
|
|
| 772 |
|
| 773 |
+
with gr.Blocks() as interface:
|
| 774 |
+
gr.Interface(fn=voice_conversion, description=description, inputs=inputs, outputs=outputs, title="Seed Voice Conversion", examples=examples, cache_examples=False)
|
| 775 |
+
|
| 776 |
+
with gr.Row():
|
| 777 |
+
gallery = gr.Gallery(label="ギャラリー", show_label=True)
|
| 778 |
+
gallery.add([gallery_data["sikokumetan"]["webp"]])
|
| 779 |
+
|
| 780 |
+
gallery.select(update_reference, outputs=inputs[1])
|
| 781 |
+
|
| 782 |
+
interface.launch()
|