{"id":31888829,"url":"https://showlab.github.io/Code2Video/","last_synced_at":"2025-10-13T06:05:39.978Z","repository":{"id":317168178,"uuid":"1066243512","full_name":"showlab/Code2Video","owner":"showlab","description":"Video generation via code","archived":false,"fork":false,"pushed_at":"2025-10-07T11:13:59.000Z","size":130189,"stargazers_count":374,"open_issues_count":0,"forks_count":41,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-07T13:19:30.747Z","etag":null,"topics":["coding","education","multi-agent","video-generation"],"latest_commit_sha":null,"homepage":"https://showlab.github.io/Code2Video/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/showlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T08:15:44.000Z","updated_at":"2025-10-07T13:10:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4a4aa56-b66e-47c1-890b-db5e22da80dc","html_url":"https://github.com/showlab/Code2Video","commit_stats":null,"previous_names":["showlab/code2video"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/showlab/Code2Video","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showlab%2FCode2Video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showlab%2FCode2Video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showlab%2FCode2Video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showlab%2FCode2Video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/showlab","download_url":"https://codeload.github.com/showlab/Code2Video/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showlab%2FCode2Video/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013944,"owners_count":26085431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding","education","multi-agent","video-generation"],"created_at":"2025-10-13T06:01:52.019Z","updated_at":"2025-10-13T06:05:39.969Z","avatar_url":"https://github.com/showlab.png","language":"Python","funding_links":[],"categories":["Table of Contents \u003c!-- omit in toc --\u003e"],"sub_categories":["Code-rendered Video Generation"],"readme":"\n# Code2Video: Video Generation via Code\n\n\u003cp align=\"right\"\u003e\n  \u003cb\u003eEnglish\u003c/b\u003e | \u003ca href=\"./README.zh-CN.md\"\u003e简体中文\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eCode2Video: A Code-centric Paradigm for Educational Video Generation\u003c/b\u003e\n\u003cbr\u003e\n以代码为中心的教学视频生成新范式\n\u003c/p\u003e\n\u003cvideo src=\"assets/video.mp4\" width=\"600\" controls\u003e\n  Your browser does not support the video tag.\n\u003c/video\u003e\n\n\n\n\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://scholar.google.com.hk/citations?user=9lIMS-EAAAAJ\u0026hl=zh-CN\u0026oi=sra\"\u003eYanzhe Chen*\u003c/a\u003e,\n  \u003ca href=\"https://qhlin.me/\"\u003eKevin Qinghong Lin*\u003c/a\u003e,\n  \u003ca href=\"https://scholar.google.com/citations?user=h1-3lSoAAAAJ\u0026hl=en\"\u003eMike Zheng Shou\u003c/a\u003e \u003cbr\u003e\n  Show Lab @ National University of Singapore\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://arxiv.org/abs/2510.01174\"\u003e📄 Paper\u003c/a\u003e \u0026nbsp; | \u0026nbsp;\n  \u003ca href=\"https://huggingface.co/papers/2510.01174\"\u003e🤗 Daily Paper\u003c/a\u003e \u0026nbsp; | \u0026nbsp;\n  \u003ca href=\"https://huggingface.co/datasets/YanzheChen/MMMC\"\u003e🤗 Dataset\u003c/a\u003e \u0026nbsp; | \u0026nbsp;\n  \u003ca href=\"https://showlab.github.io/Code2Video/\"\u003e🌐 Project Website\u003c/a\u003e \u0026nbsp; | \u0026nbsp;\n  \u003ca href=\"https://x.com/KevinQHLin/status/1974199353695941114\"\u003e💬 X (Twitter)\u003c/a\u003e\n\u003c/p\u003e\n\nhttps://github.com/user-attachments/assets/d906423f-734a-41c9-b102-b113ad3b3c25\n\n\n\n\u003c!-- \u003cp align=\"center\"\u003e\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth style=\"text-align: center;\"\u003eLearning Topic\u003c/th\u003e\n      \u003cth style=\"text-align: center;\"\u003eVeo3\u003c/th\u003e\n      \u003cth style=\"text-align: center;\"\u003eWan2.2\u003c/th\u003e\n      \u003cth style=\"text-align: center;\"\u003eCode2Video (Ours)\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd style=\"text-align: center; vertical-align: middle;\"\u003e\u003cstrong\u003eHanoi Problem\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/veo/Hanoi.gif\"\u003e\n      \u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/wan/Hanoi.gif\"\u003e\n      \u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/code2video/Hanoi_4K_SpeedUp.gif\"\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd style=\"text-align: center; vertical-align: middle;\"\u003e\u003cstrong\u003eLarge Language Model\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/veo/LLM.gif\"\u003e\n      \u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/wan/LLM.gif\"\u003e\n      \u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/code2video/LLM_speed.gif\"\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd style=\"text-align: center; vertical-align: middle;\"\u003e\u003cstrong\u003ePure Fourier Series\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/veo/fourier.gif\"\u003e\n      \u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/wan/fourier.gif\"\u003e\n      \u003c/td\u003e\n      \u003ctd style=\"text-align: center;\"\u003e\n        \u003cimg src=\"assets/videos/code2video/fourier_speed.gif\"\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e --\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ctable style=\"width: 90%; border-collapse: collapse; text-align: center; margin: auto;\"\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth style=\"text-align: center; padding: 8px;\"\u003eLearning Topic\u003c/th\u003e\n      \u003cth style=\"text-align: center; padding: 8px;\"\u003eVeo3\u003c/th\u003e\n      \u003cth style=\"text-align: center; padding: 8px;\"\u003eWan2.2\u003c/th\u003e\n      \u003cth style=\"text-align: center; padding: 8px;\"\u003eCode2Video (Ours)\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd style=\"text-align: center; vertical-align: middle; font-weight: bold;\"\u003eHanoi Problem\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/veo/Hanoi.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/wan/Hanoi.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/code2video/Hanoi_4K_SpeedUp.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd style=\"text-align: center; vertical-align: middle; font-weight: bold;\"\u003eLarge Language Model\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/veo/LLM.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/wan/LLM.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/code2video/LLM_speed.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd style=\"text-align: center; vertical-align: middle; font-weight: bold;\"\u003ePure Fourier Series\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/veo/fourier.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/wan/fourier.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cdiv style=\"width: 320px; aspect-ratio: 16 / 9; overflow: hidden; margin: auto;\"\u003e\n          \u003cimg src=\"assets/videos/code2video/fourier_speed.gif\" style=\"width: 100%; height: 100%; object-fit: cover;\"\u003e\n        \u003c/div\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e\n\n---\n\n## 🔥 Update\n- [x] [2025.10.11] Due to issues on [ICONFINDER](https://www.iconfinder.com/account/applications), we’ve updated Code2Video auto-collected icons at [MMMC](https://huggingface.co/datasets/YanzheChen/MMMC/tree/main/assets) as a temporary alternative.\n- [x] [2025.10.6] We have updated the ground truth human-made videos and metadata for the [MMMC](https://huggingface.co/datasets/YanzheChen/MMMC) dataset.\n- [x] [2025.10.3] Thanks @_akhaliq for sharing our work on [Twitter](https://x.com/_akhaliq/status/1974189217304780863)!\n- [x] [2025.10.2] We release the [arXiv](https://arxiv.org/abs/2510.01174), [code](https://github.com/showlab/Code2Video) and [dataset](https://huggingface.co/datasets/YanzheChen/MMMC) .\n- [x] [2025.9.22] Code2Video has been accepted to the **Deep Learning for Code ([DL4C](https://dl4c.github.io/)) Workshop at NeurIPS 2025**.\n\n\n---\n\n### Table of Contents\n- [🌟 Overview](#-overview)\n- [🚀 Quick Start: Code2Video](#-try-code2video)\n  - [1. Requirements](#1-requirements)\n  - [2. Configure LLM API Keys](#2-configure-llm-api-keys)\n  - [3. Run Agents](#3-run-agents)\n  - [4. Project Organization](#4-project-organization)\n- [📊 Evaluation: MMMC](#-evaluation----mmmc)\n- [🙏 Acknowledgements](#-acknowledgements)\n- [📌 Citation](#-citation)\n\n---\n\n## 🌟 Overview\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"figures/first.png\" alt=\"Overview\" width=\"90%\"\u003e\n\u003c/p\u003e\n\n**Code2Video** is an **agentic, code-centric framework** that generates high-quality **educational videos** from knowledge points.  \nUnlike pixel-based text-to-video models, our approach leverages executable **Manim code** to ensure **clarity, coherence, and reproducibility**.\n\n**Key Features**:\n- 🎬 **Code-Centric Paradigm** — executable code as the unified medium for both temporal sequencing and spatial organization of educational videos.\n- 🤖 **Modular Tri-Agent Design** — Planner (storyboard expansion), Coder (debuggable code synthesis), and Critic (layout refinement with anchors) work together for structured generation.\n- 📚 **MMMC Benchmark** — the first benchmark for code-driven video generation, covering 117 curated learning topics inspired by 3Blue1Brown, spanning diverse areas.\n- 🧪 **Multi-Dimensional Evaluation** — systematic assessment on efficiency, aesthetics, and end-to-end knowledge transfer.\n\n---\n\n## 🚀 Try Code2Video\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"figures/approach.png\" alt=\"Approach\" width=\"85%\"\u003e\n\u003c/p\u003e\n\n### 1. Requirements\n\n```bash\ncd src/\npip install -r requirements.txt\n````\n\nHere is the [official installation guide](https://docs.manim.community/en/stable/installation.html) for Manim Community v0.19.0, to help everyone correctly set up the environment.\n\n### 2. Configure LLM API Keys\n\nFill in your **API credentials** in `api_config.json`.\n\n* **LLM API**: \n  * Required for Planner \u0026 Coder.\n  * Best Manim code quality achieved with **Claude-4-Opus**.\n* **VLM API**:\n  * Required for Planner Critic.\n  * For layout and aesthetics optimization, provide **Gemini API key**.\n  * Best quality achieved with **gemini-2.5-pro-preview-05-06**.\n\n* **Visual Assets API**:\n\n  * To enrich videos with icons, set `ICONFINDER_API_KEY` from [IconFinder](https://www.iconfinder.com/account/applications).\n\n### 3. Run Agents\n\nWe provide two shell scripts for different generation modes:\n\n#### (a) Any Query\n\nScript: `run_agent_single.sh`\n\nGenerates a video from a single **knowledge point** specified in the script.\n\n```bash\nsh run_agent_single.sh --knowledge_point \"Linear transformations and matrices\"\n```\n\n**Important parameters inside `run_agent_single.sh`:**\n\n* `API`: specify which LLM to use.\n* `FOLDER_PREFIX`: output folder prefix (e.g., `TEST-single`).\n* `KNOWLEDGE_POINT`: target concept, e.g. `\"Linear transformations and matrices\"`.\n\n---\n\n#### (b) Full Benchmark Mode\n\nScript: `run_agent.sh`\n\nRuns all (or a subset of) learning topics defined in `long_video_topics_list.json`.\n\n```bash\nsh run_agent.sh\n```\n\n**Important parameters inside `run_agent.sh`:**\n\n* `API`: specify which LLM to use.\n* `FOLDER_PREFIX`: name prefix for saving output folders (e.g., `TEST-LIST`).\n* `MAX_CONCEPTS`: number of concepts to include (`-1` means all).\n* `PARALLEL_GROUP_NUM`: number of groups to run in parallel.\n\n### 4. Project Organization\n\nA suggested directory structure:\n\n```\nsrc/\n│── agent.py\n│── run_agent.sh\n│── run_agent_single.sh\n│── api_config.json\n│── ...\n│\n├── assets/\n│   ├── icons/          #  downloaded visual assets cache via IconFinder API\n│   └── reference/      # reference images\n│\n├── json_files/         # JSON-based topic lists \u0026 metadata\n├── prompts/            # prompt templates for LLM calls\n├── CASES/              # generated cases, organized by FOLDER_PREFIX\n│   └── TEST-LIST/      # example multi-topic generation results\n│   └── TEST-single/    # example single-topic generation results\n```\n\n\n---\n\n## 📊 Evaluation -- MMMC\n\nWe evaluate along **three complementary dimensions**:\n\n1. **Knowledge Transfer (TeachQuiz)**\n\n   ```bash\n   python3 eval_TQ.py\n   ```\n\n2. **Aesthetic \u0026 Structural Quality (AES)**\n\n   ```bash\n   python3 eval_AES.py\n   ```\n\n3. **Efficiency Metrics (During Creating)**\n\n   * Token usage\n   * Execution time\n\n\n👉 More data and evaluation scripts are available at:\n[HuggingFace: MMMC Benchmark](https://huggingface.co/datasets/YanzheChen/MMMC)\n\n---\n\n## 🙏 Acknowledgements\n\n* Video data is sourced from the **[3Blue1Brown official lessons](https://www.3blue1brown.com/#lessons)**.\n  These videos represent the **upper bound of clarity and aesthetics** in educational video design and inform our evaluation metrics.\n* We thank all the **Show Lab @ NUS** members for support!\n* This project builds upon open-source contributions from **Manim Community** and the broader AI research ecosystem.\n* High-quality visual assets (icons) are provided by **[IconFinder](https://www.iconfinder.com/)** and  **[Icons8](https://icons8.com/icons)**, which were used to enrich the educational videos.\n\n\n---\n\n## 📌 Citation\n\nIf you find our work useful, please cite:\n\n```bibtex\n@misc{code2video,\n      title={Code2Video: A Code-centric Paradigm for Educational Video Generation}, \n      author={Yanzhe Chen and Kevin Qinghong Lin and Mike Zheng Shou},\n      year={2025},\n      eprint={2510.01174},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV},\n      url={https://arxiv.org/abs/2510.01174}, \n}\n```\n\nIf you like our project, please give us a star ⭐ on GitHub for the latest update.\n[![Star History Chart](https://api.star-history.com/svg?repos=showlab/Code2Video\u0026type=Date)](https://star-history.com/#showlab/Code2Video\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/showlab.github.io%2FCode2Video%2F","html_url":"https://awesome.ecosyste.ms/projects/showlab.github.io%2FCode2Video%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/showlab.github.io%2FCode2Video%2F/lists"}