AI 跟练的素材生产工具,产物写入 TUICallKit-Vue3/training: - 教练动作帧:AI 设定稿 → 切帧对齐、锁脸、插帧 → 导出小程序帧与 COS 高清帧 - 示范视频:Remotion 渲染四个动作的示范视频 - 背景音乐:程序合成的原创循环音乐(npm run bgm)
22 lines
800 B
Python
22 lines
800 B
Python
"""
|
||
采用设定稿:work/sheets/<动作>.png → assets/sheets/<动作>.webp(无损,约为 PNG 的一半大小)
|
||
|
||
用法:python3 coach_adopt.py <动作> [动作 ...]
|
||
"""
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
from PIL import Image
|
||
|
||
ROOT = Path(__file__).resolve().parents[1]
|
||
|
||
if __name__ == "__main__":
|
||
for move in sys.argv[1:]:
|
||
src = ROOT / "work" / "sheets" / f"{move}.png"
|
||
im = Image.open(src)
|
||
if im.mode != "RGBA" or im.getchannel("A").getextrema()[0] > 0:
|
||
raise SystemExit(f"{src.name} 不是透明背景,不能使用")
|
||
dst = ROOT / "assets" / "sheets" / f"{move}.webp"
|
||
im.save(dst, lossless=True, quality=100, method=6)
|
||
print(f"已采用 {src.relative_to(ROOT)} → {dst.relative_to(ROOT)}({im.width}×{im.height})")
|