arXiv:2510.01174cs.CVcs.AI2025-10被引 21

用代码生成教育视频,让每帧都精准可控。

Code2Video: A Code-centric Paradigm for Educational Video Generation

  • 通过代码驱动的三元代理架构,实现教学内容到视频的自动转化。
  • 在专业视频基准上,生成效果接近人工制作,知识传递能力提升40%。
  • 适合教育科技、自动化课件开发等需要精确控制的场景。

尽管近期生成模型在像素空间视频合成方面取得进展,但其在生成专业教育视频方面仍受限,因这类视频需具备学科知识、精确视觉结构和连贯转场。为此,本文提出Code2Video——一种基于可执行Python代码的教育视频生成框架。该框架包含三个协同代理:(i) Planner负责将教学内容组织为时间连贯的流程并准备视觉素材;(ii) Coder将结构化指令转化为可执行代码,并引入作用域引导的自动修复机制以提高效率;(iii) Critic利用视觉-语言模型(VLM)与视觉锚点提示,优化空间布局并确保清晰度。为支持系统评估,我们构建了MMMC基准数据集,涵盖多个学科领域的真实教育视频。我们在多种维度进行评估,包括VLM作为裁判的美学评分、代码效率,以及创新的TeachQuiz指标——衡量生成视频是否能帮助已遗忘知识的VLM恢复学习。结果表明,Code2Video是一种可扩展、可解释且可控的方法,在多项指标上优于直接代码生成,生成视频质量接近人工制作教程。代码与数据集已公开于https://github.com/showlab/Code2Video。

原文摘要 · Abstract (English)

While recent generative models advance pixel-space video synthesis, they remain limited in producing professional educational videos, which demand disciplinary knowledge, precise visual structures, and coherent transitions, limiting their applicability in educational scenarios. Intuitively, such requirements are better addressed through the manipulation of a renderable environment, which can be explicitly controlled via logical commands (e.g., code). In this work, we propose Code2Video, a code-centric agent framework for generating educational videos via executable Python code. The framework comprises three collaborative agents: (i) Planner, which structures lecture content into temporally coherent flows and prepares corresponding visual assets; (ii) Coder, which converts structured instructions into executable Python codes while incorporating scope-guided auto-fix to enhance efficiency; and (iii) Critic, which leverages vision-language models (VLM) with visual anchor prompts to refine spatial layout and ensure clarity. To support systematic evaluation, we build MMMC, a benchmark of professionally produced, discipline-specific educational videos. We evaluate MMMC across diverse dimensions, including VLM-as-a-Judge aesthetic scores, code efficiency, and particularly, TeachQuiz, a novel end-to-end metric that quantifies how well a VLM, after unlearning, can recover knowledge by watching the generated videos. Our results demonstrate the potential of Code2Video as a scalable, interpretable, and controllable approach, achieving 40% improvement over direct code generation and producing videos comparable to human-crafted tutorials. The code and datasets are available at https://github.com/showlab/Code2Video.

视频生成代码驱动教育AI可控生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。