@dsh-gis/dsh-video-studio-skill 0.4.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +93 -18
  2. package/docs/styles/demo-results.json +76 -0
  3. package/docs/styles/sheet-8-styles.png +0 -0
  4. package/docs/styles/sheet-ai.png +0 -0
  5. package/docs/styles/sheet-craft.png +0 -0
  6. package/docs/styles/sheet-night.png +0 -0
  7. package/index.js +20 -7
  8. package/package.json +13 -3
  9. package/schemas/film.schema.json +599 -0
  10. package/skills/video-studio/SKILL.md +252 -28
  11. package/skills/video-studio/assets/film.json +78 -24
  12. package/skills/video-studio/assets/scenes.py +1005 -42
  13. package/skills/video-studio/assets/web/engine.js +18 -1
  14. package/skills/video-studio/assets/web/film.js +29 -4
  15. package/skills/video-studio/assets/web/index.html +5 -0
  16. package/skills/video-studio/references/audio-variation.md +158 -0
  17. package/skills/video-studio/references/audio.md +96 -6
  18. package/skills/video-studio/references/change-impact.md +54 -0
  19. package/skills/video-studio/references/quality-gates.md +1 -1
  20. package/skills/video-studio/references/style-packs.md +178 -0
  21. package/skills/video-studio/references/web-engine.md +1 -1
  22. package/skills/video-studio/requirements.txt +13 -1
  23. package/skills/video-studio/scripts/filmcheck.py +725 -0
  24. package/skills/video-studio/scripts/filmkit.py +953 -76
  25. package/skills/video-studio/scripts/gates.py +509 -0
  26. package/skills/video-studio/scripts/qa_frames.py +109 -19
  27. package/skills/video-studio/scripts/render.py +942 -45
  28. package/skills/video-studio/scripts/scorekit.py +1887 -27
  29. package/skills/video-studio/scripts/selfcheck.py +648 -2
  30. package/skills/video-studio/scripts/sfxkit.py +132 -30
  31. package/skills/video-studio/scripts/stagewatch.py +405 -0
  32. package/skills/video-studio/scripts/stylekit.py +1012 -0
  33. package/skills/video-studio/scripts/voicekit.py +880 -0
  34. package/skills/video-studio/scripts/webengine.py +68 -14
  35. package/tools/audio_similarity.py +279 -0
  36. package/tools/ci_check.py +450 -0
  37. package/tools/estimate.py +657 -0
  38. package/tools/selftest_noscipy.py +70 -0
@@ -0,0 +1,70 @@
1
+ # -*- coding: utf-8 -*-
2
+ r"""selftest_noscipy.py — 在"没有 scipy"的环境里跑可选模块的自检。
3
+
4
+ 为什么需要它:scipy 在 requirements.txt 里是**可选**依赖,没装 scipy 的用户会走
5
+ "分块 FFT 卷积"兜底路径——那是他们真正运行的代码,必须在 CI 里被测到。
6
+ 本地开发机装了 scipy,所以要用这个脚本把 scipy 屏蔽掉再跑。
7
+
8
+ 为什么用子进程:每个模块都在干净解释器里跑,避免"上一个模块已经把 scipy 用上了"
9
+ 这种互相污染;同时能保证 sys.modules['scipy'] = None 在 import 之前就生效。
10
+
11
+ 用法:
12
+ python tools/selftest_noscipy.py # 默认 sfxkit scorekit
13
+ python tools/selftest_noscipy.py sfxkit # 只跑指定模块
14
+
15
+ 退出码:任一模块自检失败即返回 1。
16
+ """
17
+ from __future__ import annotations
18
+
19
+ import os
20
+ import subprocess
21
+ import sys
22
+ from pathlib import Path
23
+
24
+ ROOT = Path(__file__).resolve().parent.parent
25
+ SCRIPTS = ROOT / "skills" / "video-studio" / "scripts"
26
+
27
+ # 子进程里先屏蔽 scipy,再 import 目标模块并跑它的 selftest()。
28
+ RUNNER = r"""
29
+ import sys
30
+ sys.modules["scipy"] = None # 模拟"没装 scipy":import scipy 抛 ImportError
31
+ sys.path.insert(0, sys.argv[1])
32
+ name = sys.argv[2]
33
+ mod = __import__(name)
34
+
35
+ # 自证屏蔽真的生效:sfxkit 模块级 _sig 必须是 None(它是全仓库唯一的 scipy 入口)。
36
+ sfx = getattr(mod, "S", None) if name != "sfxkit" else mod
37
+ sig = getattr(sfx, "_sig", None) if sfx is not None else None
38
+ if name in ("sfxkit", "scorekit") and sig is not None:
39
+ print("屏蔽失败:%s 仍然拿到了 scipy" % name, file=sys.stderr)
40
+ raise SystemExit(2)
41
+
42
+ raise SystemExit(mod.selftest())
43
+ """
44
+
45
+
46
+ def main(argv=None) -> int:
47
+ args = list(argv if argv is not None else sys.argv[1:])
48
+ modules = args or ["sfxkit", "scorekit"]
49
+ bad = []
50
+ for name in modules:
51
+ print("=" * 70)
52
+ print("[无 scipy 兜底路径] %s --selftest" % name)
53
+ print("=" * 70, flush=True)
54
+ proc = subprocess.run(
55
+ [sys.executable, "-c", RUNNER, str(SCRIPTS), name],
56
+ cwd=str(SCRIPTS),
57
+ env={**os.environ, "PYTHONDONTWRITEBYTECODE": "1"},
58
+ )
59
+ if proc.returncode != 0:
60
+ bad.append("%s (exit %d)" % (name, proc.returncode))
61
+ print()
62
+ if bad:
63
+ print("无 scipy 兜底路径自检失败:%s" % ", ".join(bad))
64
+ return 1
65
+ print("无 scipy 兜底路径自检全部通过:%s" % ", ".join(modules))
66
+ return 0
67
+
68
+
69
+ if __name__ == "__main__":
70
+ sys.exit(main())