Upload folder using huggingface_hub (part 4)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +26 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_02.cosyvoice_request.json +25 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_02.wav +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_03.cosyvoice_request.json +25 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_03.wav +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_04.cosyvoice_request.json +25 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_04.wav +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_05.cosyvoice_request.json +25 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/intro_poem.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/intro_title_author.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_01.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_01_asset_02.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_02.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_02_asset_02.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_03.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_03_asset_02.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_04.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_04_asset_02.png +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/intro/intro_metadata.json +11 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/muxed/intro.mp4 +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/plan.json +99 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/plan_tagged.txt +15 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/concat_list.txt +2 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_poem.mp4 +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_silent.mp4 +3 -0
- outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_title_author.mp4 +0 -0
- outputs/previews/chusai_bernini_preview/preview_config.json +5 -0
- outputs/previews/chusai_full_current.mp4 +3 -0
- outputs/previews/chusai_segment1_scriptfirst_qwenwan/audio/segment_01.wav +3 -0
- outputs/previews/chusai_segment1_scriptfirst_qwenwan/images/segment_01.png +3 -0
- outputs/previews/chusai_segment1_scriptfirst_qwenwan/preview_status.json +14 -0
- outputs/previews/chusai_segment1_scriptfirst_qwenwan/videos/segment_01.wan_vace_usp_request.json +60 -0
- runtime/chusai_qwen_raw.txt +5 -0
- runtime/deployment.env +8 -0
- runtime/matcha-tts-0.0.7.2.tar.gz +3 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/LICENSE +21 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/MANIFEST.in +14 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/PKG-INFO +357 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/README.md +315 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/configs/__init__.py +1 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/VERSION +1 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/__init__.py +0 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/app.py +357 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/cli.py +419 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/data/__init__.py +0 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/data/components/__init__.py +0 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/data/text_mel_datamodule.py +274 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/hifigan/README.md +101 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/hifigan/__init__.py +0 -0
- runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/hifigan/config.py +28 -0
.gitattributes
CHANGED
|
@@ -464,3 +464,29 @@ outputs/poetry_teaching/poetry_full_10s_20260629_205814/videos/intro_poem.mp4 fi
|
|
| 464 |
outputs/poetry_teaching/poetry_full_10s_20260629_205814/videos/intro_silent.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 465 |
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/intro_background.wav filter=lfs diff=lfs merge=lfs -text
|
| 466 |
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_01.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
outputs/poetry_teaching/poetry_full_10s_20260629_205814/videos/intro_silent.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 465 |
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/intro_background.wav filter=lfs diff=lfs merge=lfs -text
|
| 466 |
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_01.wav filter=lfs diff=lfs merge=lfs -text
|
| 467 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_02.wav filter=lfs diff=lfs merge=lfs -text
|
| 468 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_03.wav filter=lfs diff=lfs merge=lfs -text
|
| 469 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_04.wav filter=lfs diff=lfs merge=lfs -text
|
| 470 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/intro_poem.png filter=lfs diff=lfs merge=lfs -text
|
| 471 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/intro_title_author.png filter=lfs diff=lfs merge=lfs -text
|
| 472 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_01.png filter=lfs diff=lfs merge=lfs -text
|
| 473 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_01_asset_02.png filter=lfs diff=lfs merge=lfs -text
|
| 474 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_02.png filter=lfs diff=lfs merge=lfs -text
|
| 475 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_02_asset_02.png filter=lfs diff=lfs merge=lfs -text
|
| 476 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_03.png filter=lfs diff=lfs merge=lfs -text
|
| 477 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_03_asset_02.png filter=lfs diff=lfs merge=lfs -text
|
| 478 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_04.png filter=lfs diff=lfs merge=lfs -text
|
| 479 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_04_asset_02.png filter=lfs diff=lfs merge=lfs -text
|
| 480 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/muxed/intro.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 481 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_poem.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 482 |
+
outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_silent.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 483 |
+
outputs/previews/chusai_full_current.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 484 |
+
outputs/previews/chusai_segment1_scriptfirst_qwenwan/audio/segment_01.wav filter=lfs diff=lfs merge=lfs -text
|
| 485 |
+
outputs/previews/chusai_segment1_scriptfirst_qwenwan/images/segment_01.png filter=lfs diff=lfs merge=lfs -text
|
| 486 |
+
runtime/smoke_cosyvoice_worker.wav filter=lfs diff=lfs merge=lfs -text
|
| 487 |
+
third_party/BindWeave/Megatron-LM/docs/source/images/context_parallel/CP_overview.png filter=lfs diff=lfs merge=lfs -text
|
| 488 |
+
third_party/BindWeave/Megatron-LM/docs/source/images/context_parallel/CP_results.png filter=lfs diff=lfs merge=lfs -text
|
| 489 |
+
third_party/BindWeave/Megatron-LM/examples/multimodal/assets/pretrain_curves.png filter=lfs diff=lfs merge=lfs -text
|
| 490 |
+
third_party/BindWeave/Megatron-LM/images/model_table.png filter=lfs diff=lfs merge=lfs -text
|
| 491 |
+
third_party/BindWeave/Megatron-LM/images/strong_scaling.png filter=lfs diff=lfs merge=lfs -text
|
| 492 |
+
third_party/BindWeave/Megatron-LM/images/weak_scaling.png filter=lfs diff=lfs merge=lfs -text
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_02.cosyvoice_request.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"segment": {
|
| 3 |
+
"index": 2,
|
| 4 |
+
"title": "磨洗辨认",
|
| 5 |
+
"story_beat": "发现",
|
| 6 |
+
"teaching_goal": "通过‘磨洗’动作,引导学生体会杜牧对历史遗物的珍视,理解‘认前朝’背后的岁月流逝与物是人非之感。",
|
| 7 |
+
"image_prompt": "人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 8 |
+
"video_prompt": "镜头推进至唐代文人剪影蹲下的动作,双手捧起断戟,用江水轻轻冲洗,锈迹随水流滑落,露出金属光泽,动作缓慢而庄重。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 9 |
+
"audio_text": "他蹲下身,用江水细细磨洗。锈迹一层层剥落,露出当年的锋芒。这一刻,他仿佛听见了战鼓声,看见了千军万马。这不仅是辨认一件古物,更是唤醒一段沉睡的历史。",
|
| 10 |
+
"duration": 12,
|
| 11 |
+
"image_prompts": [
|
| 12 |
+
"人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 13 |
+
"物象资产:断戟在手中被磨洗,锈迹逐渐脱落,露出部分金属纹理,光线聚焦在戟身,背景虚化。;VACE参���资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"output_path": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_02.wav",
|
| 17 |
+
"config": {
|
| 18 |
+
"vgen_root": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen",
|
| 19 |
+
"cosyvoice_model": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/CosyVoice3-0.5B-2512",
|
| 20 |
+
"cosyvoice_repo": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice",
|
| 21 |
+
"prompt_wav": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice/asset/龙小夏_24k.wav",
|
| 22 |
+
"prompt_text": "我们都能为您提供最贴心的服务,只需简单的语音指令即可轻松完成操作,让科技真正服务于生活",
|
| 23 |
+
"overwrite": true
|
| 24 |
+
}
|
| 25 |
+
}
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_02.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65e4e316c399537827a7cc0d173a018f588b5d143052eec4b1521b211595ec29
|
| 3 |
+
size 704684
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_03.cosyvoice_request.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"segment": {
|
| 3 |
+
"index": 3,
|
| 4 |
+
"title": "东风假想",
|
| 5 |
+
"story_beat": "转折",
|
| 6 |
+
"teaching_goal": "解析后两句的反面假想手法,让学生明白历史胜负的偶然性,理解‘东风’在战役中的关键作用。",
|
| 7 |
+
"image_prompt": "环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 8 |
+
"video_prompt": "镜头从文人剪影的凝视方向拉远,江面突然风起云涌,战船火光与烟雾在风中翻滚,东南风呼啸而过,画面色调由冷转暖,展现历史瞬间的爆发力。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 9 |
+
"audio_text": "如果那天没有东风相助,周瑜的火攻还能成功吗?杜牧的思绪飘向那个决定三国命运的瞬间。历史往往就系于一阵风,一次偶然,胜负便天翻地覆。",
|
| 10 |
+
"duration": 14,
|
| 11 |
+
"image_prompts": [
|
| 12 |
+
"环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 13 |
+
"人物资产:唐代文人剪影伫立江边,衣袂被风吹起,凝视远方江面,仿佛看到历史重现,剪影清晰,无面部细节。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"output_path": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_03.wav",
|
| 17 |
+
"config": {
|
| 18 |
+
"vgen_root": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen",
|
| 19 |
+
"cosyvoice_model": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/CosyVoice3-0.5B-2512",
|
| 20 |
+
"cosyvoice_repo": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice",
|
| 21 |
+
"prompt_wav": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice/asset/龙小夏_24k.wav",
|
| 22 |
+
"prompt_text": "我们都能为您提供最贴心的服务,只需简单的语音指令即可轻松完成操作,让科技真正服务于生活",
|
| 23 |
+
"overwrite": true
|
| 24 |
+
}
|
| 25 |
+
}
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_03.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:72d7d546425e6fff2dff96068e5d02ee1f67d6f094bc16f98c130ecfb6546d9c
|
| 3 |
+
size 618284
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_04.cosyvoice_request.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"segment": {
|
| 3 |
+
"index": 4,
|
| 4 |
+
"title": "铜雀深锁",
|
| 5 |
+
"story_beat": "回望",
|
| 6 |
+
"teaching_goal": "通过‘二乔被锁’的意象,具象化战争失败的后果,强化对国家存亡与社稷安危的深刻认知。",
|
| 7 |
+
"image_prompt": "环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 8 |
+
"video_prompt": "镜头切换至铜雀台远景,柳枝在风中摇曳,高墙内隐约可见女子身影被栏杆遮挡,春色深浓却无生机,镜头缓慢推进,强调‘锁’字的压抑感。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 9 |
+
"audio_text": "若无东风,曹操或许早已取胜,二乔将被锁进铜雀台深处。春色再美,也关不住亡国的哀愁。这假设背后,是对国家存亡的深切忧虑。",
|
| 10 |
+
"duration": 13,
|
| 11 |
+
"image_prompts": [
|
| 12 |
+
"环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 13 |
+
"物象+环境资产:铜雀台高墙内,隐约可见女子身影被栏杆遮挡,春色虽好却无生机,强调‘锁’字的沉重感。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头��动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"output_path": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_04.wav",
|
| 17 |
+
"config": {
|
| 18 |
+
"vgen_root": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen",
|
| 19 |
+
"cosyvoice_model": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/CosyVoice3-0.5B-2512",
|
| 20 |
+
"cosyvoice_repo": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice",
|
| 21 |
+
"prompt_wav": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice/asset/龙小夏_24k.wav",
|
| 22 |
+
"prompt_text": "我们都能为您提供最贴心的服务,只需简单的语音指令即可轻松完成操作,让科技真正服务于生活",
|
| 23 |
+
"overwrite": true
|
| 24 |
+
}
|
| 25 |
+
}
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_04.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2990b076d89387a3e65e12d4fbe345730b1d5e721803a48e4fc3f19fea8f2735
|
| 3 |
+
size 558764
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_05.cosyvoice_request.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"segment": {
|
| 3 |
+
"index": 5,
|
| 4 |
+
"title": "借古抒怀",
|
| 5 |
+
"story_beat": "点题",
|
| 6 |
+
"teaching_goal": "揭示杜牧借咏史事吐露胸中抑郁不平之气的深层意图,连接历史成败与个人命运。",
|
| 7 |
+
"image_prompt": "人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影孤寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 8 |
+
"video_prompt": "镜头回到文人剪影,他独自坐在岩石上,手中握着洗净的断戟,暮色四合,江水静静流淌,剪影在冷灰色调中显得格外孤寂,情绪深沉。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 9 |
+
"audio_text": "杜牧借这段历史,吐露自己胸中的郁结。他空有才华,却难遇明主,正如周瑜若无东风,纵有雄才也无处施展。历史的成败,映照出个人的无奈。",
|
| 10 |
+
"duration": 12,
|
| 11 |
+
"image_prompts": [
|
| 12 |
+
"人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影孤寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 13 |
+
"环境资产:江面平静,倒映着残阳与孤舟,远处山峦起伏,色调转为冷灰,象征历史的冷静审视。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资���、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"output_path": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/outputs/poetry_teaching/poetry_full_10s_20260629_212816/audio/segment_05.wav",
|
| 17 |
+
"config": {
|
| 18 |
+
"vgen_root": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen",
|
| 19 |
+
"cosyvoice_model": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/CosyVoice3-0.5B-2512",
|
| 20 |
+
"cosyvoice_repo": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice",
|
| 21 |
+
"prompt_wav": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/CosyVoice/asset/龙小夏_24k.wav",
|
| 22 |
+
"prompt_text": "我们都能为您提供最贴心的服务,只需简单的语音指令即可轻松完成操作,让科技真正服务于生活",
|
| 23 |
+
"overwrite": true
|
| 24 |
+
}
|
| 25 |
+
}
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/intro_poem.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/intro_title_author.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_01.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_01_asset_02.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_02.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_02_asset_02.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_03.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_03_asset_02.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_04.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/images/segment_04_asset_02.png
ADDED
|
Git LFS Details
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/intro/intro_metadata.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"title": "赤壁",
|
| 3 |
+
"author": "杜牧",
|
| 4 |
+
"dynasty": "唐",
|
| 5 |
+
"poem_text": "折戟沉沙铁未销,自将磨洗认前朝。\n东风不与周郎便,铜雀春深锁二乔。",
|
| 6 |
+
"background": "这首诗是诗人经过赤壁(今湖北省武昌县西南赤矶山)这个著名的古战场,有感于三国时代的英雄成败而写下的。发生于汉献帝建安十三年(208年)十月的赤壁之战,是对三国鼎立的历史形势起着决定性作用的一次重大战役。其结果是孙、刘联军击败了曹军,而三十四岁的孙吴军统帅周瑜,乃是这次战役中的头号风云人物。诗人观赏了古战场的遗物,对赤壁之战发表了独特的看法,有感而作。",
|
| 7 |
+
"audio_text": "同学你好,今天我们要走近的是杜牧写的《赤壁》。这首诗是诗人经过赤壁(今湖北省武昌县西南赤矶山)这个著名的古战场,有感于三国时代的英雄成败而写下的。发生于汉献帝建安十三年(208年)十月的赤壁之战,是对三国鼎立的历史形势起着决定性作用的一次重大战役。其结果是孙、刘联军击败了曹军,而三十四岁的孙吴军统帅周瑜,乃是这次战役中的头号风云人物。诗人观赏了古战场的遗物,对赤壁之战发表了独特的看法,有感而作。",
|
| 8 |
+
"title_seconds": 3,
|
| 9 |
+
"poem_seconds": 37,
|
| 10 |
+
"audio_seconds": 39.04
|
| 11 |
+
}
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/muxed/intro.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c09c45be03afe0ddfe58a8642ce26cbb75689f92a07e79bf8a172a8ccf61d016
|
| 3 |
+
size 685742
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/plan.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"poem_title": "赤壁",
|
| 3 |
+
"author": "杜牧",
|
| 4 |
+
"narrative_mode": "怀古",
|
| 5 |
+
"storyline": "从江边拾得断戟的微小瞬间切入,通过磨洗辨认引发对赤壁之战的历史回溯,进而展开‘若无东风’的假设性推演,最后回归现实,点出杜牧借史事抒发个人壮志难酬的郁结。",
|
| 6 |
+
"recurring_character_style": "唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。",
|
| 7 |
+
"appreciation": "这首诗属于怀古诗,核心在于“即物感兴”与“反面假想”。杜牧经过赤壁古战场,从泥沙中拾得一枚未锈尽的断戟,这一微小物象瞬间打通了现实与历史的通道。前两句写“发现”,后两句写“联想”。教学主线不应是逐句翻译,而应沿着“拾物—磨洗—联想—反讽—感慨”的心理与空间线索推进:从眼前残破的兵器,推演到当年决定三国格局的赤壁之战,再假设若无东风相助的另一种历史结局,最后落脚于杜牧借古讽今、抒发怀才不遇的深沉感慨。视觉风格需保持唐代写实质感,强调历史沧桑感与人物剪影的含蓄,避免现代元素与卡通化。核心情绪是苍凉中带着锐利的历史洞察,声音设计需配合从静谧的江边到宏大的历史想象再回归现实的层次变化。",
|
| 8 |
+
"plan4teach": "{\"poem_title\":\"赤壁\",\"author\":\"杜牧\",\"narrative_mode\":\"怀古\",\"storyline\":\"从江边拾得断戟的微小瞬间切入,通过磨洗辨认引发对赤壁之战的历史回溯,进而展开‘若无东风’的假设性推演,最后回归现实,点出杜牧借史事抒发个人壮志难酬的郁结。\",\"recurring_character_style\":\"唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。\",\"segments\":[{\"index\":1,\"title\":\"江岸拾遗\",\"story_beat\":\"处境\",\"teaching_goal\":\"结合创作背景,让学生理解杜牧身处赤壁古战场的具体情境,通过‘折戟’这一物象建立现实与历史的连接。\",\"duration\":10},{\"index\":2,\"title\":\"磨洗辨认\",\"story_beat\":\"发现\",\"teaching_goal\":\"通过‘磨洗’动作,引导学生体会诗人对历史遗物的珍视,理解‘认前朝’背后的岁月流逝与物是人非之感。\",\"duration\":12},{\"index\":3,\"title\":\"东风假想\",\"story_beat\":\"转折\",\"teaching_goal\":\"解析后两句的反面假想手法,让学生明白历史胜负的偶然性,理解‘东风’在战役中的关键作用。\",\"duration\":14},{\"index\":4,\"title\":\"铜雀深锁\",\"story_beat\":\"回望\",\"teaching_goal\":\"通过‘二乔被锁’的意象,具象化战争失败的后果,强化对国家存亡与社稷安危的深刻认知。\",\"duration\":13},{\"index\":5,\"title\":\"借古抒怀\",\"story_beat\":\"点题\",\"teaching_goal\":\"揭示杜牧借咏史事吐露胸中抑郁不平之气的深层意图,连接历史成败与个人命运。\",\"duration\":12},{\"index\":6,\"title\":\"余音绕梁\",\"story_beat\":\"收束\",\"teaching_goal\":\"总结全诗‘即物感兴’与‘反面假想’的写法妙处,自然带出杜牧作为唐代诗人的身份,完成教学闭环。\",\"duration\":11}]}",
|
| 9 |
+
"plan4img": "{\"segments\":[{\"index\":1,\"image_prompts\":[\"环境资产:长江赤壁古战场江岸,黄昏时分,江面雾气弥漫,泥沙中半埋着一枚锈蚀的古代断戟,光线昏黄,色调苍凉,写实风格,无文字。\",\"物象+环境资产:特写一枚折断的古代铁戟,表面覆盖泥沙与锈迹,但刃口处隐约可见金属光泽,背景为模糊的江岸芦苇,强调历史沧桑感。\"]},{\"index\":2,\"image_prompts\":[\"人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。\",\"物象资产:断戟在手中被磨洗,锈迹逐渐脱落,露出部分金属纹理,光线聚焦在戟身,背景虚化。\"]},{\"index\":3,\"image_prompts\":[\"环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。\",\"人物资产:唐代文人剪影伫立江边,衣袂被风吹起,凝视远方江面,仿佛看到历史重现,剪影清晰,无面部细节。\"]},{\"index\":4,\"image_prompts\":[\"环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。\",\"物象+环境资产:铜雀台高墙内,隐约可见女子身影被栏杆遮挡,春色虽好却无生机,强调‘锁’字的沉重感。\"]},{\"index\":5,\"image_prompts\":[\"人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影��寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。\",\"环境资产:江面平静,倒映着残阳与孤舟,远处山峦起伏,色调转为冷灰,象征历史的冷静审视。\"]},{\"index\":6,\"image_prompts\":[\"人物资产:唐代文人剪影(与之前一致),站在江边回望,手中断戟已收起,身形融入暮色,只留一个坚定的轮廓,象征思考后的释然。\",\"环境资产:赤壁江岸全景,夕阳西下,江水东流,断戟已不见,只余自然景色,寓意历史归于平静。\"]}]}",
|
| 10 |
+
"plan4video": "{\"segments\":[{\"index\":1,\"video_prompt\":\"镜头从江面雾气缓缓下移,聚焦于泥沙中半埋的断戟,微风吹动芦苇,断戟表面锈迹在昏黄光线下闪烁,营造历史沉睡的氛围。\"},{\"index\":2,\"video_prompt\":\"镜头推进至唐代文人剪影蹲下的动作,双手捧起断戟,用江水轻轻冲洗,锈迹随水流滑落,露出金属光泽,动作缓慢而庄重。\"},{\"index\":3,\"video_prompt\":\"镜头从文人剪影的凝视方向拉远,江面突然风起云涌,战船火光与烟雾在风中翻滚,东南风呼啸而过,画面色调由冷转暖,展现历史瞬间的爆发力。\"},{\"index\":4,\"video_prompt\":\"镜头切换至铜雀台远景,柳枝在风中摇曳,高墙内隐约可见女子身影被栏杆遮挡,春色深浓却无生机,镜头缓慢推进,强调‘锁’字的压抑感。\"},{\"index\":5,\"video_prompt\":\"镜头回到文人剪影,他独自坐在岩石上,手中握着洗净的断戟,暮色四合,江水静静流淌,剪影在冷灰色调中显得格外孤寂,情绪深沉。\"},{\"index\":6,\"video_prompt\":\"镜头从文人剪影的背影缓缓拉远,他转身融入暮色,手中断戟已收起,江面平静,夕阳西下,江水东流,历史归于平静,画面渐暗。\"}]}",
|
| 11 |
+
"plan4audio": "{\"segments\":[{\"index\":1,\"audio_text\":\"杜牧站在赤壁的江岸边,脚下是千年的泥沙。他忽然发现,半埋着的断戟还在,铁锈虽厚,却未完全销蚀。这枚小小的兵器,成了连接他与三国风云的钥匙。\"},{\"index\":2,\"audio_text\":\"他蹲下身,用江水细细磨洗。锈迹一层层剥落,露出当年的锋芒。这一刻,他仿佛听见了战鼓声,看见了千军万马。这不仅是辨认一件古物,更是唤醒一段沉睡的历史。\"},{\"index\":3,\"audio_text\":\"如果那天没有东风相助,周瑜的火攻还能成功吗?杜牧的思绪飘向那个决定三国命运的瞬间。历史往往就系于一阵风,一次偶然,胜负便天翻地覆。\"},{\"index\":4,\"audio_text\":\"若无东风,曹操或许早已取胜,二乔将被锁进铜雀台深处。春色再美,也关不住亡国的哀愁。这假设背后,是对国家存亡的深切忧虑。\"},{\"index\":5,\"audio_text\":\"杜牧借这段历史,吐露自己胸中的郁结。他空有才华,却难遇明主,正如周瑜若无东风,纵有雄才也无处施展。历史的成败,映照出个人的无奈。\"},{\"index\":6,\"audio_text\":\"读到这里,要记住:杜牧不是单纯怀古,而是借物抒怀。他通过一枚断戟,把历史的偶然与个人的命运紧紧相连。杜牧,唐代诗人,以咏史见长,字字皆含深意。\"}]}",
|
| 12 |
+
"segments": [
|
| 13 |
+
{
|
| 14 |
+
"index": 1,
|
| 15 |
+
"title": "江岸拾遗",
|
| 16 |
+
"story_beat": "处境",
|
| 17 |
+
"teaching_goal": "结合创作背景,让学生理解杜牧身处赤壁古战场的具体情境,通过‘折戟’这一物象建立现实与历史的连接。",
|
| 18 |
+
"image_prompt": "环境资产:长江赤壁古战场江岸,黄昏时分,江面雾气弥漫,泥沙中半埋着一枚锈蚀的古代断戟,光线昏黄,色调苍凉,写实风格,无文字。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;���画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 19 |
+
"video_prompt": "镜头从江面雾气缓缓下移,聚焦于泥沙中半埋的断戟,微风吹动芦苇,断戟表面锈迹在昏黄光线下闪烁,营造历史沉睡的氛围。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 20 |
+
"audio_text": "杜牧站在赤壁的江岸边,脚下是千年的泥沙。他忽然发现,半埋着的断戟还在,铁锈虽厚,却未完全销蚀。这枚小小的兵器,成了连接他与三国风云的钥匙。",
|
| 21 |
+
"duration": 10,
|
| 22 |
+
"image_prompts": [
|
| 23 |
+
"环境资产:长江赤壁古战场江岸,黄昏时分,江面雾气弥漫,泥沙中半埋着一枚锈蚀的古代断戟,光线昏黄,色调苍凉,写实风格,无文字。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 24 |
+
"物象+环境资产:特写一枚折断的古代铁戟,表面覆盖泥沙与锈迹,但刃口处隐约可见金属光泽,背景为模糊的江岸芦苇,强调历史沧桑感。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"index": 2,
|
| 29 |
+
"title": "磨洗辨认",
|
| 30 |
+
"story_beat": "发现",
|
| 31 |
+
"teaching_goal": "通过‘磨洗’动作,引导学生体会杜牧对历史遗物的珍视,理解‘认前朝’背后的岁月���逝与物是人非之感。",
|
| 32 |
+
"image_prompt": "人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 33 |
+
"video_prompt": "镜头推进至唐代文人剪影蹲下的动作,双手捧起断戟,用江水轻轻冲洗,锈迹随水流滑落,露出金属光泽,动作缓慢而庄重。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 34 |
+
"audio_text": "他蹲下身,用江水细细磨洗。锈迹一层层剥落,露出当年的锋芒。这一刻,他仿佛听见了战鼓声,看见了千军万马。这不仅是辨认一件古物,更是唤醒一段沉睡的历史。",
|
| 35 |
+
"duration": 12,
|
| 36 |
+
"image_prompts": [
|
| 37 |
+
"人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 38 |
+
"物象资产:断戟在手中被磨洗,锈迹逐渐脱落,露出部分金属纹理,光线聚焦在戟身,背景虚化。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 39 |
+
]
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"index": 3,
|
| 43 |
+
"title": "东风假想",
|
| 44 |
+
"story_beat": "转折",
|
| 45 |
+
"teaching_goal": "解析后两句的反面假想手法,让学生明白历史胜负的偶然性,理解‘东风’在战役中的关键作用。",
|
| 46 |
+
"image_prompt": "环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 47 |
+
"video_prompt": "镜头从文人剪影的凝视方向拉远,江面突然风起云涌,战船火光与烟雾在风中翻滚,东南风呼啸而过,画面色调由冷转暖,展现历史瞬间的爆发力。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 48 |
+
"audio_text": "如果那天没有东风相助,周瑜的火攻还能成功吗?杜牧的思绪飘向那个决定三国命运的瞬间。历史往往就系于一阵风,一次偶然,胜负便天翻地覆。",
|
| 49 |
+
"duration": 14,
|
| 50 |
+
"image_prompts": [
|
| 51 |
+
"环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源���优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 52 |
+
"人物资产:唐代文人剪影伫立江边,衣袂被风吹起,凝视远方江面,仿佛看到历史重现,剪影清晰,无面部细节。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"index": 4,
|
| 57 |
+
"title": "铜雀深锁",
|
| 58 |
+
"story_beat": "回望",
|
| 59 |
+
"teaching_goal": "通过‘二乔被锁’的意象,具象化战争失败的后果,强化对国家存亡与社稷安危的深刻认知。",
|
| 60 |
+
"image_prompt": "环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 61 |
+
"video_prompt": "镜头切换至铜雀台远景,柳枝在风中摇曳,高墙内隐约可见女子身影被栏杆遮挡,春色深浓却无生机,镜头缓慢推进,强调‘锁’字的压抑感。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 62 |
+
"audio_text": "若无东风,曹操或许早已取胜,二乔将被锁进铜雀台深处。春色再美,也关不住亡国的哀愁。这假设背后,是对国家存亡的深切忧虑。",
|
| 63 |
+
"duration": 13,
|
| 64 |
+
"image_prompts": [
|
| 65 |
+
"环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 66 |
+
"物象+环境资产:铜雀台高墙内,隐约可见女子身影被栏杆遮挡,春色虽好却无生机,强调‘锁’字的沉重感。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 67 |
+
]
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"index": 5,
|
| 71 |
+
"title": "借古抒怀",
|
| 72 |
+
"story_beat": "点题",
|
| 73 |
+
"teaching_goal": "揭示杜牧借咏史事吐露胸中抑郁不平之气的深层意图,连接历史成败与个人命运。",
|
| 74 |
+
"image_prompt": "人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影孤寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时���要强行加人",
|
| 75 |
+
"video_prompt": "镜头回到文人剪影,他独自坐在岩石上,手中握着洗净的断戟,暮色四合,江水静静流淌,剪影在冷灰色调中显得格外孤寂,情绪深沉。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 76 |
+
"audio_text": "杜牧借这段历史,吐露自己胸中的郁结。他空有才华,却难遇明主,正如周瑜若无东风,纵有雄才也无处施展。历史的成败,映照出个人的无奈。",
|
| 77 |
+
"duration": 12,
|
| 78 |
+
"image_prompts": [
|
| 79 |
+
"人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影孤寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 80 |
+
"环境资产:江面平静,倒映着残阳与孤舟,远处山峦起伏,色调转为冷灰,象征历史的冷静审视。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 81 |
+
]
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"index": 6,
|
| 85 |
+
"title": "余音绕梁",
|
| 86 |
+
"story_beat": "收束",
|
| 87 |
+
"teaching_goal": "总结全诗‘即物感兴’与‘反面假想’的写法妙处,自然带出杜牧作为唐代诗人的身份,完成教学闭环。",
|
| 88 |
+
"image_prompt": "人物资产:唐代文人剪影(与之前一致),站在江边回望,手中断戟已收起,身形融入暮色,只留一个坚定的轮廓,象征思考后的释然。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 89 |
+
"video_prompt": "镜头从文人剪影的背影缓缓拉远,他转身融入暮色,手中断戟已收起,江面平静,夕阳西下,江水东流,历史归于平静,画面渐暗。;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 90 |
+
"audio_text": "读到这里,要记住:杜牧不是单纯怀古,而是借物抒怀。他通过一枚断戟,把历史的偶然与个人的命运紧紧相连。杜牧,唐代诗人,以咏史见长,字字皆含深意。",
|
| 91 |
+
"duration": 11,
|
| 92 |
+
"image_prompts": [
|
| 93 |
+
"人物资产:唐代文人剪影(与之前一致),站在江边回望,手中断戟已收起,身形融入暮色,只留一个坚定的轮廓,象征思考后的释然。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定、轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人",
|
| 94 |
+
"环境资产:赤壁江岸全景,夕阳西下,江水东流,断戟已不见,只余自然景色,寓意历史归于平静。;VACE参考资产图,不是最终视频截图或PPT插图;必须先选择一个资产类型:人物资产、环境资产、物象/器物资产、人物+环境资产或物象+环境资产;资产选择优先级:旁白核心是人物处境、动作或心理时优先人物资产或人物+环境资产;核心是地点、季节、天气、空间和氛围时优先环境资产;核心是诗中物象、器物或声音来源时优先物象/器物资产或物象+环境资产;每段只锁定一个最重要的视觉锚点,构图稳定��轮廓明确、景深自然、留有少量环境边界,便于后续视频模型保持参考一致性;禁止文字、标题、诗句、字幕、分镜编号、拼贴、多宫格、海报排版、镜头运动文字说明;中国古代写实历史教育短片风格;服饰、发式、建筑、器物、船只、灯具、道路、环境都必须符合中国古代语境;禁止现代服装、现代建筑、现代交通工具、电线、路灯、玻璃幕墙、塑料制品、现代文字标识;同一人物形象必须保持一致:唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。;如画面出现人物,人物必须为中国古代人物剪影、背影剪影或侧影剪影;不露正脸,无清晰五官,不得出现现代写真感或清晰肖像;没有人物需求时不要强行加人"
|
| 95 |
+
]
|
| 96 |
+
}
|
| 97 |
+
],
|
| 98 |
+
"raw_response": "<analysis>\n这首诗属于怀古诗,核心在于“即物感兴”与“反面假想”。杜牧经过赤壁古战场,从泥沙中拾得一枚未锈尽的断戟,这一微小物象瞬间打通了现实与历史的通道。前两句写“发现”,后两句写“联想”。教学主线不应是逐句翻译,而应沿着“拾物—磨洗—联想—反讽—感慨”的心理与空间线索推进:从眼前残破的兵器,推演到当年决定三国格局的赤壁之战,再假设若无东风相助的另一种历史结局,最后落脚于杜牧借古讽今、抒发怀才不遇的深沉感慨。视觉风格需保持唐代写实质感,强调历史沧桑感与人物剪影的含蓄,避免现代元素与卡通化。核心情绪是苍凉中带着锐利的历史洞察,声音设计需配合从静谧的江边到宏大的历史想象再回归现实的层次变化。\n</analysis>\n<plan4teach>\n{\"poem_title\":\"赤壁\",\"author\":\"杜牧\",\"narrative_mode\":\"怀古\",\"storyline\":\"从江边拾得断戟的微小瞬间切入,通过磨洗辨认引发对赤壁之战的历史回溯,进而展开‘若无东风’的假设性推演,最后回归现实,点出杜牧借史事抒发个人壮志难酬的郁结。\",\"recurring_character_style\":\"唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。\",\"segments\":[{\"index\":1,\"title\":\"江岸拾遗\",\"story_beat\":\"处境\",\"teaching_goal\":\"结合创作背景,让学生理解杜牧身处赤壁古战场的具体情境,通过‘折戟’这一物象建立现实与历史的连接。\",\"duration\":10},{\"index\":2,\"title\":\"磨洗辨认\",\"story_beat\":\"发现\",\"teaching_goal\":\"通过‘磨洗’动作,引导学生体会诗人对历史遗物的珍视,理解‘认前朝’背后的岁月流逝与物是人非之感。\",\"duration\":12},{\"index\":3,\"title\":\"东风假想\",\"story_beat\":\"转折\",\"teaching_goal\":\"解析后两句的反面假想手法,让学生明白历史胜负的偶然性,理解‘东风’在战役中的关键作用。\",\"duration\":14},{\"index\":4,\"title\":\"铜雀深锁\",\"story_beat\":\"回望\",\"teaching_goal\":\"通过‘二乔被锁’的意象,具象化战争失败的后果,强化对国家存亡与社稷安危的深刻认知。\",\"duration\":13},{\"index\":5,\"title\":\"借古抒怀\",\"story_beat\":\"点题\",\"teaching_goal\":\"揭示杜牧借咏史事吐露胸中抑郁不平之气的深层意图,连接历史成败与个人命运。\",\"duration\":12},{\"index\":6,\"title\":\"余音绕梁\",\"story_beat\":\"收束\",\"teaching_goal\":\"总结全诗‘即物感兴’与‘反面假想’的写法妙处,自然带出杜牧作为唐代诗人的身份,完成教学闭环。\",\"duration\":11}]}\n</plan4teach>\n<plan4img>\n{\"segments\":[{\"index\":1,\"image_prompts\":[\"环境资产:长江赤壁古战场江岸,黄昏时分,江面雾气弥漫,泥沙中半埋着一枚锈蚀的古代断戟,光线昏黄,色调苍凉,写实风格,无文字。\",\"物象+环境资产:特写一枚折断的古代铁戟,表面覆盖泥沙与锈迹,但刃口处隐约可见金属光泽,背景为模糊的江岸芦苇,强调历史沧桑感。\"]},{\"index\":2,\"image_prompts\":[\"人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。\",\"物象资产:断戟在手中被磨洗,锈迹逐渐脱落,露出部分金属纹理,光线聚焦在戟身,背景虚化。\"]},{\"index\":3,\"image_prompts\":[\"环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。\",\"人物资产:唐代文人剪影伫立江边,衣袂被风吹起,凝视远方江面,仿佛看到历史重现,剪影清晰,无面部细节。\"]},{\"index\":4,\"image_prompts\":[\"环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。\",\"物象+环境资产:铜雀台高墙内,隐约可见女子身影被栏杆遮挡,春色虽好却无生机,强调‘锁’字的沉重感。\"]},{\"index\":5,\"image_prompts\":[\"人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影孤寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。\",\"环境资产:江面平静,倒映着残阳与孤舟,远处山峦起伏,色调转为冷灰,象征历史的冷静审视。\"]},{\"index\":6,\"image_prompts\":[\"人物资产:唐代文人剪影(与之前一致),站在江边回望,手中断戟已收起,身形融入暮色,只留一个坚定的轮廓,象征思考后的释然。\",\"环境资产:赤壁江岸全景,夕阳西下,江水东流,断戟已不见,只余自然景色,寓意历史归于平静。\"]}]}\n</plan4img>\n<plan4video>\n{\"segments\":[{\"index\":1,\"video_prompt\":\"镜头从江面雾气缓缓下移,聚焦于泥沙中半埋的断戟,微风吹动芦苇,断戟表面锈迹在昏黄光线下闪烁,营造历史沉睡的氛围。\"},{\"index\":2,\"video_prompt\":\"镜头推进至唐代文人剪影蹲下的动作,双手捧起断戟,用江水轻轻冲洗,锈迹随水流滑落,露出金属光泽,动作缓慢而庄重。\"},{\"index\":3,\"video_prompt\":\"镜头从文人剪影的凝视方向拉远,江面突然风起云涌,战船火光与烟雾在风中翻滚,东南风呼啸而过,画面色调由冷转暖,展现历史瞬间的爆发力。\"},{\"index\":4,\"video_prompt\":\"镜头切换至铜雀台远景,柳枝在风中摇曳,高墙内隐约可见女子身影被栏杆遮挡,春色深浓却无生机,镜头缓慢推进,强调‘锁’字的压抑感。\"},{\"index\":5,\"video_prompt\":\"镜头回到文人剪影,他独自坐在岩石上,手中握着洗净的断戟,暮色四合,江水静静流淌,剪影在冷灰色调中显得格外孤寂,情绪深沉。\"},{\"index\":6,\"video_prompt\":\"镜头从文人剪影的背影缓缓拉远,他转身融入暮色,手中断戟已收起,江面平静,夕阳西下,江水东流,历史归于平静,画面渐暗。\"}]}\n</plan4video>\n<plan4audio>\n{\"segments\":[{\"index\":1,\"audio_text\":\"杜牧站在赤壁的江岸边,脚下是千年的泥沙。他忽然发现,半埋着的断戟还在,铁锈虽厚,却未完全销蚀。这枚小小的兵器,成了连接他与三国风云的钥匙。\"},{\"index\":2,\"audio_text\":\"他蹲下身,用江水细细磨洗。锈迹一层层剥落,露出当年的锋芒。这一刻,他仿佛听见了战鼓声,看见了千军万马。这不仅是辨认一件古物,更是唤醒一段沉睡的历史。\"},{\"index\":3,\"audio_text\":\"如果那天没有东风相助,周瑜的火攻还能成功吗?杜牧的思绪飘向那个决定三国命运的瞬间。历史往往就系于一阵风,一次偶然,胜负便天翻地覆。\"},{\"index\":4,\"audio_text\":\"若无东风,曹操或许早已取胜,二乔将被锁进铜雀台深处。春色再美,也关不住亡国的哀愁。这假设背后,是对国家存亡的深切忧虑。\"},{\"index\":5,\"audio_text\":\"杜牧借这段历史,吐露自己胸中的郁结。他空有才华,却难遇明主,正如周瑜若无东风,纵有雄才也无处施展。历史的成败,映照出个人的无奈。\"},{\"index\":6,\"audio_text\":\"读到这里,要记住:杜牧不是单纯怀古,而是借物抒怀。他通过一枚断戟,把历史的偶然与个人的命运紧紧相连。杜牧,唐代诗人,以咏史见长,字字皆含深意。\"}]}\n</plan4audio>"
|
| 99 |
+
}
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/plan_tagged.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<analysis>
|
| 2 |
+
这首诗属于怀古诗,核心在于“即物感兴”与“反面假想”。杜牧经过赤壁古战场,从泥沙中拾得一枚未锈尽的断戟,这一微小物象瞬间打通了现实与历史的通道。前两句写“发现”,后两句写“联想”。教学主线不应是逐句翻译,而应沿着“拾物—磨洗—联想—反讽—感慨”的心理与空间线索推进:从眼前残破的兵器,推演到当年决定三国格局的赤壁之战,再假设若无东风相助的另一种历史结局,最后落脚于杜牧借古讽今、抒发怀才不遇的深沉感慨。视觉风格需保持唐代写实质感,强调历史沧桑感与人物剪影的含蓄,避免现代元素与卡通化。核心情绪是苍凉中带着锐利的历史洞察,声音设计需配合从静谧的江边到宏大的历史想象再回归现实的层次变化。
|
| 3 |
+
</analysis>
|
| 4 |
+
<plan4teach>
|
| 5 |
+
{"poem_title":"赤壁","author":"杜牧","narrative_mode":"怀古","storyline":"从江边拾得断戟的微小瞬间切入,通过磨洗辨认引发对赤壁之战的历史回溯,进而展开‘若无东风’的假设性推演,最后回归现实,点出杜牧借史事抒发个人壮志难酬的郁结。","recurring_character_style":"唐代文人剪影:身着深色宽袖长袍,头戴软脚幞头,身形清瘦,以背影或侧影呈现,常处于江岸或古战场遗迹旁,被雾气或芦苇半遮挡。","segments":[{"index":1,"title":"江岸拾遗","story_beat":"处境","teaching_goal":"结合创作背景,让学生理解杜牧身处赤壁古战场的具体情境,通过‘折戟’这一物象建立现实与历史的连接。","duration":10},{"index":2,"title":"磨洗辨认","story_beat":"发现","teaching_goal":"通过‘磨洗’动作,引导学生体会诗人对历史遗物的珍视,理解‘认前朝’背后的岁月流逝与物是人非之感。","duration":12},{"index":3,"title":"东风假想","story_beat":"转折","teaching_goal":"解析后两句的反面假想手法,让学生明白历史胜负的偶然性,理解‘东风’在战役中的关键作用。","duration":14},{"index":4,"title":"铜雀深锁","story_beat":"回望","teaching_goal":"通过‘二乔被锁’的意象,具象化战争失败的后果,强化对国家存亡与社稷安危的深刻认知。","duration":13},{"index":5,"title":"借古抒怀","story_beat":"点题","teaching_goal":"揭示杜牧借咏史事吐露胸中抑郁不平之气的深层意图,连接历史成败与个人命运。","duration":12},{"index":6,"title":"余音绕梁","story_beat":"收束","teaching_goal":"总结全诗‘即物感兴’与‘反面假想’的写法妙处,自然带出杜牧作为唐代诗人的身份,完成教学闭环。","duration":11}]}
|
| 6 |
+
</plan4teach>
|
| 7 |
+
<plan4img>
|
| 8 |
+
{"segments":[{"index":1,"image_prompts":["环境资产:长江赤壁古战场江岸,黄昏时分,江面雾气弥漫,泥沙中半埋着一枚锈蚀的古代断戟,光线昏黄,色调苍凉,写实风格,无文字。","物象+环境资产:特写一枚折断的古代铁戟,表面覆盖泥沙与锈迹,但刃口处隐约可见金属光泽,背景为模糊的江岸芦苇,强调历史沧桑感。"]},{"index":2,"image_prompts":["人物+环境资产:唐代文人剪影(深色长袍,幞头),蹲在江岸边,双手正用江水清洗一枚断戟,侧影被夕阳拉长,周围是枯黄的芦苇,氛围静谧。","物象资产:断戟在手中被磨洗,锈迹逐渐脱落,露出部分金属纹理,光线聚焦在戟身,背景虚化。"]},{"index":3,"image_prompts":["环境资产:赤壁江面,狂风大作,东南风呼啸,江面上隐约可见战船的火光与烟雾,色调由冷转暖,充满动感与张力,写实历史风格。","人物资产:唐代文人剪影伫立江边,衣袂被风吹起,凝视远方江面,仿佛看到历史重现,剪影清晰,无面部细节。"]},{"index":4,"image_prompts":["环境资产:铜雀台远景,深春时节,楼台高耸,飞檐斗拱,周围柳色深浓,气氛幽深压抑,色调偏暗绿与灰,暗示囚禁与失落。","物象+环境资产:铜雀台高墙内,隐约可见女子身影被栏杆遮挡,春色虽好却无生机,强调‘锁’字的沉重感。"]},{"index":5,"image_prompts":["人物+环境资产:唐代文人剪影独自坐在江岸岩石上,背影孤寂,面前是滔滔江水,手中握着洗净的断戟,暮色四合,情绪深沉。","环境资产:江面平静,倒映着残阳与孤舟,远处山峦起伏,色调转为冷灰,象征历史的冷静审视。"]},{"index":6,"image_prompts":["人物资产:唐代文人剪影(与之前一致),站在江边回望,手中断戟已收起,身形融入暮色,只留一个坚定的轮廓,象征思考后的释然。","环境资产:赤壁江岸全景,夕阳西下,江水东流,断戟已不见,只余自然景色,寓意历史归于平静。"]}]}
|
| 9 |
+
</plan4img>
|
| 10 |
+
<plan4video>
|
| 11 |
+
{"segments":[{"index":1,"video_prompt":"镜头从江面雾气缓缓下移,聚焦于泥沙���半埋的断戟,微风吹动芦苇,断戟表面锈迹在昏黄光线下闪烁,营造历史沉睡的氛围。"},{"index":2,"video_prompt":"镜头推进至唐代文人剪影蹲下的动作,双手捧起断戟,用江水轻轻冲洗,锈迹随水流滑落,露出金属光泽,动作缓慢而庄重。"},{"index":3,"video_prompt":"镜头从文人剪影的凝视方向拉远,江面突然风起云涌,战船火光与烟雾在风中翻滚,东南风呼啸而过,画面色调由冷转暖,展现历史瞬间的爆发力。"},{"index":4,"video_prompt":"镜头切换至铜雀台远景,柳枝在风中摇曳,高墙内隐约可见女子身影被栏杆遮挡,春色深浓却无生机,镜头缓慢推进,强调‘锁’字的压抑感。"},{"index":5,"video_prompt":"镜头回到文人剪影,他独自坐在岩石上,手中握着洗净的断戟,暮色四合,江水静静流淌,剪影在冷灰色调中显得格外孤寂,情绪深沉。"},{"index":6,"video_prompt":"镜头从文人剪影的背影缓缓拉远,他转身融入暮色,手中断戟已收起,江面平静,夕阳西下,江水东流,历史归于平静,画面渐暗。"}]}
|
| 12 |
+
</plan4video>
|
| 13 |
+
<plan4audio>
|
| 14 |
+
{"segments":[{"index":1,"audio_text":"杜牧站在赤壁的江岸边,脚下是千年的泥沙。他忽然发现,半埋着的断戟还在,铁锈虽厚,却未完全销蚀。这枚小小的兵器,成了连接他与三国风云的钥匙。"},{"index":2,"audio_text":"他蹲下身,用江水细细磨洗。锈迹一层层剥落,露出当年的锋芒。这一刻,他仿佛听见了战鼓声,看见了千军万马。这不仅是辨认一件古物,更是唤醒一段沉睡的历史。"},{"index":3,"audio_text":"如果那天没有东风相助,周瑜的火攻还能成功吗?杜牧的思绪飘向那个决定三国命运的瞬间。历史往往就系于一阵风,一次偶然,胜负便天翻地覆。"},{"index":4,"audio_text":"若无东风,曹操或许早已取胜,二乔将被锁进铜雀台深处。春色再美,也关不住亡国的哀愁。这假设背后,是对国家存亡的深切忧虑。"},{"index":5,"audio_text":"杜牧借这段历史,吐露自己胸中的郁结。他空有才华,却难遇明主,正如周瑜若无东风,纵有雄才也无处施展。历史的成败,映照出个人的无奈。"},{"index":6,"audio_text":"读到这里,要记住:杜牧不是单纯怀古,而是借物抒怀。他通过一枚断戟,把历史的偶然与个人的命运紧紧相连。杜牧,唐代诗人,以咏史见长,字字皆含深意。"}]}
|
| 15 |
+
</plan4audio>
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/concat_list.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
file '/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_title_author.mp4'
|
| 2 |
+
file '/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_poem.mp4'
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_poem.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d99b35c6bd5c2115dc6d9621bb09fd9ed4b5c6c2347c06cac4bb5288eca6238
|
| 3 |
+
size 265070
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_silent.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8935a56855472b0be77207b543e8da7bdedfada3107bf24bcd9fab37df7f175
|
| 3 |
+
size 304969
|
outputs/poetry_teaching/poetry_full_10s_20260629_212816/videos/intro_title_author.mp4
ADDED
|
Binary file (40.6 kB). View file
|
|
|
outputs/previews/chusai_bernini_preview/preview_config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_backend": "bernini_t2i",
|
| 3 |
+
"video_backend": "wan_vace",
|
| 4 |
+
"poem": "出塞\n王昌龄\n秦时明月汉时关,万里长征人未还。\n但使龙城飞将在,不教胡马度阴山。"
|
| 5 |
+
}
|
outputs/previews/chusai_full_current.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:300970002c87f2f7457b72cad236fdd2a28066b85377b7ca3421bbc9fea1e43e
|
| 3 |
+
size 7230940
|
outputs/previews/chusai_segment1_scriptfirst_qwenwan/audio/segment_01.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c66525350b7d6ef6a63feea5ff1890357fa1c69e9d77051e98b85652617bfb61
|
| 3 |
+
size 441644
|
outputs/previews/chusai_segment1_scriptfirst_qwenwan/images/segment_01.png
ADDED
|
Git LFS Details
|
outputs/previews/chusai_segment1_scriptfirst_qwenwan/preview_status.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"status": "partial",
|
| 3 |
+
"notes": [
|
| 4 |
+
"fresh image generated successfully with current local image backend resolution",
|
| 5 |
+
"audio reused from existing 出塞 agentloop wan_vace run for segment 1",
|
| 6 |
+
"video render failed on host due to Wan VACE OOM during USP run",
|
| 7 |
+
"Bernini full image model directory is not present locally or in shared Models path scanned this turn; current generated image therefore came from Qwen-Image fallback under image_backend=auto"
|
| 8 |
+
],
|
| 9 |
+
"artifacts": {
|
| 10 |
+
"image": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen/outputs/previews/chusai_segment1_scriptfirst_qwenwan/images/segment_01.png",
|
| 11 |
+
"audio": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen/outputs/previews/chusai_segment1_scriptfirst_qwenwan/audio/segment_01.wav",
|
| 12 |
+
"video_request": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen/outputs/previews/chusai_segment1_scriptfirst_qwenwan/videos/segment_01.wan_vace_usp_request.json"
|
| 13 |
+
}
|
| 14 |
+
}
|
outputs/previews/chusai_segment1_scriptfirst_qwenwan/videos/segment_01.wan_vace_usp_request.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"segment": {
|
| 3 |
+
"index": 1,
|
| 4 |
+
"title": "月照边关",
|
| 5 |
+
"story_beat": "处境",
|
| 6 |
+
"teaching_goal": "通过月夜边关实景,引导学生进入边塞环境,理解‘秦时明月汉时关’的历史纵深感。",
|
| 7 |
+
"image_prompt": "环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史质感;开头写资产类型:人物资产/环境资产/物象器物资产/人物+环境资产/物象+环境资产;只锁定一个核心视觉锚点,构图稳定、轮廓明确、无文字、无拼贴、无现代物品;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识;VACE参考资产图,非最终视频截图;开头写资产类型:人物资产/环境资产/物象器物资产/人物+环境资产/物象+环境资产;只锁定一个核心视觉锚点,构图稳定、轮廓明确、无文字、无拼贴、无现代物品;中国古代写实历史教育短片风格;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识;人物只用中国古代剪影、背影或侧影;不露正脸和清晰五官;无现代写真感;没有人物需求时不强行加人;",
|
| 8 |
+
"video_prompt": "镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识;中国;4-8s 月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的→环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史/镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;中国;8-14s 月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的→环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史/镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;中国;中国古代写实历史教育短片风格;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识;以参考资产图为视觉锚点,保持主体身份、场景结构、服饰器物和整体风格一致;人物只用中国古代剪影、背影或侧影;不露正脸和清晰五官;无现代写真感;没有人物需求时不强行加人;本段隐喻锚点:metaphor_nodes:月照边关;visual_anchor:环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史质感;开头写资产类型:人物资产/环境资…;audio_anchor:月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的守望?;motion_anc…;",
|
| 9 |
+
"audio_text": "月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的守望?",
|
| 10 |
+
"duration": 14,
|
| 11 |
+
"image_prompts": [
|
| 12 |
+
"环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史质感;开头写资产类型:人物资产/环境资产/物象器物资产/人物+环境资产/物象+环境资产;只锁定一个核心视觉锚点,构图稳定、轮廓明确、无文字、无拼贴、无现代物品;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识;VACE参考资产图,非最终视频截图;开头写资产类型:人物资产/环境资产/物象器物资产/人物+环境资产/物象+环境资产;只锁定一个核心视觉锚点,构图稳定、轮廓明确、无文字、无拼贴、无现代物品;中国古代写实历史教育短片风格;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识;人物只用中国古代剪影、背影或侧影;不露正脸和清晰五官;无现代写真感;没有人物需求时不强行加人;"
|
| 13 |
+
],
|
| 14 |
+
"script_beat": "月光洒在边关城楼,风沙掠过残垣,仿佛秦��的烽火从未熄灭。这轮明月,照过多少代人的守望?",
|
| 15 |
+
"grounding": {
|
| 16 |
+
"metaphor_nodes": [
|
| 17 |
+
"月照边关"
|
| 18 |
+
],
|
| 19 |
+
"visual_anchor": "环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史质感;开头写资产类型:人物资产/环境资产/物象器物资产/人物+环境资产/物象+环境资产;只锁定一个核心视觉锚点,构图稳定、轮廓明确、无文字、无拼贴、无现代物品;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识",
|
| 20 |
+
"audio_anchor": "月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的守望?",
|
| 21 |
+
"motion_anchor": "镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;服饰、建筑、器物、船只、灯具和环境符合古代语境;禁止现代服装、现代建筑、车辆、电线、路灯、玻璃幕墙、塑料制品和现代文字标识",
|
| 22 |
+
"teaching_anchor": "通过月夜边关实景,引导学生进入边塞环境,理解‘秦时明月汉时关’的历史纵深感"
|
| 23 |
+
},
|
| 24 |
+
"av_sync_plan": [
|
| 25 |
+
{
|
| 26 |
+
"time_range": "0-4s",
|
| 27 |
+
"audio_cue": "月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的",
|
| 28 |
+
"visual_cue": "环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史",
|
| 29 |
+
"motion_cue": "镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;中国"
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"time_range": "4-8s",
|
| 33 |
+
"audio_cue": "月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的",
|
| 34 |
+
"visual_cue": "环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史",
|
| 35 |
+
"motion_cue": "镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;中国"
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"time_range": "8-14s",
|
| 39 |
+
"audio_cue": "月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的",
|
| 40 |
+
"visual_cue": "环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史",
|
| 41 |
+
"motion_cue": "镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围;中国"
|
| 42 |
+
}
|
| 43 |
+
]
|
| 44 |
+
},
|
| 45 |
+
"image_path": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen/outputs/previews/chusai_segment1_scriptfirst_qwenwan/images/segment_01.png",
|
| 46 |
+
"output_path": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen/outputs/previews/chusai_segment1_scriptfirst_qwenwan/videos/segment_01.mp4",
|
| 47 |
+
"reference_images": [
|
| 48 |
+
"/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen/outputs/previews/chusai_segment1_scriptfirst_qwenwan/images/segment_01.png"
|
| 49 |
+
],
|
| 50 |
+
"config": {
|
| 51 |
+
"vgen_root": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/ozhang/VGen",
|
| 52 |
+
"wan_i2v_model": "/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/Wan2.2-VACE-Fun-A14B",
|
| 53 |
+
"clip_seconds": 14,
|
| 54 |
+
"fps": 15,
|
| 55 |
+
"height": 480,
|
| 56 |
+
"width": 832,
|
| 57 |
+
"video_steps": 28,
|
| 58 |
+
"seed": 1043
|
| 59 |
+
}
|
| 60 |
+
}
|
runtime/chusai_qwen_raw.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<analysis>《出塞》属于边塞怀古诗,主线应沿“眼前边关月夜”切入,转入“秦汉历史纵深”,再聚焦“征人未归的现实困境”,最后落在“对良将的渴望与和平愿景”。核心情绪是悲壮中蕴含希望,关键画面需呈现明月、边关、征人剪影、阴山与飞将意象。声音设计需从寂静风声过渡到战马嘶鸣,再归于沉稳旁白。主旨:借古讽今,以历史之镜照现实之痛,呼唤良将安边。</analysis>
|
| 2 |
+
<plan4teach>{"poem_title":"出塞","author":"王昌龄","narrative_mode":"怀古","storyline":"从唐代边关月夜实景出发,穿越至秦汉历史时空,展现征人久戍不归的悲凉,再借李广典故转折,表达对良将安边的深切期盼,最终回归现实,点出人民对和平的渴望。","recurring_character_style":"唐代边关守军剪影,身着汉代风格铠甲,背负行囊,侧影立于风沙中,发髻高束,面容模糊,被月光与雾气半遮。","segments":[{"index":1,"title":"月照边关","story_beat":"处境","teaching_goal":"通过月夜边关实景,引导学生进入边塞环境,理解‘秦时明月汉时关’的历史纵深感。","duration":14},{"index":2,"title":"历史回响","story_beat":"空间推进","teaching_goal":"将秦汉边关与唐代现实连接,体会‘万里长征人未还’的时空延续性。","duration":15},{"index":3,"title":"征人未归","story_beat":"事件推进","teaching_goal":"聚焦征人命运,揭示长期征战对个体的摧残,呼应创作背景中‘士兵久戍不归’。","duration":14},{"index":4,"title":"良将之思","story_beat":"转折","teaching_goal":"引入李广典故,点出‘但使龙城飞将在’的假设,引导学生思考将领与边防的关系。","duration":15},{"index":5,"title":"阴山防线","story_beat":"回望","teaching_goal":"通过阴山地理意象,强化‘不教胡马度阴山’的防御意义,关联赏析中‘平息边患’的愿望。","duration":14},{"index":6,"title":"悲壮基调","story_beat":"反应","teaching_goal":"总结全诗悲壮浑成的风格,点出明代李攀龙‘压卷之作’的评价依据。","duration":15},{"index":7,"title":"和平愿景","story_beat":"点题","teaching_goal":"升华主题,将个人命运与国家安定结合,呼应人民对和平的渴望。","duration":14},{"index":8,"title":"作者余音","story_beat":"回望","teaching_goal":"简要介绍王昌龄边塞诗成就,强化其‘借古讽今’的创作意图。","duration":15}]}</plan4teach>
|
| 3 |
+
<plan4img>{"segments":[{"index":1,"image_prompts":["环境资产:唐代边关月夜,冷色调月光洒在残破城楼与烽火台,远处阴山轮廓隐现,风沙微扬,无文字,写实历史质感。"]},{"index":2,"image_prompts":["物象+环境资产:秦汉风格边关遗址与唐代城楼叠影,明月悬空,历史感通过光影层次呈现,无文字。"]},{"index":3,"image_prompts":["人物+环境资产:唐代边关守军剪影,身着汉代铠甲,背负行囊,侧影立于风沙中,月光勾勒轮廓,远处营帐灯火摇曳。"]},{"index":4,"image_prompts":["人物资产:汉代名将李广剪影,骑白马持弓,立于龙城练兵场,背景为汉代军营与战旗,光线温暖,与冷色调边关形成对比。"]},{"index":5,"image_prompts":["环境资产:阴山山脉全景,山势险峻,山脚下隐约可见胡马骑兵剪影,天空阴沉,强调地理屏障作用。"]},{"index":6,"image_prompts":["物象+环境资产:边关残垣与战鼓特写,月光下鼓面裂纹清晰,远处烽火台余烟未散,悲壮氛围。"]},{"index":7,"image_prompts":["环境资产:边关黎明,晨光微露,征人剪影归队,远处阴山雪顶反光,象征希望与和平。"]},{"index":8,"image_prompts":["人物资产:王昌龄剪影,唐代文人服饰,立于边关高处远眺,背影融入月光,无正脸,强调其观察与思考。"]}]} </plan4img>
|
| 4 |
+
<plan4video>{"segments":[{"index":1,"video_prompt":"镜头从冷月缓缓下移至边关城楼,风沙掠过残垣,远处阴山轮廓在雾气中若隐若现,营造静谧而苍凉的氛围。"},{"index":2,"video_prompt":"画面叠化秦汉遗址与唐代城楼,月光穿透历史层叠,烽火台余烟袅袅升起,暗示时空延续。"},{"index":3,"video_prompt":"守军剪影在风沙中缓慢行走,行囊拖地声隐约可闻,远处营帐灯火忽明忽暗,突出征人疲惫。"},{"index":4,"video_prompt":"李广剪影策马驰骋,战旗猎猎,镜头快速切换至边关现实,形成历史与当下的强烈对比。"},{"index":5,"video_prompt":"阴山全景镜头推进,山脚下胡马骑兵剪影一闪而过,随即隐入山后,强调地理屏障的脆弱性。"},{"index":6,"video_prompt":"战鼓特写镜头旋转,鼓面裂纹随月光流动,远处烽火台余烟消散,悲壮情绪达到高潮。"},{"index":7,"video_prompt":"晨光从阴山雪顶洒下,征人剪影归队步伐坚定,镜头拉远展现边关全貌,象征希望重���。"},{"index":8,"video_prompt":"王昌龄剪影立于高处,镜头缓慢环绕,月光将其背影拉长,最终融入边关夜色,余韵悠长。"}]} </plan4video>
|
| 5 |
+
<plan4audio>{"segments":[{"index":1,"audio_text":"月光洒在边关城楼,风沙掠过残垣,仿佛秦汉的烽火从未熄灭。这轮明月,照过多少代人的守望?"},{"index":2,"audio_text":"从秦汉到唐代,边关的轮廓变了,但征人的脚步从未停歇。万里征途,多少人再未归来。"},{"index":3,"audio_text":"风沙中,守军拖着行囊缓缓前行,营帐灯火忽明忽暗。他们等待的,是归期,还是平安?"},{"index":4,"audio_text":"若李广还在,龙城战鼓定能震退胡马。可惜,历史没有如果,只有现实的无奈。"},{"index":5,"audio_text":"阴山如屏障,却挡不住铁蹄的试探。山脚下,骑兵一闪而过,和平的防线如此脆弱。"},{"index":6,"audio_text":"战鼓裂纹在月光下清晰可见,余烟消散,悲壮中藏着对良将的渴望。这声音,穿越千年仍在回响。"},{"index":7,"audio_text":"晨光微露,征人归队,阴山雪顶反光。和平的曙光,或许就在下一个黎明。"},{"index":8,"audio_text":"王昌龄站在边关高处,背影融入月色。他借古讽今,提醒我们:良将安边,才是百姓真正的期盼。"}]} </plan4audio>
|
runtime/deployment.env
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
VGEN_ROOT=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen
|
| 2 |
+
DIFFSYNTH_ROOT=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/VGen/third_party/DiffSynth-Studio
|
| 3 |
+
QWEN_IMAGE_MODEL=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/Qwen-Image
|
| 4 |
+
COSYVOICE_MODEL=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/CosyVoice3-0.5B-2512
|
| 5 |
+
WAN_I2V_MODEL=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/Wan2.2-I2V-A14B
|
| 6 |
+
QWEN35_27B_MODEL=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/Models/qwen3.5-27b
|
| 7 |
+
CONDA_SH=/apdcephfs_sgxy/share_304169095/hunyuan/juliayxzhu/dev/miniconda3/etc/profile.d/conda.sh
|
| 8 |
+
DIFF_ENV=diff
|
runtime/matcha-tts-0.0.7.2.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86af5e36343fe742cbaea04020ddb0d55fc787ee7cd6c251c471e84babcd20f1
|
| 3 |
+
size 206143
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2023 Shivam Mehta
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/MANIFEST.in
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
include README.md
|
| 2 |
+
include LICENSE.txt
|
| 3 |
+
include requirements.*.txt
|
| 4 |
+
include *.cff
|
| 5 |
+
include requirements.txt
|
| 6 |
+
include matcha/VERSION
|
| 7 |
+
recursive-include matcha *.json
|
| 8 |
+
recursive-include matcha *.html
|
| 9 |
+
recursive-include matcha *.png
|
| 10 |
+
recursive-include matcha *.md
|
| 11 |
+
recursive-include matcha *.py
|
| 12 |
+
recursive-include matcha *.pyx
|
| 13 |
+
recursive-exclude tests *
|
| 14 |
+
prune tests*
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/PKG-INFO
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: matcha-tts
|
| 3 |
+
Version: 0.0.7.2
|
| 4 |
+
Summary: 🍵 Matcha-TTS: A fast TTS architecture with conditional flow matching
|
| 5 |
+
Home-page: https://shivammehta25.github.io/Matcha-TTS
|
| 6 |
+
Author: Shivam Mehta
|
| 7 |
+
Author-email: shivam.mehta25@gmail.com
|
| 8 |
+
Requires-Python: >=3.9.0
|
| 9 |
+
Description-Content-Type: text/markdown
|
| 10 |
+
License-File: LICENSE
|
| 11 |
+
Requires-Dist: torch>=2.0.0
|
| 12 |
+
Requires-Dist: torchvision>=0.15.0
|
| 13 |
+
Requires-Dist: lightning>=2.0.0
|
| 14 |
+
Requires-Dist: torchmetrics>=0.11.4
|
| 15 |
+
Requires-Dist: hydra-core==1.3.2
|
| 16 |
+
Requires-Dist: hydra-colorlog==1.2.0
|
| 17 |
+
Requires-Dist: hydra-optuna-sweeper==1.2.0
|
| 18 |
+
Requires-Dist: rootutils
|
| 19 |
+
Requires-Dist: pre-commit
|
| 20 |
+
Requires-Dist: rich
|
| 21 |
+
Requires-Dist: pytest
|
| 22 |
+
Requires-Dist: phonemizer
|
| 23 |
+
Requires-Dist: tensorboard
|
| 24 |
+
Requires-Dist: librosa
|
| 25 |
+
Requires-Dist: Cython
|
| 26 |
+
Requires-Dist: numpy
|
| 27 |
+
Requires-Dist: einops
|
| 28 |
+
Requires-Dist: inflect
|
| 29 |
+
Requires-Dist: Unidecode
|
| 30 |
+
Requires-Dist: scipy
|
| 31 |
+
Requires-Dist: torchaudio
|
| 32 |
+
Requires-Dist: matplotlib
|
| 33 |
+
Requires-Dist: pandas
|
| 34 |
+
Requires-Dist: conformer==0.3.2
|
| 35 |
+
Requires-Dist: diffusers
|
| 36 |
+
Requires-Dist: notebook
|
| 37 |
+
Requires-Dist: ipywidgets
|
| 38 |
+
Requires-Dist: gradio==3.43.2
|
| 39 |
+
Requires-Dist: gdown
|
| 40 |
+
Requires-Dist: wget
|
| 41 |
+
Requires-Dist: seaborn
|
| 42 |
+
|
| 43 |
+
<div align="center">
|
| 44 |
+
|
| 45 |
+
# 🍵 Matcha-TTS: A fast TTS architecture with conditional flow matching
|
| 46 |
+
|
| 47 |
+
### [Shivam Mehta](https://www.kth.se/profile/smehta), [Ruibo Tu](https://www.kth.se/profile/ruibo), [Jonas Beskow](https://www.kth.se/profile/beskow), [Éva Székely](https://www.kth.se/profile/szekely), and [Gustav Eje Henter](https://people.kth.se/~ghe/)
|
| 48 |
+
|
| 49 |
+
[](https://www.python.org/downloads/release/python-3100/)
|
| 50 |
+
[](https://pytorch.org/get-started/locally/)
|
| 51 |
+
[](https://pytorchlightning.ai/)
|
| 52 |
+
[](https://hydra.cc/)
|
| 53 |
+
[](https://black.readthedocs.io/en/stable/)
|
| 54 |
+
[](https://pycqa.github.io/isort/)
|
| 55 |
+
|
| 56 |
+
<p style="text-align: center;">
|
| 57 |
+
<img src="https://shivammehta25.github.io/Matcha-TTS/images/logo.png" height="128"/>
|
| 58 |
+
</p>
|
| 59 |
+
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
> This is the official code implementation of 🍵 Matcha-TTS [ICASSP 2024].
|
| 63 |
+
|
| 64 |
+
We propose 🍵 Matcha-TTS, a new approach to non-autoregressive neural TTS, that uses [conditional flow matching](https://arxiv.org/abs/2210.02747) (similar to [rectified flows](https://arxiv.org/abs/2209.03003)) to speed up ODE-based speech synthesis. Our method:
|
| 65 |
+
|
| 66 |
+
- Is probabilistic
|
| 67 |
+
- Has compact memory footprint
|
| 68 |
+
- Sounds highly natural
|
| 69 |
+
- Is very fast to synthesise from
|
| 70 |
+
|
| 71 |
+
Check out our [demo page](https://shivammehta25.github.io/Matcha-TTS) and read [our ICASSP 2024 paper](https://arxiv.org/abs/2309.03199) for more details.
|
| 72 |
+
|
| 73 |
+
[Pre-trained models](https://drive.google.com/drive/folders/17C_gYgEHOxI5ZypcfE_k1piKCtyR0isJ?usp=sharing) will be automatically downloaded with the CLI or gradio interface.
|
| 74 |
+
|
| 75 |
+
You can also [try 🍵 Matcha-TTS in your browser on HuggingFace 🤗 spaces](https://huggingface.co/spaces/shivammehta25/Matcha-TTS).
|
| 76 |
+
|
| 77 |
+
## Teaser video
|
| 78 |
+
|
| 79 |
+
[](https://youtu.be/xmvJkz3bqw0)
|
| 80 |
+
|
| 81 |
+
## Installation
|
| 82 |
+
|
| 83 |
+
1. Create an environment (suggested but optional)
|
| 84 |
+
|
| 85 |
+
```
|
| 86 |
+
conda create -n matcha-tts python=3.10 -y
|
| 87 |
+
conda activate matcha-tts
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
2. Install Matcha TTS using pip or from source
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
pip install matcha-tts
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
from source
|
| 97 |
+
|
| 98 |
+
```bash
|
| 99 |
+
pip install git+https://github.com/shivammehta25/Matcha-TTS.git
|
| 100 |
+
cd Matcha-TTS
|
| 101 |
+
pip install -e .
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
3. Run CLI / gradio app / jupyter notebook
|
| 105 |
+
|
| 106 |
+
```bash
|
| 107 |
+
# This will download the required models
|
| 108 |
+
matcha-tts --text "<INPUT TEXT>"
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
or
|
| 112 |
+
|
| 113 |
+
```bash
|
| 114 |
+
matcha-tts-app
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
or open `synthesis.ipynb` on jupyter notebook
|
| 118 |
+
|
| 119 |
+
### CLI Arguments
|
| 120 |
+
|
| 121 |
+
- To synthesise from given text, run:
|
| 122 |
+
|
| 123 |
+
```bash
|
| 124 |
+
matcha-tts --text "<INPUT TEXT>"
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
- To synthesise from a file, run:
|
| 128 |
+
|
| 129 |
+
```bash
|
| 130 |
+
matcha-tts --file <PATH TO FILE>
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
- To batch synthesise from a file, run:
|
| 134 |
+
|
| 135 |
+
```bash
|
| 136 |
+
matcha-tts --file <PATH TO FILE> --batched
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
Additional arguments
|
| 140 |
+
|
| 141 |
+
- Speaking rate
|
| 142 |
+
|
| 143 |
+
```bash
|
| 144 |
+
matcha-tts --text "<INPUT TEXT>" --speaking_rate 1.0
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
- Sampling temperature
|
| 148 |
+
|
| 149 |
+
```bash
|
| 150 |
+
matcha-tts --text "<INPUT TEXT>" --temperature 0.667
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
- Euler ODE solver steps
|
| 154 |
+
|
| 155 |
+
```bash
|
| 156 |
+
matcha-tts --text "<INPUT TEXT>" --steps 10
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
## Train with your own dataset
|
| 160 |
+
|
| 161 |
+
Let's assume we are training with LJ Speech
|
| 162 |
+
|
| 163 |
+
1. Download the dataset from [here](https://keithito.com/LJ-Speech-Dataset/), extract it to `data/LJSpeech-1.1`, and prepare the file lists to point to the extracted data like for [item 5 in the setup of the NVIDIA Tacotron 2 repo](https://github.com/NVIDIA/tacotron2#setup).
|
| 164 |
+
|
| 165 |
+
2. Clone and enter the Matcha-TTS repository
|
| 166 |
+
|
| 167 |
+
```bash
|
| 168 |
+
git clone https://github.com/shivammehta25/Matcha-TTS.git
|
| 169 |
+
cd Matcha-TTS
|
| 170 |
+
```
|
| 171 |
+
|
| 172 |
+
3. Install the package from source
|
| 173 |
+
|
| 174 |
+
```bash
|
| 175 |
+
pip install -e .
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
4. Go to `configs/data/ljspeech.yaml` and change
|
| 179 |
+
|
| 180 |
+
```yaml
|
| 181 |
+
train_filelist_path: data/filelists/ljs_audio_text_train_filelist.txt
|
| 182 |
+
valid_filelist_path: data/filelists/ljs_audio_text_val_filelist.txt
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
5. Generate normalisation statistics with the yaml file of dataset configuration
|
| 186 |
+
|
| 187 |
+
```bash
|
| 188 |
+
matcha-data-stats -i ljspeech.yaml
|
| 189 |
+
# Output:
|
| 190 |
+
#{'mel_mean': -5.53662231756592, 'mel_std': 2.1161014277038574}
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
Update these values in `configs/data/ljspeech.yaml` under `data_statistics` key.
|
| 194 |
+
|
| 195 |
+
```bash
|
| 196 |
+
data_statistics: # Computed for ljspeech dataset
|
| 197 |
+
mel_mean: -5.536622
|
| 198 |
+
mel_std: 2.116101
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
+
to the paths of your train and validation filelists.
|
| 202 |
+
|
| 203 |
+
6. Run the training script
|
| 204 |
+
|
| 205 |
+
```bash
|
| 206 |
+
make train-ljspeech
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
or
|
| 210 |
+
|
| 211 |
+
```bash
|
| 212 |
+
python matcha/train.py experiment=ljspeech
|
| 213 |
+
```
|
| 214 |
+
|
| 215 |
+
- for a minimum memory run
|
| 216 |
+
|
| 217 |
+
```bash
|
| 218 |
+
python matcha/train.py experiment=ljspeech_min_memory
|
| 219 |
+
```
|
| 220 |
+
|
| 221 |
+
- for multi-gpu training, run
|
| 222 |
+
|
| 223 |
+
```bash
|
| 224 |
+
python matcha/train.py experiment=ljspeech trainer.devices=[0,1]
|
| 225 |
+
```
|
| 226 |
+
|
| 227 |
+
7. Synthesise from the custom trained model
|
| 228 |
+
|
| 229 |
+
```bash
|
| 230 |
+
matcha-tts --text "<INPUT TEXT>" --checkpoint_path <PATH TO CHECKPOINT>
|
| 231 |
+
```
|
| 232 |
+
|
| 233 |
+
## ONNX support
|
| 234 |
+
|
| 235 |
+
> Special thanks to [@mush42](https://github.com/mush42) for implementing ONNX export and inference support.
|
| 236 |
+
|
| 237 |
+
It is possible to export Matcha checkpoints to [ONNX](https://onnx.ai/), and run inference on the exported ONNX graph.
|
| 238 |
+
|
| 239 |
+
### ONNX export
|
| 240 |
+
|
| 241 |
+
To export a checkpoint to ONNX, first install ONNX with
|
| 242 |
+
|
| 243 |
+
```bash
|
| 244 |
+
pip install onnx
|
| 245 |
+
```
|
| 246 |
+
|
| 247 |
+
then run the following:
|
| 248 |
+
|
| 249 |
+
```bash
|
| 250 |
+
python3 -m matcha.onnx.export matcha.ckpt model.onnx --n-timesteps 5
|
| 251 |
+
```
|
| 252 |
+
|
| 253 |
+
Optionally, the ONNX exporter accepts **vocoder-name** and **vocoder-checkpoint** arguments. This enables you to embed the vocoder in the exported graph and generate waveforms in a single run (similar to end-to-end TTS systems).
|
| 254 |
+
|
| 255 |
+
**Note** that `n_timesteps` is treated as a hyper-parameter rather than a model input. This means you should specify it during export (not during inference). If not specified, `n_timesteps` is set to **5**.
|
| 256 |
+
|
| 257 |
+
**Important**: for now, torch>=2.1.0 is needed for export since the `scaled_product_attention` operator is not exportable in older versions. Until the final version is released, those who want to export their models must install torch>=2.1.0 manually as a pre-release.
|
| 258 |
+
|
| 259 |
+
### ONNX Inference
|
| 260 |
+
|
| 261 |
+
To run inference on the exported model, first install `onnxruntime` using
|
| 262 |
+
|
| 263 |
+
```bash
|
| 264 |
+
pip install onnxruntime
|
| 265 |
+
pip install onnxruntime-gpu # for GPU inference
|
| 266 |
+
```
|
| 267 |
+
|
| 268 |
+
then use the following:
|
| 269 |
+
|
| 270 |
+
```bash
|
| 271 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs
|
| 272 |
+
```
|
| 273 |
+
|
| 274 |
+
You can also control synthesis parameters:
|
| 275 |
+
|
| 276 |
+
```bash
|
| 277 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs --temperature 0.4 --speaking_rate 0.9 --spk 0
|
| 278 |
+
```
|
| 279 |
+
|
| 280 |
+
To run inference on **GPU**, make sure to install **onnxruntime-gpu** package, and then pass `--gpu` to the inference command:
|
| 281 |
+
|
| 282 |
+
```bash
|
| 283 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs --gpu
|
| 284 |
+
```
|
| 285 |
+
|
| 286 |
+
If you exported only Matcha to ONNX, this will write mel-spectrogram as graphs and `numpy` arrays to the output directory.
|
| 287 |
+
If you embedded the vocoder in the exported graph, this will write `.wav` audio files to the output directory.
|
| 288 |
+
|
| 289 |
+
If you exported only Matcha to ONNX, and you want to run a full TTS pipeline, you can pass a path to a vocoder model in `ONNX` format:
|
| 290 |
+
|
| 291 |
+
```bash
|
| 292 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs --vocoder hifigan.small.onnx
|
| 293 |
+
```
|
| 294 |
+
|
| 295 |
+
This will write `.wav` audio files to the output directory.
|
| 296 |
+
|
| 297 |
+
## Extract phoneme alignments from Matcha-TTS
|
| 298 |
+
|
| 299 |
+
If the dataset is structured as
|
| 300 |
+
|
| 301 |
+
```bash
|
| 302 |
+
data/
|
| 303 |
+
└── LJSpeech-1.1
|
| 304 |
+
├── metadata.csv
|
| 305 |
+
├── README
|
| 306 |
+
├── test.txt
|
| 307 |
+
├── train.txt
|
| 308 |
+
├── val.txt
|
| 309 |
+
└── wavs
|
| 310 |
+
```
|
| 311 |
+
Then you can extract the phoneme level alignments from a Trained Matcha-TTS model using:
|
| 312 |
+
```bash
|
| 313 |
+
python matcha/utils/get_durations_from_trained_model.py -i dataset_yaml -c <checkpoint>
|
| 314 |
+
```
|
| 315 |
+
Example:
|
| 316 |
+
```bash
|
| 317 |
+
python matcha/utils/get_durations_from_trained_model.py -i ljspeech.yaml -c matcha_ljspeech.ckpt
|
| 318 |
+
```
|
| 319 |
+
or simply:
|
| 320 |
+
```bash
|
| 321 |
+
matcha-tts-get-durations -i ljspeech.yaml -c matcha_ljspeech.ckpt
|
| 322 |
+
```
|
| 323 |
+
---
|
| 324 |
+
## Train using extracted alignments
|
| 325 |
+
|
| 326 |
+
In the datasetconfig turn on load duration.
|
| 327 |
+
Example: `ljspeech.yaml`
|
| 328 |
+
```
|
| 329 |
+
load_durations: True
|
| 330 |
+
```
|
| 331 |
+
or see an examples in configs/experiment/ljspeech_from_durations.yaml
|
| 332 |
+
|
| 333 |
+
|
| 334 |
+
## Citation information
|
| 335 |
+
|
| 336 |
+
If you use our code or otherwise find this work useful, please cite our paper:
|
| 337 |
+
|
| 338 |
+
```text
|
| 339 |
+
@inproceedings{mehta2024matcha,
|
| 340 |
+
title={Matcha-{TTS}: A fast {TTS} architecture with conditional flow matching},
|
| 341 |
+
author={Mehta, Shivam and Tu, Ruibo and Beskow, Jonas and Sz{\'e}kely, {\'E}va and Henter, Gustav Eje},
|
| 342 |
+
booktitle={Proc. ICASSP},
|
| 343 |
+
year={2024}
|
| 344 |
+
}
|
| 345 |
+
```
|
| 346 |
+
|
| 347 |
+
## Acknowledgements
|
| 348 |
+
|
| 349 |
+
Since this code uses [Lightning-Hydra-Template](https://github.com/ashleve/lightning-hydra-template), you have all the powers that come with it.
|
| 350 |
+
|
| 351 |
+
Other source code we would like to acknowledge:
|
| 352 |
+
|
| 353 |
+
- [Coqui-TTS](https://github.com/coqui-ai/TTS/tree/dev): For helping me figure out how to make cython binaries pip installable and encouragement
|
| 354 |
+
- [Hugging Face Diffusers](https://huggingface.co/): For their awesome diffusers library and its components
|
| 355 |
+
- [Grad-TTS](https://github.com/huawei-noah/Speech-Backbones/tree/main/Grad-TTS): For the monotonic alignment search source code
|
| 356 |
+
- [torchdyn](https://github.com/DiffEqML/torchdyn): Useful for trying other ODE solvers during research and development
|
| 357 |
+
- [labml.ai](https://nn.labml.ai/transformers/rope/index.html): For the RoPE implementation
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/README.md
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
# 🍵 Matcha-TTS: A fast TTS architecture with conditional flow matching
|
| 4 |
+
|
| 5 |
+
### [Shivam Mehta](https://www.kth.se/profile/smehta), [Ruibo Tu](https://www.kth.se/profile/ruibo), [Jonas Beskow](https://www.kth.se/profile/beskow), [Éva Székely](https://www.kth.se/profile/szekely), and [Gustav Eje Henter](https://people.kth.se/~ghe/)
|
| 6 |
+
|
| 7 |
+
[](https://www.python.org/downloads/release/python-3100/)
|
| 8 |
+
[](https://pytorch.org/get-started/locally/)
|
| 9 |
+
[](https://pytorchlightning.ai/)
|
| 10 |
+
[](https://hydra.cc/)
|
| 11 |
+
[](https://black.readthedocs.io/en/stable/)
|
| 12 |
+
[](https://pycqa.github.io/isort/)
|
| 13 |
+
|
| 14 |
+
<p style="text-align: center;">
|
| 15 |
+
<img src="https://shivammehta25.github.io/Matcha-TTS/images/logo.png" height="128"/>
|
| 16 |
+
</p>
|
| 17 |
+
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
> This is the official code implementation of 🍵 Matcha-TTS [ICASSP 2024].
|
| 21 |
+
|
| 22 |
+
We propose 🍵 Matcha-TTS, a new approach to non-autoregressive neural TTS, that uses [conditional flow matching](https://arxiv.org/abs/2210.02747) (similar to [rectified flows](https://arxiv.org/abs/2209.03003)) to speed up ODE-based speech synthesis. Our method:
|
| 23 |
+
|
| 24 |
+
- Is probabilistic
|
| 25 |
+
- Has compact memory footprint
|
| 26 |
+
- Sounds highly natural
|
| 27 |
+
- Is very fast to synthesise from
|
| 28 |
+
|
| 29 |
+
Check out our [demo page](https://shivammehta25.github.io/Matcha-TTS) and read [our ICASSP 2024 paper](https://arxiv.org/abs/2309.03199) for more details.
|
| 30 |
+
|
| 31 |
+
[Pre-trained models](https://drive.google.com/drive/folders/17C_gYgEHOxI5ZypcfE_k1piKCtyR0isJ?usp=sharing) will be automatically downloaded with the CLI or gradio interface.
|
| 32 |
+
|
| 33 |
+
You can also [try 🍵 Matcha-TTS in your browser on HuggingFace 🤗 spaces](https://huggingface.co/spaces/shivammehta25/Matcha-TTS).
|
| 34 |
+
|
| 35 |
+
## Teaser video
|
| 36 |
+
|
| 37 |
+
[](https://youtu.be/xmvJkz3bqw0)
|
| 38 |
+
|
| 39 |
+
## Installation
|
| 40 |
+
|
| 41 |
+
1. Create an environment (suggested but optional)
|
| 42 |
+
|
| 43 |
+
```
|
| 44 |
+
conda create -n matcha-tts python=3.10 -y
|
| 45 |
+
conda activate matcha-tts
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
2. Install Matcha TTS using pip or from source
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
pip install matcha-tts
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
from source
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
pip install git+https://github.com/shivammehta25/Matcha-TTS.git
|
| 58 |
+
cd Matcha-TTS
|
| 59 |
+
pip install -e .
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
3. Run CLI / gradio app / jupyter notebook
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
# This will download the required models
|
| 66 |
+
matcha-tts --text "<INPUT TEXT>"
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
or
|
| 70 |
+
|
| 71 |
+
```bash
|
| 72 |
+
matcha-tts-app
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
or open `synthesis.ipynb` on jupyter notebook
|
| 76 |
+
|
| 77 |
+
### CLI Arguments
|
| 78 |
+
|
| 79 |
+
- To synthesise from given text, run:
|
| 80 |
+
|
| 81 |
+
```bash
|
| 82 |
+
matcha-tts --text "<INPUT TEXT>"
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
- To synthesise from a file, run:
|
| 86 |
+
|
| 87 |
+
```bash
|
| 88 |
+
matcha-tts --file <PATH TO FILE>
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
- To batch synthesise from a file, run:
|
| 92 |
+
|
| 93 |
+
```bash
|
| 94 |
+
matcha-tts --file <PATH TO FILE> --batched
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
Additional arguments
|
| 98 |
+
|
| 99 |
+
- Speaking rate
|
| 100 |
+
|
| 101 |
+
```bash
|
| 102 |
+
matcha-tts --text "<INPUT TEXT>" --speaking_rate 1.0
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
- Sampling temperature
|
| 106 |
+
|
| 107 |
+
```bash
|
| 108 |
+
matcha-tts --text "<INPUT TEXT>" --temperature 0.667
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
- Euler ODE solver steps
|
| 112 |
+
|
| 113 |
+
```bash
|
| 114 |
+
matcha-tts --text "<INPUT TEXT>" --steps 10
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
## Train with your own dataset
|
| 118 |
+
|
| 119 |
+
Let's assume we are training with LJ Speech
|
| 120 |
+
|
| 121 |
+
1. Download the dataset from [here](https://keithito.com/LJ-Speech-Dataset/), extract it to `data/LJSpeech-1.1`, and prepare the file lists to point to the extracted data like for [item 5 in the setup of the NVIDIA Tacotron 2 repo](https://github.com/NVIDIA/tacotron2#setup).
|
| 122 |
+
|
| 123 |
+
2. Clone and enter the Matcha-TTS repository
|
| 124 |
+
|
| 125 |
+
```bash
|
| 126 |
+
git clone https://github.com/shivammehta25/Matcha-TTS.git
|
| 127 |
+
cd Matcha-TTS
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
3. Install the package from source
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
pip install -e .
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
4. Go to `configs/data/ljspeech.yaml` and change
|
| 137 |
+
|
| 138 |
+
```yaml
|
| 139 |
+
train_filelist_path: data/filelists/ljs_audio_text_train_filelist.txt
|
| 140 |
+
valid_filelist_path: data/filelists/ljs_audio_text_val_filelist.txt
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
5. Generate normalisation statistics with the yaml file of dataset configuration
|
| 144 |
+
|
| 145 |
+
```bash
|
| 146 |
+
matcha-data-stats -i ljspeech.yaml
|
| 147 |
+
# Output:
|
| 148 |
+
#{'mel_mean': -5.53662231756592, 'mel_std': 2.1161014277038574}
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
Update these values in `configs/data/ljspeech.yaml` under `data_statistics` key.
|
| 152 |
+
|
| 153 |
+
```bash
|
| 154 |
+
data_statistics: # Computed for ljspeech dataset
|
| 155 |
+
mel_mean: -5.536622
|
| 156 |
+
mel_std: 2.116101
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
to the paths of your train and validation filelists.
|
| 160 |
+
|
| 161 |
+
6. Run the training script
|
| 162 |
+
|
| 163 |
+
```bash
|
| 164 |
+
make train-ljspeech
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
or
|
| 168 |
+
|
| 169 |
+
```bash
|
| 170 |
+
python matcha/train.py experiment=ljspeech
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
- for a minimum memory run
|
| 174 |
+
|
| 175 |
+
```bash
|
| 176 |
+
python matcha/train.py experiment=ljspeech_min_memory
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
- for multi-gpu training, run
|
| 180 |
+
|
| 181 |
+
```bash
|
| 182 |
+
python matcha/train.py experiment=ljspeech trainer.devices=[0,1]
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
7. Synthesise from the custom trained model
|
| 186 |
+
|
| 187 |
+
```bash
|
| 188 |
+
matcha-tts --text "<INPUT TEXT>" --checkpoint_path <PATH TO CHECKPOINT>
|
| 189 |
+
```
|
| 190 |
+
|
| 191 |
+
## ONNX support
|
| 192 |
+
|
| 193 |
+
> Special thanks to [@mush42](https://github.com/mush42) for implementing ONNX export and inference support.
|
| 194 |
+
|
| 195 |
+
It is possible to export Matcha checkpoints to [ONNX](https://onnx.ai/), and run inference on the exported ONNX graph.
|
| 196 |
+
|
| 197 |
+
### ONNX export
|
| 198 |
+
|
| 199 |
+
To export a checkpoint to ONNX, first install ONNX with
|
| 200 |
+
|
| 201 |
+
```bash
|
| 202 |
+
pip install onnx
|
| 203 |
+
```
|
| 204 |
+
|
| 205 |
+
then run the following:
|
| 206 |
+
|
| 207 |
+
```bash
|
| 208 |
+
python3 -m matcha.onnx.export matcha.ckpt model.onnx --n-timesteps 5
|
| 209 |
+
```
|
| 210 |
+
|
| 211 |
+
Optionally, the ONNX exporter accepts **vocoder-name** and **vocoder-checkpoint** arguments. This enables you to embed the vocoder in the exported graph and generate waveforms in a single run (similar to end-to-end TTS systems).
|
| 212 |
+
|
| 213 |
+
**Note** that `n_timesteps` is treated as a hyper-parameter rather than a model input. This means you should specify it during export (not during inference). If not specified, `n_timesteps` is set to **5**.
|
| 214 |
+
|
| 215 |
+
**Important**: for now, torch>=2.1.0 is needed for export since the `scaled_product_attention` operator is not exportable in older versions. Until the final version is released, those who want to export their models must install torch>=2.1.0 manually as a pre-release.
|
| 216 |
+
|
| 217 |
+
### ONNX Inference
|
| 218 |
+
|
| 219 |
+
To run inference on the exported model, first install `onnxruntime` using
|
| 220 |
+
|
| 221 |
+
```bash
|
| 222 |
+
pip install onnxruntime
|
| 223 |
+
pip install onnxruntime-gpu # for GPU inference
|
| 224 |
+
```
|
| 225 |
+
|
| 226 |
+
then use the following:
|
| 227 |
+
|
| 228 |
+
```bash
|
| 229 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs
|
| 230 |
+
```
|
| 231 |
+
|
| 232 |
+
You can also control synthesis parameters:
|
| 233 |
+
|
| 234 |
+
```bash
|
| 235 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs --temperature 0.4 --speaking_rate 0.9 --spk 0
|
| 236 |
+
```
|
| 237 |
+
|
| 238 |
+
To run inference on **GPU**, make sure to install **onnxruntime-gpu** package, and then pass `--gpu` to the inference command:
|
| 239 |
+
|
| 240 |
+
```bash
|
| 241 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs --gpu
|
| 242 |
+
```
|
| 243 |
+
|
| 244 |
+
If you exported only Matcha to ONNX, this will write mel-spectrogram as graphs and `numpy` arrays to the output directory.
|
| 245 |
+
If you embedded the vocoder in the exported graph, this will write `.wav` audio files to the output directory.
|
| 246 |
+
|
| 247 |
+
If you exported only Matcha to ONNX, and you want to run a full TTS pipeline, you can pass a path to a vocoder model in `ONNX` format:
|
| 248 |
+
|
| 249 |
+
```bash
|
| 250 |
+
python3 -m matcha.onnx.infer model.onnx --text "hey" --output-dir ./outputs --vocoder hifigan.small.onnx
|
| 251 |
+
```
|
| 252 |
+
|
| 253 |
+
This will write `.wav` audio files to the output directory.
|
| 254 |
+
|
| 255 |
+
## Extract phoneme alignments from Matcha-TTS
|
| 256 |
+
|
| 257 |
+
If the dataset is structured as
|
| 258 |
+
|
| 259 |
+
```bash
|
| 260 |
+
data/
|
| 261 |
+
└── LJSpeech-1.1
|
| 262 |
+
├── metadata.csv
|
| 263 |
+
├── README
|
| 264 |
+
├── test.txt
|
| 265 |
+
├── train.txt
|
| 266 |
+
├── val.txt
|
| 267 |
+
└── wavs
|
| 268 |
+
```
|
| 269 |
+
Then you can extract the phoneme level alignments from a Trained Matcha-TTS model using:
|
| 270 |
+
```bash
|
| 271 |
+
python matcha/utils/get_durations_from_trained_model.py -i dataset_yaml -c <checkpoint>
|
| 272 |
+
```
|
| 273 |
+
Example:
|
| 274 |
+
```bash
|
| 275 |
+
python matcha/utils/get_durations_from_trained_model.py -i ljspeech.yaml -c matcha_ljspeech.ckpt
|
| 276 |
+
```
|
| 277 |
+
or simply:
|
| 278 |
+
```bash
|
| 279 |
+
matcha-tts-get-durations -i ljspeech.yaml -c matcha_ljspeech.ckpt
|
| 280 |
+
```
|
| 281 |
+
---
|
| 282 |
+
## Train using extracted alignments
|
| 283 |
+
|
| 284 |
+
In the datasetconfig turn on load duration.
|
| 285 |
+
Example: `ljspeech.yaml`
|
| 286 |
+
```
|
| 287 |
+
load_durations: True
|
| 288 |
+
```
|
| 289 |
+
or see an examples in configs/experiment/ljspeech_from_durations.yaml
|
| 290 |
+
|
| 291 |
+
|
| 292 |
+
## Citation information
|
| 293 |
+
|
| 294 |
+
If you use our code or otherwise find this work useful, please cite our paper:
|
| 295 |
+
|
| 296 |
+
```text
|
| 297 |
+
@inproceedings{mehta2024matcha,
|
| 298 |
+
title={Matcha-{TTS}: A fast {TTS} architecture with conditional flow matching},
|
| 299 |
+
author={Mehta, Shivam and Tu, Ruibo and Beskow, Jonas and Sz{\'e}kely, {\'E}va and Henter, Gustav Eje},
|
| 300 |
+
booktitle={Proc. ICASSP},
|
| 301 |
+
year={2024}
|
| 302 |
+
}
|
| 303 |
+
```
|
| 304 |
+
|
| 305 |
+
## Acknowledgements
|
| 306 |
+
|
| 307 |
+
Since this code uses [Lightning-Hydra-Template](https://github.com/ashleve/lightning-hydra-template), you have all the powers that come with it.
|
| 308 |
+
|
| 309 |
+
Other source code we would like to acknowledge:
|
| 310 |
+
|
| 311 |
+
- [Coqui-TTS](https://github.com/coqui-ai/TTS/tree/dev): For helping me figure out how to make cython binaries pip installable and encouragement
|
| 312 |
+
- [Hugging Face Diffusers](https://huggingface.co/): For their awesome diffusers library and its components
|
| 313 |
+
- [Grad-TTS](https://github.com/huawei-noah/Speech-Backbones/tree/main/Grad-TTS): For the monotonic alignment search source code
|
| 314 |
+
- [torchdyn](https://github.com/DiffEqML/torchdyn): Useful for trying other ODE solvers during research and development
|
| 315 |
+
- [labml.ai](https://nn.labml.ai/transformers/rope/index.html): For the RoPE implementation
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/configs/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# this file is needed here to include configs when building project as a package
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
0.0.7.2
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/__init__.py
ADDED
|
File without changes
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/app.py
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import tempfile
|
| 2 |
+
from argparse import Namespace
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
|
| 5 |
+
import gradio as gr
|
| 6 |
+
import soundfile as sf
|
| 7 |
+
import torch
|
| 8 |
+
|
| 9 |
+
from matcha.cli import (
|
| 10 |
+
MATCHA_URLS,
|
| 11 |
+
VOCODER_URLS,
|
| 12 |
+
assert_model_downloaded,
|
| 13 |
+
get_device,
|
| 14 |
+
load_matcha,
|
| 15 |
+
load_vocoder,
|
| 16 |
+
process_text,
|
| 17 |
+
to_waveform,
|
| 18 |
+
)
|
| 19 |
+
from matcha.utils.utils import get_user_data_dir, plot_tensor
|
| 20 |
+
|
| 21 |
+
LOCATION = Path(get_user_data_dir())
|
| 22 |
+
|
| 23 |
+
args = Namespace(
|
| 24 |
+
cpu=False,
|
| 25 |
+
model="matcha_vctk",
|
| 26 |
+
vocoder="hifigan_univ_v1",
|
| 27 |
+
spk=0,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
CURRENTLY_LOADED_MODEL = args.model
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def MATCHA_TTS_LOC(x):
|
| 34 |
+
return LOCATION / f"{x}.ckpt"
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def VOCODER_LOC(x):
|
| 38 |
+
return LOCATION / f"{x}"
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
LOGO_URL = "https://shivammehta25.github.io/Matcha-TTS/images/logo.png"
|
| 42 |
+
RADIO_OPTIONS = {
|
| 43 |
+
"Multi Speaker (VCTK)": {
|
| 44 |
+
"model": "matcha_vctk",
|
| 45 |
+
"vocoder": "hifigan_univ_v1",
|
| 46 |
+
},
|
| 47 |
+
"Single Speaker (LJ Speech)": {
|
| 48 |
+
"model": "matcha_ljspeech",
|
| 49 |
+
"vocoder": "hifigan_T2_v1",
|
| 50 |
+
},
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
# Ensure all the required models are downloaded
|
| 54 |
+
assert_model_downloaded(MATCHA_TTS_LOC("matcha_ljspeech"), MATCHA_URLS["matcha_ljspeech"])
|
| 55 |
+
assert_model_downloaded(VOCODER_LOC("hifigan_T2_v1"), VOCODER_URLS["hifigan_T2_v1"])
|
| 56 |
+
assert_model_downloaded(MATCHA_TTS_LOC("matcha_vctk"), MATCHA_URLS["matcha_vctk"])
|
| 57 |
+
assert_model_downloaded(VOCODER_LOC("hifigan_univ_v1"), VOCODER_URLS["hifigan_univ_v1"])
|
| 58 |
+
|
| 59 |
+
device = get_device(args)
|
| 60 |
+
|
| 61 |
+
# Load default model
|
| 62 |
+
model = load_matcha(args.model, MATCHA_TTS_LOC(args.model), device)
|
| 63 |
+
vocoder, denoiser = load_vocoder(args.vocoder, VOCODER_LOC(args.vocoder), device)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def load_model(model_name, vocoder_name):
|
| 67 |
+
model = load_matcha(model_name, MATCHA_TTS_LOC(model_name), device)
|
| 68 |
+
vocoder, denoiser = load_vocoder(vocoder_name, VOCODER_LOC(vocoder_name), device)
|
| 69 |
+
return model, vocoder, denoiser
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def load_model_ui(model_type, textbox):
|
| 73 |
+
model_name, vocoder_name = RADIO_OPTIONS[model_type]["model"], RADIO_OPTIONS[model_type]["vocoder"]
|
| 74 |
+
|
| 75 |
+
global model, vocoder, denoiser, CURRENTLY_LOADED_MODEL # pylint: disable=global-statement
|
| 76 |
+
if CURRENTLY_LOADED_MODEL != model_name:
|
| 77 |
+
model, vocoder, denoiser = load_model(model_name, vocoder_name)
|
| 78 |
+
CURRENTLY_LOADED_MODEL = model_name
|
| 79 |
+
|
| 80 |
+
if model_name == "matcha_ljspeech":
|
| 81 |
+
spk_slider = gr.update(visible=False, value=-1)
|
| 82 |
+
single_speaker_examples = gr.update(visible=True)
|
| 83 |
+
multi_speaker_examples = gr.update(visible=False)
|
| 84 |
+
length_scale = gr.update(value=0.95)
|
| 85 |
+
else:
|
| 86 |
+
spk_slider = gr.update(visible=True, value=0)
|
| 87 |
+
single_speaker_examples = gr.update(visible=False)
|
| 88 |
+
multi_speaker_examples = gr.update(visible=True)
|
| 89 |
+
length_scale = gr.update(value=0.85)
|
| 90 |
+
|
| 91 |
+
return (
|
| 92 |
+
textbox,
|
| 93 |
+
gr.update(interactive=True),
|
| 94 |
+
spk_slider,
|
| 95 |
+
single_speaker_examples,
|
| 96 |
+
multi_speaker_examples,
|
| 97 |
+
length_scale,
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
@torch.inference_mode()
|
| 102 |
+
def process_text_gradio(text):
|
| 103 |
+
output = process_text(1, text, device)
|
| 104 |
+
return output["x_phones"][1::2], output["x"], output["x_lengths"]
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
@torch.inference_mode()
|
| 108 |
+
def synthesise_mel(text, text_length, n_timesteps, temperature, length_scale, spk):
|
| 109 |
+
spk = torch.tensor([spk], device=device, dtype=torch.long) if spk >= 0 else None
|
| 110 |
+
output = model.synthesise(
|
| 111 |
+
text,
|
| 112 |
+
text_length,
|
| 113 |
+
n_timesteps=n_timesteps,
|
| 114 |
+
temperature=temperature,
|
| 115 |
+
spks=spk,
|
| 116 |
+
length_scale=length_scale,
|
| 117 |
+
)
|
| 118 |
+
output["waveform"] = to_waveform(output["mel"], vocoder, denoiser)
|
| 119 |
+
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
| 120 |
+
sf.write(fp.name, output["waveform"], 22050, "PCM_24")
|
| 121 |
+
|
| 122 |
+
return fp.name, plot_tensor(output["mel"].squeeze().cpu().numpy())
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def multispeaker_example_cacher(text, n_timesteps, mel_temp, length_scale, spk):
|
| 126 |
+
global CURRENTLY_LOADED_MODEL # pylint: disable=global-statement
|
| 127 |
+
if CURRENTLY_LOADED_MODEL != "matcha_vctk":
|
| 128 |
+
global model, vocoder, denoiser # pylint: disable=global-statement
|
| 129 |
+
model, vocoder, denoiser = load_model("matcha_vctk", "hifigan_univ_v1")
|
| 130 |
+
CURRENTLY_LOADED_MODEL = "matcha_vctk"
|
| 131 |
+
|
| 132 |
+
phones, text, text_lengths = process_text_gradio(text)
|
| 133 |
+
audio, mel_spectrogram = synthesise_mel(text, text_lengths, n_timesteps, mel_temp, length_scale, spk)
|
| 134 |
+
return phones, audio, mel_spectrogram
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def ljspeech_example_cacher(text, n_timesteps, mel_temp, length_scale, spk=-1):
|
| 138 |
+
global CURRENTLY_LOADED_MODEL # pylint: disable=global-statement
|
| 139 |
+
if CURRENTLY_LOADED_MODEL != "matcha_ljspeech":
|
| 140 |
+
global model, vocoder, denoiser # pylint: disable=global-statement
|
| 141 |
+
model, vocoder, denoiser = load_model("matcha_ljspeech", "hifigan_T2_v1")
|
| 142 |
+
CURRENTLY_LOADED_MODEL = "matcha_ljspeech"
|
| 143 |
+
|
| 144 |
+
phones, text, text_lengths = process_text_gradio(text)
|
| 145 |
+
audio, mel_spectrogram = synthesise_mel(text, text_lengths, n_timesteps, mel_temp, length_scale, spk)
|
| 146 |
+
return phones, audio, mel_spectrogram
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
def main():
|
| 150 |
+
description = """# 🍵 Matcha-TTS: A fast TTS architecture with conditional flow matching
|
| 151 |
+
### [Shivam Mehta](https://www.kth.se/profile/smehta), [Ruibo Tu](https://www.kth.se/profile/ruibo), [Jonas Beskow](https://www.kth.se/profile/beskow), [Éva Székely](https://www.kth.se/profile/szekely), and [Gustav Eje Henter](https://people.kth.se/~ghe/)
|
| 152 |
+
We propose 🍵 Matcha-TTS, a new approach to non-autoregressive neural TTS, that uses conditional flow matching (similar to rectified flows) to speed up ODE-based speech synthesis. Our method:
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
* Is probabilistic
|
| 156 |
+
* Has compact memory footprint
|
| 157 |
+
* Sounds highly natural
|
| 158 |
+
* Is very fast to synthesise from
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
Check out our [demo page](https://shivammehta25.github.io/Matcha-TTS). Read our [arXiv preprint for more details](https://arxiv.org/abs/2309.03199).
|
| 162 |
+
Code is available in our [GitHub repository](https://github.com/shivammehta25/Matcha-TTS), along with pre-trained models.
|
| 163 |
+
|
| 164 |
+
Cached examples are available at the bottom of the page.
|
| 165 |
+
"""
|
| 166 |
+
|
| 167 |
+
with gr.Blocks(title="🍵 Matcha-TTS: A fast TTS architecture with conditional flow matching") as demo:
|
| 168 |
+
processed_text = gr.State(value=None)
|
| 169 |
+
processed_text_len = gr.State(value=None)
|
| 170 |
+
|
| 171 |
+
with gr.Box():
|
| 172 |
+
with gr.Row():
|
| 173 |
+
gr.Markdown(description, scale=3)
|
| 174 |
+
with gr.Column():
|
| 175 |
+
gr.Image(LOGO_URL, label="Matcha-TTS logo", height=50, width=50, scale=1, show_label=False)
|
| 176 |
+
html = '<br><iframe width="560" height="315" src="https://www.youtube.com/embed/xmvJkz3bqw0?si=jN7ILyDsbPwJCGoa" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>'
|
| 177 |
+
gr.HTML(html)
|
| 178 |
+
|
| 179 |
+
with gr.Box():
|
| 180 |
+
radio_options = list(RADIO_OPTIONS.keys())
|
| 181 |
+
model_type = gr.Radio(
|
| 182 |
+
radio_options, value=radio_options[0], label="Choose a Model", interactive=True, container=False
|
| 183 |
+
)
|
| 184 |
+
|
| 185 |
+
with gr.Row():
|
| 186 |
+
gr.Markdown("# Text Input")
|
| 187 |
+
with gr.Row():
|
| 188 |
+
text = gr.Textbox(value="", lines=2, label="Text to synthesise", scale=3)
|
| 189 |
+
spk_slider = gr.Slider(
|
| 190 |
+
minimum=0, maximum=107, step=1, value=args.spk, label="Speaker ID", interactive=True, scale=1
|
| 191 |
+
)
|
| 192 |
+
|
| 193 |
+
with gr.Row():
|
| 194 |
+
gr.Markdown("### Hyper parameters")
|
| 195 |
+
with gr.Row():
|
| 196 |
+
n_timesteps = gr.Slider(
|
| 197 |
+
label="Number of ODE steps",
|
| 198 |
+
minimum=1,
|
| 199 |
+
maximum=100,
|
| 200 |
+
step=1,
|
| 201 |
+
value=10,
|
| 202 |
+
interactive=True,
|
| 203 |
+
)
|
| 204 |
+
length_scale = gr.Slider(
|
| 205 |
+
label="Length scale (Speaking rate)",
|
| 206 |
+
minimum=0.5,
|
| 207 |
+
maximum=1.5,
|
| 208 |
+
step=0.05,
|
| 209 |
+
value=1.0,
|
| 210 |
+
interactive=True,
|
| 211 |
+
)
|
| 212 |
+
mel_temp = gr.Slider(
|
| 213 |
+
label="Sampling temperature",
|
| 214 |
+
minimum=0.00,
|
| 215 |
+
maximum=2.001,
|
| 216 |
+
step=0.16675,
|
| 217 |
+
value=0.667,
|
| 218 |
+
interactive=True,
|
| 219 |
+
)
|
| 220 |
+
|
| 221 |
+
synth_btn = gr.Button("Synthesise")
|
| 222 |
+
|
| 223 |
+
with gr.Box():
|
| 224 |
+
with gr.Row():
|
| 225 |
+
gr.Markdown("### Phonetised text")
|
| 226 |
+
phonetised_text = gr.Textbox(interactive=False, scale=10, label="Phonetised text")
|
| 227 |
+
|
| 228 |
+
with gr.Box():
|
| 229 |
+
with gr.Row():
|
| 230 |
+
mel_spectrogram = gr.Image(interactive=False, label="mel spectrogram")
|
| 231 |
+
|
| 232 |
+
# with gr.Row():
|
| 233 |
+
audio = gr.Audio(interactive=False, label="Audio")
|
| 234 |
+
|
| 235 |
+
with gr.Row(visible=False) as example_row_lj_speech:
|
| 236 |
+
examples = gr.Examples( # pylint: disable=unused-variable
|
| 237 |
+
examples=[
|
| 238 |
+
[
|
| 239 |
+
"We propose Matcha-TTS, a new approach to non-autoregressive neural TTS, that uses conditional flow matching (similar to rectified flows) to speed up O D E-based speech synthesis.",
|
| 240 |
+
50,
|
| 241 |
+
0.677,
|
| 242 |
+
0.95,
|
| 243 |
+
],
|
| 244 |
+
[
|
| 245 |
+
"The Secret Service believed that it was very doubtful that any President would ride regularly in a vehicle with a fixed top, even though transparent.",
|
| 246 |
+
2,
|
| 247 |
+
0.677,
|
| 248 |
+
0.95,
|
| 249 |
+
],
|
| 250 |
+
[
|
| 251 |
+
"The Secret Service believed that it was very doubtful that any President would ride regularly in a vehicle with a fixed top, even though transparent.",
|
| 252 |
+
4,
|
| 253 |
+
0.677,
|
| 254 |
+
0.95,
|
| 255 |
+
],
|
| 256 |
+
[
|
| 257 |
+
"The Secret Service believed that it was very doubtful that any President would ride regularly in a vehicle with a fixed top, even though transparent.",
|
| 258 |
+
10,
|
| 259 |
+
0.677,
|
| 260 |
+
0.95,
|
| 261 |
+
],
|
| 262 |
+
[
|
| 263 |
+
"The Secret Service believed that it was very doubtful that any President would ride regularly in a vehicle with a fixed top, even though transparent.",
|
| 264 |
+
50,
|
| 265 |
+
0.677,
|
| 266 |
+
0.95,
|
| 267 |
+
],
|
| 268 |
+
[
|
| 269 |
+
"The narrative of these events is based largely on the recollections of the participants.",
|
| 270 |
+
10,
|
| 271 |
+
0.677,
|
| 272 |
+
0.95,
|
| 273 |
+
],
|
| 274 |
+
[
|
| 275 |
+
"The jury did not believe him, and the verdict was for the defendants.",
|
| 276 |
+
10,
|
| 277 |
+
0.677,
|
| 278 |
+
0.95,
|
| 279 |
+
],
|
| 280 |
+
],
|
| 281 |
+
fn=ljspeech_example_cacher,
|
| 282 |
+
inputs=[text, n_timesteps, mel_temp, length_scale],
|
| 283 |
+
outputs=[phonetised_text, audio, mel_spectrogram],
|
| 284 |
+
cache_examples=True,
|
| 285 |
+
)
|
| 286 |
+
|
| 287 |
+
with gr.Row() as example_row_multispeaker:
|
| 288 |
+
multi_speaker_examples = gr.Examples( # pylint: disable=unused-variable
|
| 289 |
+
examples=[
|
| 290 |
+
[
|
| 291 |
+
"Hello everyone! I am speaker 0 and I am here to tell you that Matcha-TTS is amazing!",
|
| 292 |
+
10,
|
| 293 |
+
0.677,
|
| 294 |
+
0.85,
|
| 295 |
+
0,
|
| 296 |
+
],
|
| 297 |
+
[
|
| 298 |
+
"Hello everyone! I am speaker 16 and I am here to tell you that Matcha-TTS is amazing!",
|
| 299 |
+
10,
|
| 300 |
+
0.677,
|
| 301 |
+
0.85,
|
| 302 |
+
16,
|
| 303 |
+
],
|
| 304 |
+
[
|
| 305 |
+
"Hello everyone! I am speaker 44 and I am here to tell you that Matcha-TTS is amazing!",
|
| 306 |
+
50,
|
| 307 |
+
0.677,
|
| 308 |
+
0.85,
|
| 309 |
+
44,
|
| 310 |
+
],
|
| 311 |
+
[
|
| 312 |
+
"Hello everyone! I am speaker 45 and I am here to tell you that Matcha-TTS is amazing!",
|
| 313 |
+
50,
|
| 314 |
+
0.677,
|
| 315 |
+
0.85,
|
| 316 |
+
45,
|
| 317 |
+
],
|
| 318 |
+
[
|
| 319 |
+
"Hello everyone! I am speaker 58 and I am here to tell you that Matcha-TTS is amazing!",
|
| 320 |
+
4,
|
| 321 |
+
0.677,
|
| 322 |
+
0.85,
|
| 323 |
+
58,
|
| 324 |
+
],
|
| 325 |
+
],
|
| 326 |
+
fn=multispeaker_example_cacher,
|
| 327 |
+
inputs=[text, n_timesteps, mel_temp, length_scale, spk_slider],
|
| 328 |
+
outputs=[phonetised_text, audio, mel_spectrogram],
|
| 329 |
+
cache_examples=True,
|
| 330 |
+
label="Multi Speaker Examples",
|
| 331 |
+
)
|
| 332 |
+
|
| 333 |
+
model_type.change(lambda x: gr.update(interactive=False), inputs=[synth_btn], outputs=[synth_btn]).then(
|
| 334 |
+
load_model_ui,
|
| 335 |
+
inputs=[model_type, text],
|
| 336 |
+
outputs=[text, synth_btn, spk_slider, example_row_lj_speech, example_row_multispeaker, length_scale],
|
| 337 |
+
)
|
| 338 |
+
|
| 339 |
+
synth_btn.click(
|
| 340 |
+
fn=process_text_gradio,
|
| 341 |
+
inputs=[
|
| 342 |
+
text,
|
| 343 |
+
],
|
| 344 |
+
outputs=[phonetised_text, processed_text, processed_text_len],
|
| 345 |
+
api_name="matcha_tts",
|
| 346 |
+
queue=True,
|
| 347 |
+
).then(
|
| 348 |
+
fn=synthesise_mel,
|
| 349 |
+
inputs=[processed_text, processed_text_len, n_timesteps, mel_temp, length_scale, spk_slider],
|
| 350 |
+
outputs=[audio, mel_spectrogram],
|
| 351 |
+
)
|
| 352 |
+
|
| 353 |
+
demo.queue().launch(share=True)
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
if __name__ == "__main__":
|
| 357 |
+
main()
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/cli.py
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import argparse
|
| 2 |
+
import datetime as dt
|
| 3 |
+
import os
|
| 4 |
+
import warnings
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
import matplotlib.pyplot as plt
|
| 8 |
+
import numpy as np
|
| 9 |
+
import soundfile as sf
|
| 10 |
+
import torch
|
| 11 |
+
|
| 12 |
+
from matcha.hifigan.config import v1
|
| 13 |
+
from matcha.hifigan.denoiser import Denoiser
|
| 14 |
+
from matcha.hifigan.env import AttrDict
|
| 15 |
+
from matcha.hifigan.models import Generator as HiFiGAN
|
| 16 |
+
from matcha.models.matcha_tts import MatchaTTS
|
| 17 |
+
from matcha.text import sequence_to_text, text_to_sequence
|
| 18 |
+
from matcha.utils.utils import assert_model_downloaded, get_user_data_dir, intersperse
|
| 19 |
+
|
| 20 |
+
MATCHA_URLS = {
|
| 21 |
+
"matcha_ljspeech": "https://github.com/shivammehta25/Matcha-TTS-checkpoints/releases/download/v1.0/matcha_ljspeech.ckpt",
|
| 22 |
+
"matcha_vctk": "https://github.com/shivammehta25/Matcha-TTS-checkpoints/releases/download/v1.0/matcha_vctk.ckpt",
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
VOCODER_URLS = {
|
| 26 |
+
"hifigan_T2_v1": "https://github.com/shivammehta25/Matcha-TTS-checkpoints/releases/download/v1.0/generator_v1", # Old url: https://drive.google.com/file/d/14NENd4equCBLyyCSke114Mv6YR_j_uFs/view?usp=drive_link
|
| 27 |
+
"hifigan_univ_v1": "https://github.com/shivammehta25/Matcha-TTS-checkpoints/releases/download/v1.0/g_02500000", # Old url: https://drive.google.com/file/d/1qpgI41wNXFcH-iKq1Y42JlBC9j0je8PW/view?usp=drive_link
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
MULTISPEAKER_MODEL = {
|
| 31 |
+
"matcha_vctk": {"vocoder": "hifigan_univ_v1", "speaking_rate": 0.85, "spk": 0, "spk_range": (0, 107)}
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
SINGLESPEAKER_MODEL = {"matcha_ljspeech": {"vocoder": "hifigan_T2_v1", "speaking_rate": 0.95, "spk": None}}
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def plot_spectrogram_to_numpy(spectrogram, filename):
|
| 38 |
+
fig, ax = plt.subplots(figsize=(12, 3))
|
| 39 |
+
im = ax.imshow(spectrogram, aspect="auto", origin="lower", interpolation="none")
|
| 40 |
+
plt.colorbar(im, ax=ax)
|
| 41 |
+
plt.xlabel("Frames")
|
| 42 |
+
plt.ylabel("Channels")
|
| 43 |
+
plt.title("Synthesised Mel-Spectrogram")
|
| 44 |
+
fig.canvas.draw()
|
| 45 |
+
plt.savefig(filename)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def process_text(i: int, text: str, device: torch.device):
|
| 49 |
+
print(f"[{i}] - Input text: {text}")
|
| 50 |
+
x = torch.tensor(
|
| 51 |
+
intersperse(text_to_sequence(text, ["english_cleaners2"])[0], 0),
|
| 52 |
+
dtype=torch.long,
|
| 53 |
+
device=device,
|
| 54 |
+
)[None]
|
| 55 |
+
x_lengths = torch.tensor([x.shape[-1]], dtype=torch.long, device=device)
|
| 56 |
+
x_phones = sequence_to_text(x.squeeze(0).tolist())
|
| 57 |
+
print(f"[{i}] - Phonetised text: {x_phones[1::2]}")
|
| 58 |
+
|
| 59 |
+
return {"x_orig": text, "x": x, "x_lengths": x_lengths, "x_phones": x_phones}
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def get_texts(args):
|
| 63 |
+
if args.text:
|
| 64 |
+
texts = [args.text]
|
| 65 |
+
else:
|
| 66 |
+
with open(args.file, encoding="utf-8") as f:
|
| 67 |
+
texts = f.readlines()
|
| 68 |
+
return texts
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def assert_required_models_available(args):
|
| 72 |
+
save_dir = get_user_data_dir()
|
| 73 |
+
if not hasattr(args, "checkpoint_path") and args.checkpoint_path is None:
|
| 74 |
+
model_path = args.checkpoint_path
|
| 75 |
+
else:
|
| 76 |
+
model_path = save_dir / f"{args.model}.ckpt"
|
| 77 |
+
assert_model_downloaded(model_path, MATCHA_URLS[args.model])
|
| 78 |
+
|
| 79 |
+
vocoder_path = save_dir / f"{args.vocoder}"
|
| 80 |
+
assert_model_downloaded(vocoder_path, VOCODER_URLS[args.vocoder])
|
| 81 |
+
return {"matcha": model_path, "vocoder": vocoder_path}
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def load_hifigan(checkpoint_path, device):
|
| 85 |
+
h = AttrDict(v1)
|
| 86 |
+
hifigan = HiFiGAN(h).to(device)
|
| 87 |
+
hifigan.load_state_dict(torch.load(checkpoint_path, map_location=device)["generator"])
|
| 88 |
+
_ = hifigan.eval()
|
| 89 |
+
hifigan.remove_weight_norm()
|
| 90 |
+
return hifigan
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def load_vocoder(vocoder_name, checkpoint_path, device):
|
| 94 |
+
print(f"[!] Loading {vocoder_name}!")
|
| 95 |
+
vocoder = None
|
| 96 |
+
if vocoder_name in ("hifigan_T2_v1", "hifigan_univ_v1"):
|
| 97 |
+
vocoder = load_hifigan(checkpoint_path, device)
|
| 98 |
+
else:
|
| 99 |
+
raise NotImplementedError(
|
| 100 |
+
f"Vocoder {vocoder_name} not implemented! define a load_<<vocoder_name>> method for it"
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
denoiser = Denoiser(vocoder, mode="zeros")
|
| 104 |
+
print(f"[+] {vocoder_name} loaded!")
|
| 105 |
+
return vocoder, denoiser
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
def load_matcha(model_name, checkpoint_path, device):
|
| 109 |
+
print(f"[!] Loading {model_name}!")
|
| 110 |
+
model = MatchaTTS.load_from_checkpoint(checkpoint_path, map_location=device)
|
| 111 |
+
_ = model.eval()
|
| 112 |
+
|
| 113 |
+
print(f"[+] {model_name} loaded!")
|
| 114 |
+
return model
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def to_waveform(mel, vocoder, denoiser=None, denoiser_strength=0.00025):
|
| 118 |
+
audio = vocoder(mel).clamp(-1, 1)
|
| 119 |
+
if denoiser is not None:
|
| 120 |
+
audio = denoiser(audio.squeeze(), strength=denoiser_strength).cpu().squeeze()
|
| 121 |
+
|
| 122 |
+
return audio.cpu().squeeze()
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def save_to_folder(filename: str, output: dict, folder: str):
|
| 126 |
+
folder = Path(folder)
|
| 127 |
+
folder.mkdir(exist_ok=True, parents=True)
|
| 128 |
+
plot_spectrogram_to_numpy(np.array(output["mel"].squeeze().float().cpu()), f"{filename}.png")
|
| 129 |
+
np.save(folder / f"{filename}", output["mel"].cpu().numpy())
|
| 130 |
+
sf.write(folder / f"{filename}.wav", output["waveform"], 22050, "PCM_24")
|
| 131 |
+
return folder.resolve() / f"{filename}.wav"
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
def validate_args(args):
|
| 135 |
+
assert (
|
| 136 |
+
args.text or args.file
|
| 137 |
+
), "Either text or file must be provided Matcha-T(ea)TTS need sometext to whisk the waveforms."
|
| 138 |
+
assert args.temperature >= 0, "Sampling temperature cannot be negative"
|
| 139 |
+
assert args.steps > 0, "Number of ODE steps must be greater than 0"
|
| 140 |
+
|
| 141 |
+
if args.checkpoint_path is None:
|
| 142 |
+
# When using pretrained models
|
| 143 |
+
if args.model in SINGLESPEAKER_MODEL:
|
| 144 |
+
args = validate_args_for_single_speaker_model(args)
|
| 145 |
+
|
| 146 |
+
if args.model in MULTISPEAKER_MODEL:
|
| 147 |
+
args = validate_args_for_multispeaker_model(args)
|
| 148 |
+
else:
|
| 149 |
+
# When using a custom model
|
| 150 |
+
if args.vocoder != "hifigan_univ_v1":
|
| 151 |
+
warn_ = "[-] Using custom model checkpoint! I would suggest passing --vocoder hifigan_univ_v1, unless the custom model is trained on LJ Speech."
|
| 152 |
+
warnings.warn(warn_, UserWarning)
|
| 153 |
+
if args.speaking_rate is None:
|
| 154 |
+
args.speaking_rate = 1.0
|
| 155 |
+
|
| 156 |
+
if args.batched:
|
| 157 |
+
assert args.batch_size > 0, "Batch size must be greater than 0"
|
| 158 |
+
assert args.speaking_rate > 0, "Speaking rate must be greater than 0"
|
| 159 |
+
|
| 160 |
+
return args
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
def validate_args_for_multispeaker_model(args):
|
| 164 |
+
if args.vocoder is not None:
|
| 165 |
+
if args.vocoder != MULTISPEAKER_MODEL[args.model]["vocoder"]:
|
| 166 |
+
warn_ = f"[-] Using {args.model} model! I would suggest passing --vocoder {MULTISPEAKER_MODEL[args.model]['vocoder']}"
|
| 167 |
+
warnings.warn(warn_, UserWarning)
|
| 168 |
+
else:
|
| 169 |
+
args.vocoder = MULTISPEAKER_MODEL[args.model]["vocoder"]
|
| 170 |
+
|
| 171 |
+
if args.speaking_rate is None:
|
| 172 |
+
args.speaking_rate = MULTISPEAKER_MODEL[args.model]["speaking_rate"]
|
| 173 |
+
|
| 174 |
+
spk_range = MULTISPEAKER_MODEL[args.model]["spk_range"]
|
| 175 |
+
if args.spk is not None:
|
| 176 |
+
assert (
|
| 177 |
+
args.spk >= spk_range[0] and args.spk <= spk_range[-1]
|
| 178 |
+
), f"Speaker ID must be between {spk_range} for this model."
|
| 179 |
+
else:
|
| 180 |
+
available_spk_id = MULTISPEAKER_MODEL[args.model]["spk"]
|
| 181 |
+
warn_ = f"[!] Speaker ID not provided! Using speaker ID {available_spk_id}"
|
| 182 |
+
warnings.warn(warn_, UserWarning)
|
| 183 |
+
args.spk = available_spk_id
|
| 184 |
+
|
| 185 |
+
return args
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
def validate_args_for_single_speaker_model(args):
|
| 189 |
+
if args.vocoder is not None:
|
| 190 |
+
if args.vocoder != SINGLESPEAKER_MODEL[args.model]["vocoder"]:
|
| 191 |
+
warn_ = f"[-] Using {args.model} model! I would suggest passing --vocoder {SINGLESPEAKER_MODEL[args.model]['vocoder']}"
|
| 192 |
+
warnings.warn(warn_, UserWarning)
|
| 193 |
+
else:
|
| 194 |
+
args.vocoder = SINGLESPEAKER_MODEL[args.model]["vocoder"]
|
| 195 |
+
|
| 196 |
+
if args.speaking_rate is None:
|
| 197 |
+
args.speaking_rate = SINGLESPEAKER_MODEL[args.model]["speaking_rate"]
|
| 198 |
+
|
| 199 |
+
if args.spk != SINGLESPEAKER_MODEL[args.model]["spk"]:
|
| 200 |
+
warn_ = f"[-] Ignoring speaker id {args.spk} for {args.model}"
|
| 201 |
+
warnings.warn(warn_, UserWarning)
|
| 202 |
+
args.spk = SINGLESPEAKER_MODEL[args.model]["spk"]
|
| 203 |
+
|
| 204 |
+
return args
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
@torch.inference_mode()
|
| 208 |
+
def cli():
|
| 209 |
+
parser = argparse.ArgumentParser(
|
| 210 |
+
description=" 🍵 Matcha-TTS: A fast TTS architecture with conditional flow matching"
|
| 211 |
+
)
|
| 212 |
+
parser.add_argument(
|
| 213 |
+
"--model",
|
| 214 |
+
type=str,
|
| 215 |
+
default="matcha_ljspeech",
|
| 216 |
+
help="Model to use",
|
| 217 |
+
choices=MATCHA_URLS.keys(),
|
| 218 |
+
)
|
| 219 |
+
|
| 220 |
+
parser.add_argument(
|
| 221 |
+
"--checkpoint_path",
|
| 222 |
+
type=str,
|
| 223 |
+
default=None,
|
| 224 |
+
help="Path to the custom model checkpoint",
|
| 225 |
+
)
|
| 226 |
+
|
| 227 |
+
parser.add_argument(
|
| 228 |
+
"--vocoder",
|
| 229 |
+
type=str,
|
| 230 |
+
default=None,
|
| 231 |
+
help="Vocoder to use (default: will use the one suggested with the pretrained model))",
|
| 232 |
+
choices=VOCODER_URLS.keys(),
|
| 233 |
+
)
|
| 234 |
+
parser.add_argument("--text", type=str, default=None, help="Text to synthesize")
|
| 235 |
+
parser.add_argument("--file", type=str, default=None, help="Text file to synthesize")
|
| 236 |
+
parser.add_argument("--spk", type=int, default=None, help="Speaker ID")
|
| 237 |
+
parser.add_argument(
|
| 238 |
+
"--temperature",
|
| 239 |
+
type=float,
|
| 240 |
+
default=0.667,
|
| 241 |
+
help="Variance of the x0 noise (default: 0.667)",
|
| 242 |
+
)
|
| 243 |
+
parser.add_argument(
|
| 244 |
+
"--speaking_rate",
|
| 245 |
+
type=float,
|
| 246 |
+
default=None,
|
| 247 |
+
help="change the speaking rate, a higher value means slower speaking rate (default: 1.0)",
|
| 248 |
+
)
|
| 249 |
+
parser.add_argument("--steps", type=int, default=10, help="Number of ODE steps (default: 10)")
|
| 250 |
+
parser.add_argument("--cpu", action="store_true", help="Use CPU for inference (default: use GPU if available)")
|
| 251 |
+
parser.add_argument(
|
| 252 |
+
"--denoiser_strength",
|
| 253 |
+
type=float,
|
| 254 |
+
default=0.00025,
|
| 255 |
+
help="Strength of the vocoder bias denoiser (default: 0.00025)",
|
| 256 |
+
)
|
| 257 |
+
parser.add_argument(
|
| 258 |
+
"--output_folder",
|
| 259 |
+
type=str,
|
| 260 |
+
default=os.getcwd(),
|
| 261 |
+
help="Output folder to save results (default: current dir)",
|
| 262 |
+
)
|
| 263 |
+
parser.add_argument("--batched", action="store_true", help="Batched inference (default: False)")
|
| 264 |
+
parser.add_argument(
|
| 265 |
+
"--batch_size", type=int, default=32, help="Batch size only useful when --batched (default: 32)"
|
| 266 |
+
)
|
| 267 |
+
|
| 268 |
+
args = parser.parse_args()
|
| 269 |
+
|
| 270 |
+
args = validate_args(args)
|
| 271 |
+
device = get_device(args)
|
| 272 |
+
print_config(args)
|
| 273 |
+
paths = assert_required_models_available(args)
|
| 274 |
+
|
| 275 |
+
if args.checkpoint_path is not None:
|
| 276 |
+
print(f"[🍵] Loading custom model from {args.checkpoint_path}")
|
| 277 |
+
paths["matcha"] = args.checkpoint_path
|
| 278 |
+
args.model = "custom_model"
|
| 279 |
+
|
| 280 |
+
model = load_matcha(args.model, paths["matcha"], device)
|
| 281 |
+
vocoder, denoiser = load_vocoder(args.vocoder, paths["vocoder"], device)
|
| 282 |
+
|
| 283 |
+
texts = get_texts(args)
|
| 284 |
+
|
| 285 |
+
spk = torch.tensor([args.spk], device=device, dtype=torch.long) if args.spk is not None else None
|
| 286 |
+
if len(texts) == 1 or not args.batched:
|
| 287 |
+
unbatched_synthesis(args, device, model, vocoder, denoiser, texts, spk)
|
| 288 |
+
else:
|
| 289 |
+
batched_synthesis(args, device, model, vocoder, denoiser, texts, spk)
|
| 290 |
+
|
| 291 |
+
|
| 292 |
+
class BatchedSynthesisDataset(torch.utils.data.Dataset):
|
| 293 |
+
def __init__(self, processed_texts):
|
| 294 |
+
self.processed_texts = processed_texts
|
| 295 |
+
|
| 296 |
+
def __len__(self):
|
| 297 |
+
return len(self.processed_texts)
|
| 298 |
+
|
| 299 |
+
def __getitem__(self, idx):
|
| 300 |
+
return self.processed_texts[idx]
|
| 301 |
+
|
| 302 |
+
|
| 303 |
+
def batched_collate_fn(batch):
|
| 304 |
+
x = []
|
| 305 |
+
x_lengths = []
|
| 306 |
+
|
| 307 |
+
for b in batch:
|
| 308 |
+
x.append(b["x"].squeeze(0))
|
| 309 |
+
x_lengths.append(b["x_lengths"])
|
| 310 |
+
|
| 311 |
+
x = torch.nn.utils.rnn.pad_sequence(x, batch_first=True)
|
| 312 |
+
x_lengths = torch.concat(x_lengths, dim=0)
|
| 313 |
+
return {"x": x, "x_lengths": x_lengths}
|
| 314 |
+
|
| 315 |
+
|
| 316 |
+
def batched_synthesis(args, device, model, vocoder, denoiser, texts, spk):
|
| 317 |
+
total_rtf = []
|
| 318 |
+
total_rtf_w = []
|
| 319 |
+
processed_text = [process_text(i, text, "cpu") for i, text in enumerate(texts)]
|
| 320 |
+
dataloader = torch.utils.data.DataLoader(
|
| 321 |
+
BatchedSynthesisDataset(processed_text),
|
| 322 |
+
batch_size=args.batch_size,
|
| 323 |
+
collate_fn=batched_collate_fn,
|
| 324 |
+
num_workers=8,
|
| 325 |
+
)
|
| 326 |
+
for i, batch in enumerate(dataloader):
|
| 327 |
+
i = i + 1
|
| 328 |
+
start_t = dt.datetime.now()
|
| 329 |
+
b = batch["x"].shape[0]
|
| 330 |
+
output = model.synthesise(
|
| 331 |
+
batch["x"].to(device),
|
| 332 |
+
batch["x_lengths"].to(device),
|
| 333 |
+
n_timesteps=args.steps,
|
| 334 |
+
temperature=args.temperature,
|
| 335 |
+
spks=spk.expand(b) if spk is not None else spk,
|
| 336 |
+
length_scale=args.speaking_rate,
|
| 337 |
+
)
|
| 338 |
+
|
| 339 |
+
output["waveform"] = to_waveform(output["mel"], vocoder, denoiser, args.denoiser_strength)
|
| 340 |
+
t = (dt.datetime.now() - start_t).total_seconds()
|
| 341 |
+
rtf_w = t * 22050 / (output["waveform"].shape[-1])
|
| 342 |
+
print(f"[🍵-Batch: {i}] Matcha-TTS RTF: {output['rtf']:.4f}")
|
| 343 |
+
print(f"[🍵-Batch: {i}] Matcha-TTS + VOCODER RTF: {rtf_w:.4f}")
|
| 344 |
+
total_rtf.append(output["rtf"])
|
| 345 |
+
total_rtf_w.append(rtf_w)
|
| 346 |
+
for j in range(output["mel"].shape[0]):
|
| 347 |
+
base_name = f"utterance_{j:03d}_speaker_{args.spk:03d}" if args.spk is not None else f"utterance_{j:03d}"
|
| 348 |
+
length = output["mel_lengths"][j]
|
| 349 |
+
new_dict = {"mel": output["mel"][j][:, :length], "waveform": output["waveform"][j][: length * 256]}
|
| 350 |
+
location = save_to_folder(base_name, new_dict, args.output_folder)
|
| 351 |
+
print(f"[🍵-{j}] Waveform saved: {location}")
|
| 352 |
+
|
| 353 |
+
print("".join(["="] * 100))
|
| 354 |
+
print(f"[🍵] Average Matcha-TTS RTF: {np.mean(total_rtf):.4f} ± {np.std(total_rtf)}")
|
| 355 |
+
print(f"[🍵] Average Matcha-TTS + VOCODER RTF: {np.mean(total_rtf_w):.4f} ± {np.std(total_rtf_w)}")
|
| 356 |
+
print("[🍵] Enjoy the freshly whisked 🍵 Matcha-TTS!")
|
| 357 |
+
|
| 358 |
+
|
| 359 |
+
def unbatched_synthesis(args, device, model, vocoder, denoiser, texts, spk):
|
| 360 |
+
total_rtf = []
|
| 361 |
+
total_rtf_w = []
|
| 362 |
+
for i, text in enumerate(texts):
|
| 363 |
+
i = i + 1
|
| 364 |
+
base_name = f"utterance_{i:03d}_speaker_{args.spk:03d}" if args.spk is not None else f"utterance_{i:03d}"
|
| 365 |
+
|
| 366 |
+
print("".join(["="] * 100))
|
| 367 |
+
text = text.strip()
|
| 368 |
+
text_processed = process_text(i, text, device)
|
| 369 |
+
|
| 370 |
+
print(f"[🍵] Whisking Matcha-T(ea)TS for: {i}")
|
| 371 |
+
start_t = dt.datetime.now()
|
| 372 |
+
output = model.synthesise(
|
| 373 |
+
text_processed["x"],
|
| 374 |
+
text_processed["x_lengths"],
|
| 375 |
+
n_timesteps=args.steps,
|
| 376 |
+
temperature=args.temperature,
|
| 377 |
+
spks=spk,
|
| 378 |
+
length_scale=args.speaking_rate,
|
| 379 |
+
)
|
| 380 |
+
output["waveform"] = to_waveform(output["mel"], vocoder, denoiser, args.denoiser_strength)
|
| 381 |
+
# RTF with HiFiGAN
|
| 382 |
+
t = (dt.datetime.now() - start_t).total_seconds()
|
| 383 |
+
rtf_w = t * 22050 / (output["waveform"].shape[-1])
|
| 384 |
+
print(f"[🍵-{i}] Matcha-TTS RTF: {output['rtf']:.4f}")
|
| 385 |
+
print(f"[🍵-{i}] Matcha-TTS + VOCODER RTF: {rtf_w:.4f}")
|
| 386 |
+
total_rtf.append(output["rtf"])
|
| 387 |
+
total_rtf_w.append(rtf_w)
|
| 388 |
+
|
| 389 |
+
location = save_to_folder(base_name, output, args.output_folder)
|
| 390 |
+
print(f"[+] Waveform saved: {location}")
|
| 391 |
+
|
| 392 |
+
print("".join(["="] * 100))
|
| 393 |
+
print(f"[🍵] Average Matcha-TTS RTF: {np.mean(total_rtf):.4f} ± {np.std(total_rtf)}")
|
| 394 |
+
print(f"[🍵] Average Matcha-TTS + VOCODER RTF: {np.mean(total_rtf_w):.4f} ± {np.std(total_rtf_w)}")
|
| 395 |
+
print("[🍵] Enjoy the freshly whisked 🍵 Matcha-TTS!")
|
| 396 |
+
|
| 397 |
+
|
| 398 |
+
def print_config(args):
|
| 399 |
+
print("[!] Configurations: ")
|
| 400 |
+
print(f"\t- Model: {args.model}")
|
| 401 |
+
print(f"\t- Vocoder: {args.vocoder}")
|
| 402 |
+
print(f"\t- Temperature: {args.temperature}")
|
| 403 |
+
print(f"\t- Speaking rate: {args.speaking_rate}")
|
| 404 |
+
print(f"\t- Number of ODE steps: {args.steps}")
|
| 405 |
+
print(f"\t- Speaker: {args.spk}")
|
| 406 |
+
|
| 407 |
+
|
| 408 |
+
def get_device(args):
|
| 409 |
+
if torch.cuda.is_available() and not args.cpu:
|
| 410 |
+
print("[+] GPU Available! Using GPU")
|
| 411 |
+
device = torch.device("cuda")
|
| 412 |
+
else:
|
| 413 |
+
print("[-] GPU not available or forced CPU run! Using CPU")
|
| 414 |
+
device = torch.device("cpu")
|
| 415 |
+
return device
|
| 416 |
+
|
| 417 |
+
|
| 418 |
+
if __name__ == "__main__":
|
| 419 |
+
cli()
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/data/__init__.py
ADDED
|
File without changes
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/data/components/__init__.py
ADDED
|
File without changes
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/data/text_mel_datamodule.py
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
from typing import Any, Dict, Optional
|
| 4 |
+
|
| 5 |
+
import numpy as np
|
| 6 |
+
import torch
|
| 7 |
+
import torchaudio as ta
|
| 8 |
+
from lightning import LightningDataModule
|
| 9 |
+
from torch.utils.data.dataloader import DataLoader
|
| 10 |
+
|
| 11 |
+
from matcha.text import text_to_sequence
|
| 12 |
+
from matcha.utils.audio import mel_spectrogram
|
| 13 |
+
from matcha.utils.model import fix_len_compatibility, normalize
|
| 14 |
+
from matcha.utils.utils import intersperse
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def parse_filelist(filelist_path, split_char="|"):
|
| 18 |
+
with open(filelist_path, encoding="utf-8") as f:
|
| 19 |
+
filepaths_and_text = [line.strip().split(split_char) for line in f]
|
| 20 |
+
return filepaths_and_text
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class TextMelDataModule(LightningDataModule):
|
| 24 |
+
def __init__( # pylint: disable=unused-argument
|
| 25 |
+
self,
|
| 26 |
+
name,
|
| 27 |
+
train_filelist_path,
|
| 28 |
+
valid_filelist_path,
|
| 29 |
+
batch_size,
|
| 30 |
+
num_workers,
|
| 31 |
+
pin_memory,
|
| 32 |
+
cleaners,
|
| 33 |
+
add_blank,
|
| 34 |
+
n_spks,
|
| 35 |
+
n_fft,
|
| 36 |
+
n_feats,
|
| 37 |
+
sample_rate,
|
| 38 |
+
hop_length,
|
| 39 |
+
win_length,
|
| 40 |
+
f_min,
|
| 41 |
+
f_max,
|
| 42 |
+
data_statistics,
|
| 43 |
+
seed,
|
| 44 |
+
load_durations,
|
| 45 |
+
):
|
| 46 |
+
super().__init__()
|
| 47 |
+
|
| 48 |
+
# this line allows to access init params with 'self.hparams' attribute
|
| 49 |
+
# also ensures init params will be stored in ckpt
|
| 50 |
+
self.save_hyperparameters(logger=False)
|
| 51 |
+
|
| 52 |
+
def setup(self, stage: Optional[str] = None): # pylint: disable=unused-argument
|
| 53 |
+
"""Load data. Set variables: `self.data_train`, `self.data_val`, `self.data_test`.
|
| 54 |
+
|
| 55 |
+
This method is called by lightning with both `trainer.fit()` and `trainer.test()`, so be
|
| 56 |
+
careful not to execute things like random split twice!
|
| 57 |
+
"""
|
| 58 |
+
# load and split datasets only if not loaded already
|
| 59 |
+
|
| 60 |
+
self.trainset = TextMelDataset( # pylint: disable=attribute-defined-outside-init
|
| 61 |
+
self.hparams.train_filelist_path,
|
| 62 |
+
self.hparams.n_spks,
|
| 63 |
+
self.hparams.cleaners,
|
| 64 |
+
self.hparams.add_blank,
|
| 65 |
+
self.hparams.n_fft,
|
| 66 |
+
self.hparams.n_feats,
|
| 67 |
+
self.hparams.sample_rate,
|
| 68 |
+
self.hparams.hop_length,
|
| 69 |
+
self.hparams.win_length,
|
| 70 |
+
self.hparams.f_min,
|
| 71 |
+
self.hparams.f_max,
|
| 72 |
+
self.hparams.data_statistics,
|
| 73 |
+
self.hparams.seed,
|
| 74 |
+
self.hparams.load_durations,
|
| 75 |
+
)
|
| 76 |
+
self.validset = TextMelDataset( # pylint: disable=attribute-defined-outside-init
|
| 77 |
+
self.hparams.valid_filelist_path,
|
| 78 |
+
self.hparams.n_spks,
|
| 79 |
+
self.hparams.cleaners,
|
| 80 |
+
self.hparams.add_blank,
|
| 81 |
+
self.hparams.n_fft,
|
| 82 |
+
self.hparams.n_feats,
|
| 83 |
+
self.hparams.sample_rate,
|
| 84 |
+
self.hparams.hop_length,
|
| 85 |
+
self.hparams.win_length,
|
| 86 |
+
self.hparams.f_min,
|
| 87 |
+
self.hparams.f_max,
|
| 88 |
+
self.hparams.data_statistics,
|
| 89 |
+
self.hparams.seed,
|
| 90 |
+
self.hparams.load_durations,
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
def train_dataloader(self):
|
| 94 |
+
return DataLoader(
|
| 95 |
+
dataset=self.trainset,
|
| 96 |
+
batch_size=self.hparams.batch_size,
|
| 97 |
+
num_workers=self.hparams.num_workers,
|
| 98 |
+
pin_memory=self.hparams.pin_memory,
|
| 99 |
+
shuffle=True,
|
| 100 |
+
collate_fn=TextMelBatchCollate(self.hparams.n_spks),
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
def val_dataloader(self):
|
| 104 |
+
return DataLoader(
|
| 105 |
+
dataset=self.validset,
|
| 106 |
+
batch_size=self.hparams.batch_size,
|
| 107 |
+
num_workers=self.hparams.num_workers,
|
| 108 |
+
pin_memory=self.hparams.pin_memory,
|
| 109 |
+
shuffle=False,
|
| 110 |
+
collate_fn=TextMelBatchCollate(self.hparams.n_spks),
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
def teardown(self, stage: Optional[str] = None):
|
| 114 |
+
"""Clean up after fit or test."""
|
| 115 |
+
pass # pylint: disable=unnecessary-pass
|
| 116 |
+
|
| 117 |
+
def state_dict(self):
|
| 118 |
+
"""Extra things to save to checkpoint."""
|
| 119 |
+
return {}
|
| 120 |
+
|
| 121 |
+
def load_state_dict(self, state_dict: Dict[str, Any]):
|
| 122 |
+
"""Things to do when loading checkpoint."""
|
| 123 |
+
pass # pylint: disable=unnecessary-pass
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
class TextMelDataset(torch.utils.data.Dataset):
|
| 127 |
+
def __init__(
|
| 128 |
+
self,
|
| 129 |
+
filelist_path,
|
| 130 |
+
n_spks,
|
| 131 |
+
cleaners,
|
| 132 |
+
add_blank=True,
|
| 133 |
+
n_fft=1024,
|
| 134 |
+
n_mels=80,
|
| 135 |
+
sample_rate=22050,
|
| 136 |
+
hop_length=256,
|
| 137 |
+
win_length=1024,
|
| 138 |
+
f_min=0.0,
|
| 139 |
+
f_max=8000,
|
| 140 |
+
data_parameters=None,
|
| 141 |
+
seed=None,
|
| 142 |
+
load_durations=False,
|
| 143 |
+
):
|
| 144 |
+
self.filepaths_and_text = parse_filelist(filelist_path)
|
| 145 |
+
self.n_spks = n_spks
|
| 146 |
+
self.cleaners = cleaners
|
| 147 |
+
self.add_blank = add_blank
|
| 148 |
+
self.n_fft = n_fft
|
| 149 |
+
self.n_mels = n_mels
|
| 150 |
+
self.sample_rate = sample_rate
|
| 151 |
+
self.hop_length = hop_length
|
| 152 |
+
self.win_length = win_length
|
| 153 |
+
self.f_min = f_min
|
| 154 |
+
self.f_max = f_max
|
| 155 |
+
self.load_durations = load_durations
|
| 156 |
+
|
| 157 |
+
if data_parameters is not None:
|
| 158 |
+
self.data_parameters = data_parameters
|
| 159 |
+
else:
|
| 160 |
+
self.data_parameters = {"mel_mean": 0, "mel_std": 1}
|
| 161 |
+
random.seed(seed)
|
| 162 |
+
random.shuffle(self.filepaths_and_text)
|
| 163 |
+
|
| 164 |
+
def get_datapoint(self, filepath_and_text):
|
| 165 |
+
if self.n_spks > 1:
|
| 166 |
+
filepath, spk, text = (
|
| 167 |
+
filepath_and_text[0],
|
| 168 |
+
int(filepath_and_text[1]),
|
| 169 |
+
filepath_and_text[2],
|
| 170 |
+
)
|
| 171 |
+
else:
|
| 172 |
+
filepath, text = filepath_and_text[0], filepath_and_text[1]
|
| 173 |
+
spk = None
|
| 174 |
+
|
| 175 |
+
text, cleaned_text = self.get_text(text, add_blank=self.add_blank)
|
| 176 |
+
mel = self.get_mel(filepath)
|
| 177 |
+
|
| 178 |
+
durations = self.get_durations(filepath, text) if self.load_durations else None
|
| 179 |
+
|
| 180 |
+
return {"x": text, "y": mel, "spk": spk, "filepath": filepath, "x_text": cleaned_text, "durations": durations}
|
| 181 |
+
|
| 182 |
+
def get_durations(self, filepath, text):
|
| 183 |
+
filepath = Path(filepath)
|
| 184 |
+
data_dir, name = filepath.parent.parent, filepath.stem
|
| 185 |
+
|
| 186 |
+
try:
|
| 187 |
+
dur_loc = data_dir / "durations" / f"{name}.npy"
|
| 188 |
+
durs = torch.from_numpy(np.load(dur_loc).astype(int))
|
| 189 |
+
|
| 190 |
+
except FileNotFoundError as e:
|
| 191 |
+
raise FileNotFoundError(
|
| 192 |
+
f"Tried loading the durations but durations didn't exist at {dur_loc}, make sure you've generate the durations first using: python matcha/utils/get_durations_from_trained_model.py \n"
|
| 193 |
+
) from e
|
| 194 |
+
|
| 195 |
+
assert len(durs) == len(text), f"Length of durations {len(durs)} and text {len(text)} do not match"
|
| 196 |
+
|
| 197 |
+
return durs
|
| 198 |
+
|
| 199 |
+
def get_mel(self, filepath):
|
| 200 |
+
audio, sr = ta.load(filepath)
|
| 201 |
+
assert sr == self.sample_rate
|
| 202 |
+
mel = mel_spectrogram(
|
| 203 |
+
audio,
|
| 204 |
+
self.n_fft,
|
| 205 |
+
self.n_mels,
|
| 206 |
+
self.sample_rate,
|
| 207 |
+
self.hop_length,
|
| 208 |
+
self.win_length,
|
| 209 |
+
self.f_min,
|
| 210 |
+
self.f_max,
|
| 211 |
+
center=False,
|
| 212 |
+
).squeeze()
|
| 213 |
+
mel = normalize(mel, self.data_parameters["mel_mean"], self.data_parameters["mel_std"])
|
| 214 |
+
return mel
|
| 215 |
+
|
| 216 |
+
def get_text(self, text, add_blank=True):
|
| 217 |
+
text_norm, cleaned_text = text_to_sequence(text, self.cleaners)
|
| 218 |
+
if self.add_blank:
|
| 219 |
+
text_norm = intersperse(text_norm, 0)
|
| 220 |
+
text_norm = torch.IntTensor(text_norm)
|
| 221 |
+
return text_norm, cleaned_text
|
| 222 |
+
|
| 223 |
+
def __getitem__(self, index):
|
| 224 |
+
datapoint = self.get_datapoint(self.filepaths_and_text[index])
|
| 225 |
+
return datapoint
|
| 226 |
+
|
| 227 |
+
def __len__(self):
|
| 228 |
+
return len(self.filepaths_and_text)
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
class TextMelBatchCollate:
|
| 232 |
+
def __init__(self, n_spks):
|
| 233 |
+
self.n_spks = n_spks
|
| 234 |
+
|
| 235 |
+
def __call__(self, batch):
|
| 236 |
+
B = len(batch)
|
| 237 |
+
y_max_length = max([item["y"].shape[-1] for item in batch])
|
| 238 |
+
y_max_length = fix_len_compatibility(y_max_length)
|
| 239 |
+
x_max_length = max([item["x"].shape[-1] for item in batch])
|
| 240 |
+
n_feats = batch[0]["y"].shape[-2]
|
| 241 |
+
|
| 242 |
+
y = torch.zeros((B, n_feats, y_max_length), dtype=torch.float32)
|
| 243 |
+
x = torch.zeros((B, x_max_length), dtype=torch.long)
|
| 244 |
+
durations = torch.zeros((B, x_max_length), dtype=torch.long)
|
| 245 |
+
|
| 246 |
+
y_lengths, x_lengths = [], []
|
| 247 |
+
spks = []
|
| 248 |
+
filepaths, x_texts = [], []
|
| 249 |
+
for i, item in enumerate(batch):
|
| 250 |
+
y_, x_ = item["y"], item["x"]
|
| 251 |
+
y_lengths.append(y_.shape[-1])
|
| 252 |
+
x_lengths.append(x_.shape[-1])
|
| 253 |
+
y[i, :, : y_.shape[-1]] = y_
|
| 254 |
+
x[i, : x_.shape[-1]] = x_
|
| 255 |
+
spks.append(item["spk"])
|
| 256 |
+
filepaths.append(item["filepath"])
|
| 257 |
+
x_texts.append(item["x_text"])
|
| 258 |
+
if item["durations"] is not None:
|
| 259 |
+
durations[i, : item["durations"].shape[-1]] = item["durations"]
|
| 260 |
+
|
| 261 |
+
y_lengths = torch.tensor(y_lengths, dtype=torch.long)
|
| 262 |
+
x_lengths = torch.tensor(x_lengths, dtype=torch.long)
|
| 263 |
+
spks = torch.tensor(spks, dtype=torch.long) if self.n_spks > 1 else None
|
| 264 |
+
|
| 265 |
+
return {
|
| 266 |
+
"x": x,
|
| 267 |
+
"x_lengths": x_lengths,
|
| 268 |
+
"y": y,
|
| 269 |
+
"y_lengths": y_lengths,
|
| 270 |
+
"spks": spks,
|
| 271 |
+
"filepaths": filepaths,
|
| 272 |
+
"x_texts": x_texts,
|
| 273 |
+
"durations": durations if not torch.eq(durations, 0).all() else None,
|
| 274 |
+
}
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/hifigan/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis
|
| 2 |
+
|
| 3 |
+
### Jungil Kong, Jaehyeon Kim, Jaekyoung Bae
|
| 4 |
+
|
| 5 |
+
In our [paper](https://arxiv.org/abs/2010.05646),
|
| 6 |
+
we proposed HiFi-GAN: a GAN-based model capable of generating high fidelity speech efficiently.<br/>
|
| 7 |
+
We provide our implementation and pretrained models as open source in this repository.
|
| 8 |
+
|
| 9 |
+
**Abstract :**
|
| 10 |
+
Several recent work on speech synthesis have employed generative adversarial networks (GANs) to produce raw waveforms.
|
| 11 |
+
Although such methods improve the sampling efficiency and memory usage,
|
| 12 |
+
their sample quality has not yet reached that of autoregressive and flow-based generative models.
|
| 13 |
+
In this work, we propose HiFi-GAN, which achieves both efficient and high-fidelity speech synthesis.
|
| 14 |
+
As speech audio consists of sinusoidal signals with various periods,
|
| 15 |
+
we demonstrate that modeling periodic patterns of an audio is crucial for enhancing sample quality.
|
| 16 |
+
A subjective human evaluation (mean opinion score, MOS) of a single speaker dataset indicates that our proposed method
|
| 17 |
+
demonstrates similarity to human quality while generating 22.05 kHz high-fidelity audio 167.9 times faster than
|
| 18 |
+
real-time on a single V100 GPU. We further show the generality of HiFi-GAN to the mel-spectrogram inversion of unseen
|
| 19 |
+
speakers and end-to-end speech synthesis. Finally, a small footprint version of HiFi-GAN generates samples 13.4 times
|
| 20 |
+
faster than real-time on CPU with comparable quality to an autoregressive counterpart.
|
| 21 |
+
|
| 22 |
+
Visit our [demo website](https://jik876.github.io/hifi-gan-demo/) for audio samples.
|
| 23 |
+
|
| 24 |
+
## Pre-requisites
|
| 25 |
+
|
| 26 |
+
1. Python >= 3.6
|
| 27 |
+
2. Clone this repository.
|
| 28 |
+
3. Install python requirements. Please refer [requirements.txt](requirements.txt)
|
| 29 |
+
4. Download and extract the [LJ Speech dataset](https://keithito.com/LJ-Speech-Dataset/).
|
| 30 |
+
And move all wav files to `LJSpeech-1.1/wavs`
|
| 31 |
+
|
| 32 |
+
## Training
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
python train.py --config config_v1.json
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
To train V2 or V3 Generator, replace `config_v1.json` with `config_v2.json` or `config_v3.json`.<br>
|
| 39 |
+
Checkpoints and copy of the configuration file are saved in `cp_hifigan` directory by default.<br>
|
| 40 |
+
You can change the path by adding `--checkpoint_path` option.
|
| 41 |
+
|
| 42 |
+
Validation loss during training with V1 generator.<br>
|
| 43 |
+

|
| 44 |
+
|
| 45 |
+
## Pretrained Model
|
| 46 |
+
|
| 47 |
+
You can also use pretrained models we provide.<br/>
|
| 48 |
+
[Download pretrained models](https://drive.google.com/drive/folders/1-eEYTB5Av9jNql0WGBlRoi-WH2J7bp5Y?usp=sharing)<br/>
|
| 49 |
+
Details of each folder are as in follows:
|
| 50 |
+
|
| 51 |
+
| Folder Name | Generator | Dataset | Fine-Tuned |
|
| 52 |
+
| ------------ | --------- | --------- | ------------------------------------------------------ |
|
| 53 |
+
| LJ_V1 | V1 | LJSpeech | No |
|
| 54 |
+
| LJ_V2 | V2 | LJSpeech | No |
|
| 55 |
+
| LJ_V3 | V3 | LJSpeech | No |
|
| 56 |
+
| LJ_FT_T2_V1 | V1 | LJSpeech | Yes ([Tacotron2](https://github.com/NVIDIA/tacotron2)) |
|
| 57 |
+
| LJ_FT_T2_V2 | V2 | LJSpeech | Yes ([Tacotron2](https://github.com/NVIDIA/tacotron2)) |
|
| 58 |
+
| LJ_FT_T2_V3 | V3 | LJSpeech | Yes ([Tacotron2](https://github.com/NVIDIA/tacotron2)) |
|
| 59 |
+
| VCTK_V1 | V1 | VCTK | No |
|
| 60 |
+
| VCTK_V2 | V2 | VCTK | No |
|
| 61 |
+
| VCTK_V3 | V3 | VCTK | No |
|
| 62 |
+
| UNIVERSAL_V1 | V1 | Universal | No |
|
| 63 |
+
|
| 64 |
+
We provide the universal model with discriminator weights that can be used as a base for transfer learning to other datasets.
|
| 65 |
+
|
| 66 |
+
## Fine-Tuning
|
| 67 |
+
|
| 68 |
+
1. Generate mel-spectrograms in numpy format using [Tacotron2](https://github.com/NVIDIA/tacotron2) with teacher-forcing.<br/>
|
| 69 |
+
The file name of the generated mel-spectrogram should match the audio file and the extension should be `.npy`.<br/>
|
| 70 |
+
Example:
|
| 71 |
+
` Audio File : LJ001-0001.wav
|
| 72 |
+
Mel-Spectrogram File : LJ001-0001.npy`
|
| 73 |
+
2. Create `ft_dataset` folder and copy the generated mel-spectrogram files into it.<br/>
|
| 74 |
+
3. Run the following command.
|
| 75 |
+
```
|
| 76 |
+
python train.py --fine_tuning True --config config_v1.json
|
| 77 |
+
```
|
| 78 |
+
For other command line options, please refer to the training section.
|
| 79 |
+
|
| 80 |
+
## Inference from wav file
|
| 81 |
+
|
| 82 |
+
1. Make `test_files` directory and copy wav files into the directory.
|
| 83 |
+
2. Run the following command.
|
| 84 |
+
` python inference.py --checkpoint_file [generator checkpoint file path]`
|
| 85 |
+
Generated wav files are saved in `generated_files` by default.<br>
|
| 86 |
+
You can change the path by adding `--output_dir` option.
|
| 87 |
+
|
| 88 |
+
## Inference for end-to-end speech synthesis
|
| 89 |
+
|
| 90 |
+
1. Make `test_mel_files` directory and copy generated mel-spectrogram files into the directory.<br>
|
| 91 |
+
You can generate mel-spectrograms using [Tacotron2](https://github.com/NVIDIA/tacotron2),
|
| 92 |
+
[Glow-TTS](https://github.com/jaywalnut310/glow-tts) and so forth.
|
| 93 |
+
2. Run the following command.
|
| 94 |
+
` python inference_e2e.py --checkpoint_file [generator checkpoint file path]`
|
| 95 |
+
Generated wav files are saved in `generated_files_from_mel` by default.<br>
|
| 96 |
+
You can change the path by adding `--output_dir` option.
|
| 97 |
+
|
| 98 |
+
## Acknowledgements
|
| 99 |
+
|
| 100 |
+
We referred to [WaveGlow](https://github.com/NVIDIA/waveglow), [MelGAN](https://github.com/descriptinc/melgan-neurips)
|
| 101 |
+
and [Tacotron2](https://github.com/NVIDIA/tacotron2) to implement this.
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/hifigan/__init__.py
ADDED
|
File without changes
|
runtime/matcha_tts_src/matcha-tts-0.0.7.2/matcha/hifigan/config.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
v1 = {
|
| 2 |
+
"resblock": "1",
|
| 3 |
+
"num_gpus": 0,
|
| 4 |
+
"batch_size": 16,
|
| 5 |
+
"learning_rate": 0.0004,
|
| 6 |
+
"adam_b1": 0.8,
|
| 7 |
+
"adam_b2": 0.99,
|
| 8 |
+
"lr_decay": 0.999,
|
| 9 |
+
"seed": 1234,
|
| 10 |
+
"upsample_rates": [8, 8, 2, 2],
|
| 11 |
+
"upsample_kernel_sizes": [16, 16, 4, 4],
|
| 12 |
+
"upsample_initial_channel": 512,
|
| 13 |
+
"resblock_kernel_sizes": [3, 7, 11],
|
| 14 |
+
"resblock_dilation_sizes": [[1, 3, 5], [1, 3, 5], [1, 3, 5]],
|
| 15 |
+
"resblock_initial_channel": 256,
|
| 16 |
+
"segment_size": 8192,
|
| 17 |
+
"num_mels": 80,
|
| 18 |
+
"num_freq": 1025,
|
| 19 |
+
"n_fft": 1024,
|
| 20 |
+
"hop_size": 256,
|
| 21 |
+
"win_size": 1024,
|
| 22 |
+
"sampling_rate": 22050,
|
| 23 |
+
"fmin": 0,
|
| 24 |
+
"fmax": 8000,
|
| 25 |
+
"fmax_loss": None,
|
| 26 |
+
"num_workers": 4,
|
| 27 |
+
"dist_config": {"dist_backend": "nccl", "dist_url": "tcp://localhost:54321", "world_size": 1},
|
| 28 |
+
}
|