[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mit-han-lab--data-efficient-gans":3,"tool-mit-han-lab--data-efficient-gans":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",157379,2,"2026-04-15T23:32:42",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":101,"forks":102,"last_commit_at":103,"license":104,"difficulty_score":10,"env_os":105,"env_gpu":106,"env_ram":105,"env_deps":107,"category_tags":112,"github_topics":113,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":121,"updated_at":122,"faqs":123,"releases":153},7931,"mit-han-lab\u002Fdata-efficient-gans","data-efficient-gans","[NeurIPS 2020] Differentiable Augmentation for Data-Efficient GAN Training","data-efficient-gans 是一款专为提升生成对抗网络（GAN）训练效率而设计的开源工具，核心亮点在于引入了“可微分数据增强”（DiffAugment）技术。在传统 GAN 训练中，模型往往依赖海量数据才能生成高质量图像，一旦样本稀缺，效果便会急剧下降。data-efficient-gans 巧妙地将数据增强操作融入训练过程，并使其对输入可微，让梯度能够反向传播通过增强层。这一创新使得模型仅需极少量样本（例如仅用 100 张图片）即可训练出高保真的生成模型，无需任何预训练步骤，显著解决了小样本场景下的生成难题。\n\n该工具提供了基于 PyTorch 和 TensorFlow 的多种实现版本，支持 StyleGAN2 和 BigGAN 等主流架构，并兼容 GPU 与 TPU 环境，同时附带了详细的 Colab 教程以便快速上手。它非常适合人工智能研究人员、算法开发者以及需要处理稀缺数据场景的工程团队使用。无论是探索少样本学习的前沿研究，还是在实际项目中面临数据收集困难的情况，data-efficient-gans 都能帮助使用者以更低的成本获得卓越的图像生成效果。","# Data-Efficient GANs with DiffAugment\r\n\r\n### [project](https:\u002F\u002Fdata-efficient-gans.mit.edu\u002F) | [paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2006.10738) | [datasets](https:\u002F\u002Fwww.dropbox.com\u002Fscl\u002Ffi\u002Ff641djlqsyen5emxnh22r\u002Fdata-efficient-gans.zip?rlkey=xlmkf445fzwfno91i7954sp60&st=0itvqzdc&dl=0) | [video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=SsqcjS6SVM0) | [slides](https:\u002F\u002Fdata-efficient-gans.mit.edu\u002Fslides.pdf)\r\n\r\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_808c864082c0.gif\"\u002F>\r\n\r\n*Generated using only 100 images of Obama, grumpy cats, pandas, the Bridge of Sighs, the Medici Fountain, the Temple of Heaven, without pre-training.*\r\n\r\n**[NEW!]** PyTorch training with [DiffAugment-stylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2-pytorch) is now available!\r\n\r\n**[NEW!]** Our [Colab tutorial](https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002Fzsyzzsoft\u002F5fbb71b9bf9a3217576bebae5de46fc2\u002Fdata-efficient-gans.ipynb) is released! [![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002Fzsyzzsoft\u002F5fbb71b9bf9a3217576bebae5de46fc2\u002Fdata-efficient-gans.ipynb)\r\n\r\n**[NEW!]** FFHQ training is supported! See the [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2#FFHQ) README.\r\n\r\n**[NEW!]** Time to generate 100-shot interpolation videos with [generate_gif.py](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2\u002Fgenerate_gif.py)!\r\n\r\n**[NEW!]** Our [DiffAugment-biggan-imagenet](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-imagenet) repo (for TPU training) is released!\r\n\r\n**[NEW!]** Our [DiffAugment-biggan-cifar](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-cifar) PyTorch repo is released!\r\n\r\nThis repository contains our implementation of Differentiable Augmentation (DiffAugment) in both PyTorch and TensorFlow. It can be used to significantly improve the data efficiency for GAN training. We have provided [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2) (TensorFlow) and [DiffAugment-stylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2-pytorch), [DiffAugment-biggan-cifar](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-cifar) (PyTorch) for GPU training, and [DiffAugment-biggan-imagenet](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-imagenet) (TensorFlow) for TPU training.\r\n\r\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_3ec872a99733.jpg\" width=\"1000px\"\u002F>\r\n\r\n*Low-shot generation without pre-training. With DiffAugment, our model can generate high-fidelity images using only 100 Obama portraits, grumpy cats, or pandas from our collected 100-shot datasets, 160 cats or 389 dogs from the AnimalFace dataset at 256×256 resolution.*\r\n\r\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_9991e0021c18.jpg\" width=\"1000px\"\u002F>\r\n\r\n*Unconditional generation results on CIFAR-10. StyleGAN2’s performance drastically degrades given less training data. With DiffAugment, we are able to roughly match its FID and outperform its Inception Score (IS) using only **20%** training data.*\r\n\r\nDifferentiable Augmentation for Data-Efficient GAN Training\u003Cbr>\r\n[Shengyu Zhao](https:\u002F\u002Fscholar.google.com\u002Fcitations?user=gLCdw70AAAAJ), [Zhijian Liu](http:\u002F\u002Fzhijianliu.com\u002F), [Ji Lin](http:\u002F\u002Flinji.me\u002F), [Jun-Yan Zhu](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002F), and [Song Han](https:\u002F\u002Fsonghan.mit.edu\u002F)\u003Cbr>\r\nMIT, Tsinghua University, Adobe Research, CMU\u003Cbr>\r\n[arXiv](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2006.10738.pdf)\r\n\r\n\r\n## Overview\r\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_751d734e467d.jpg\" width=\"1000px\"\u002F>\r\n\r\n*Overview of DiffAugment for updating D (left) and G (right). DiffAugment applies the augmentation T to both the real sample x and the generated output G(z). When we update G, gradients need to be back-propagated through T (iii), which requires T to be differentiable w.r.t. the input.*\r\n\r\n## Training and Generation with 100 Images [![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002Fzsyzzsoft\u002F5fbb71b9bf9a3217576bebae5de46fc2\u002Fdata-efficient-gans.ipynb)\r\n\r\nTo generate an interpolation video using our pre-trained models:\r\n```bash\r\ncd DiffAugment-stylegan2\r\npython generate_gif.py -r mit-han-lab:DiffAugment-stylegan2-100-shot-obama.pkl -o obama.gif\r\n```\r\nor to train a new model:\r\n```bash\r\npython run_low_shot.py --dataset=100-shot-obama --num-gpus=4\r\n```\r\nYou may also try out `100-shot-grumpy_cat`, `100-shot-panda`, `100-shot-bridge_of_sighs`, `100-shot-medici_fountain`, `100-shot-temple_of_heaven`, `100-shot-wuzhen`, or the folder containing your own training images. Please refer to the [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2#100-shot-generation) README for the dependencies and details.\r\n\r\n**[NEW!]** PyTorch training is now available:\r\n```bash\r\ncd DiffAugment-stylegan2-pytorch\r\npython train.py --outdir=training-runs --data=https:\u002F\u002Fdata-efficient-gans.mit.edu\u002Fdatasets\u002F100-shot-obama.zip --gpus=1\r\n```\r\n\r\n## DiffAugment for StyleGAN2\r\n\r\nTo run *StyleGAN2 + DiffAugment* for unconditional generation on the 100-shot datasets, CIFAR, FFHQ, or LSUN, please refer to the [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2) README or [DiffAugment-stylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2-pytorch) for the PyTorch version.\r\n\r\n## DiffAugment for BigGAN\r\n\r\nPlease refer to the [DiffAugment-biggan-cifar](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-cifar) README to run *BigGAN + DiffAugment* for conditional generation on CIFAR (using GPUs), and the [DiffAugment-biggan-imagenet](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-imagenet) README to run on ImageNet (using TPUs).\r\n\r\n## Using DiffAugment for Your Own Training\r\n\r\nTo help you use DiffAugment in your own codebase, we provide portable DiffAugment operations of both TensorFlow and PyTorch versions in [DiffAugment_tf.py](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fblob\u002Fmaster\u002FDiffAugment_tf.py) and [DiffAugment_pytorch.py](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fblob\u002Fmaster\u002FDiffAugment_pytorch.py). Generally, DiffAugment can be easily adopted in any model by substituting every *D(x)* with *D(T(x))*, where *x* can be real images or fake images, *D* is the discriminator, and *T* is the DiffAugment operation. For example,\r\n\r\n```python\r\nfrom DiffAugment_pytorch import DiffAugment\r\n# from DiffAugment_tf import DiffAugment\r\npolicy = 'color,translation,cutout' # If your dataset is as small as ours (e.g.,\r\n# hundreds of images), we recommend using the strongest Color + Translation + Cutout.\r\n# For large datasets, try using a subset of transformations in ['color', 'translation', 'cutout'].\r\n# Welcome to discover more DiffAugment transformations!\r\n\r\n...\r\n# Training loop: update D\r\nreals = sample_real_images() # a batch of real images\r\nz = sample_latent_vectors()\r\nfakes = Generator(z) # a batch of fake images\r\nreal_scores = Discriminator(DiffAugment(reals, policy=policy))\r\nfake_scores = Discriminator(DiffAugment(fakes, policy=policy))\r\n# Calculating D's loss based on real_scores and fake_scores...\r\n...\r\n\r\n...\r\n# Training loop: update G\r\nz = sample_latent_vectors()\r\nfakes = Generator(z) # a batch of fake images\r\nfake_scores = Discriminator(DiffAugment(fakes, policy=policy))\r\n# Calculating G's loss based on fake_scores...\r\n...\r\n```\r\n\r\nWe have implemented Color, Translation, and Cutout DiffAugment as visualized below:\r\n\r\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_e36a48e68a70.jpg\" width=\"800px\"\u002F>\r\n\r\n## Citation\r\n\r\nIf you find this code helpful, please cite our paper:\r\n```\r\n@inproceedings{zhao2020diffaugment,\r\n  title={Differentiable Augmentation for Data-Efficient GAN Training},\r\n  author={Zhao, Shengyu and Liu, Zhijian and Lin, Ji and Zhu, Jun-Yan and Han, Song},\r\n  booktitle={Conference on Neural Information Processing Systems (NeurIPS)},\r\n  year={2020}\r\n}\r\n```\r\n\r\n## Acknowledgements\r\n\r\nWe thank NSF Career Award #1943349, MIT-IBM Watson AI Lab, Google, Adobe, and Sony for supporting this research.  Research supported with Cloud TPUs from Google's TensorFlow Research Cloud (TFRC). We thank William S. Peebles and Yijun Li for helpful comments.\r\n\r\n","# 基于 DiffAugment 的数据高效 GAN\n\n### [项目](https:\u002F\u002Fdata-efficient-gans.mit.edu\u002F) | [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2006.10738) | [数据集](https:\u002F\u002Fwww.dropbox.com\u002Fscl\u002Ffi\u002Ff641djlqsyen5emxnh22r\u002Fdata-efficient-gans.zip?rlkey=xlmkf445fzwfno91i7954sp60&st=0itvqzdc&dl=0) | [视频](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=SsqcjS6SVM0) | [演示文稿](https:\u002F\u002Fdata-efficient-gans.mit.edu\u002Fslides.pdf)\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_808c864082c0.gif\"\u002F>\n\n*仅使用 100 张奥巴马照片、生气的猫、熊猫、叹息桥、美第奇喷泉、天坛的照片生成，无需预训练。*\n\n**[新增！]** 现已提供基于 [DiffAugment-stylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2-pytorch) 的 PyTorch 训练代码！\n\n**[新增！]** 我们的 [Colab 教程](https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002Fzsyzzsoft\u002F5fbb71b9bf9a3217576bebae5de46fc2\u002Fdata-efficient-gans.ipynb) 已发布！[![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002Fzsyzzsoft\u002F5fbb71b9bf9a3217576bebae5de46fc2\u002Fdata-efficient-gans.ipynb)\n\n**[新增！]** 现已支持 FFHQ 数据集的训练！请参阅 [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2#FFHQ) 的 README。\n\n**[新增！]** 使用 [generate_gif.py](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2\u002Fgenerate_gif.py) 即可生成 100 张样本的插值视频！\n\n**[新增！]** 我们的 [DiffAugment-biggan-imagenet](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-imagenet) 仓库（用于 TPU 训练）已发布！\n\n**[新增！]** 我们的 [DiffAugment-biggan-cifar](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-cifar) PyTorch 仓库已发布！\n\n本仓库包含我们在 PyTorch 和 TensorFlow 中对可微增强（DiffAugment）的实现。它可用于显著提升 GAN 训练的数据效率。我们提供了 [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2)（TensorFlow）和 [DiffAugment-stylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2-pytorch)（PyTorch），用于 GPU 训练；以及 [DiffAugment-biggan-imagenet](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-imagenet)（TensorFlow），用于 TPU 训练。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_3ec872a99733.jpg\" width=\"1000px\"\u002F>\n\n*无预训练条件下的低样本量生成。借助 DiffAugment，我们的模型仅需 100 张奥巴马肖像、生气的猫或熊猫等收集到的 100 张样本数据集，即可在 256×256 分辨率下生成高保真图像；同样地，仅用 AnimalFace 数据集中的 160 只猫或 389 只狗也能实现高质量生成。*\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_9991e0021c18.jpg\" width=\"1000px\"\u002F>\n\n*CIFAR-10 上的无条件生成结果。StyleGAN2 在训练数据较少时性能会大幅下降。而借助 DiffAugment，我们仅使用 **20%** 的训练数据，便能大致匹配其 FID，并超越其 Inception Score（IS）。*\n\n用于数据高效 GAN 训练的可微增强\u003Cbr>\n[赵圣宇](https:\u002F\u002Fscholar.google.com\u002Fcitations?user=gLCdw70AAAAJ)、[刘志坚](http:\u002F\u002Fzhijianliu.com\u002F)、[林继](http:\u002F\u002Flinji.me\u002F)、[朱俊彦](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002F) 和 [韩松](https:\u002F\u002Fsonghan.mit.edu\u002F) \u003Cbr>\n麻省理工学院、清华大学、Adobe Research、卡内基梅隆大学\u003Cbr>\n[arXiv](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2006.10738.pdf)\n\n\n## 概述\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_751d734e467d.jpg\" width=\"1000px\"\u002F>\n\n*DiffAugment 用于更新判别器 D（左）和生成器 G（右）的概述。DiffAugment 将增强操作 T 同时应用于真实样本 x 和生成输出 G(z)。当更新 G 时，梯度需要通过 T 进行反向传播（iii），这要求 T 对输入是可微的。*\n\n## 使用 100 张图片进行训练与生成 [![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgist\u002Fzsyzzsoft\u002F5fbb71b9bf9a3217576bebae5de46fc2\u002Fdata-efficient-gans.ipynb)\n\n要使用我们预训练的模型生成插值视频：\n```bash\ncd DiffAugment-stylegan2\npython generate_gif.py -r mit-han-lab:DiffAugment-stylegan2-100-shot-obama.pkl -o obama.gif\n```\n或者训练一个新模型：\n```bash\npython run_low_shot.py --dataset=100-shot-obama --num-gpus=4\n```\n你也可以尝试 `100-shot-grumpy_cat`、`100-shot-panda`、`100-shot-bridge_of_sighs`、`100-shot-medici_fountain`、`100-shot-temple_of_heaven`、`100-shot-wuzhen`，或是放入你自己的训练图片文件夹。有关依赖项和详细信息，请参阅 [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2#100-shot-generation) 的 README。\n\n**[新增！]** 现已提供 PyTorch 训练：\n```bash\ncd DiffAugment-stylegan2-pytorch\npython train.py --outdir=training-runs --data=https:\u002F\u002Fdata-efficient-gans.mit.edu\u002Fdatasets\u002F100-shot-obama.zip --gpus=1\n```\n\n## DiffAugment 用于 StyleGAN2\n\n要在 100 张样本数据集、CIFAR、FFHQ 或 LSUN 上运行 *StyleGAN2 + DiffAugment* 进行无条件生成，请参阅 [DiffAugment-stylegan2](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2) 的 README，或对于 PyTorch 版本，请参阅 [DiffAugment-stylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-stylegan2-pytorch)。\n\n## DiffAugment 用于 BigGAN\n\n请参阅 [DiffAugment-biggan-cifar](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-cifar) 的 README，以运行 *BigGAN + DiffAugment* 进行 CIFAR 数据集上的条件生成（使用 GPU）；并参阅 [DiffAugment-biggan-imagenet](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Ftree\u002Fmaster\u002FDiffAugment-biggan-imagenet) 的 README，以在 ImageNet 数据集上运行（使用 TPU）。\n\n## 在你自己的训练中使用 DiffAugment\n\n为了帮助你在自己的代码库中使用 DiffAugment，我们在 [DiffAugment_tf.py](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fblob\u002Fmaster\u002FDiffAugment_tf.py) 和 [DiffAugment_pytorch.py](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fblob\u002Fmaster\u002FDiffAugment_pytorch.py) 中提供了可移植的 TensorFlow 和 PyTorch 版本的 DiffAugment 操作。通常，只需将每个 *D(x)* 替换为 *D(T(x))*，即可轻松将 DiffAugment 应用于任何模型，其中 *x* 可以是真实图像或假图像，*D* 是判别器，*T* 是 DiffAugment 操作。例如，\n\n```python\nfrom DiffAugment_pytorch import DiffAugment\n# from DiffAugment_tf import DiffAugment\npolicy = 'color,translation,cutout' # 如果你的数据集像我们的那样小（例如，\n# 只有几百张图片），我们建议使用最强的 Color + Translation + Cutout。\n# 对于大型数据集，可以尝试使用 ['color', 'translation', 'cutout'] 中的部分变换。\n\n# 欢迎探索更多 DiffAugment 变换！\n\n...\n# 训练循环：更新判别器 D\nreal_images = sample_real_images() # 一批真实图像\nz = sample_latent_vectors()\nfake_images = Generator(z) # 一批生成图像\nreal_scores = Discriminator(DiffAugment(real_images, policy=policy))\nfake_scores = Discriminator(DiffAugment(fake_images, policy=policy))\n# 根据 real_scores 和 fake_scores 计算判别器的损失...\n...\n\n...\n# 训练循环：更新生成器 G\nz = sample_latent_vectors()\nfake_images = Generator(z) # 一批生成图像\nfake_scores = Discriminator(DiffAugment(fake_images, policy=policy))\n# 根据 fake_scores 计算生成器的损失...\n...\n我们实现了 Color、Translation 和 Cutout 这三种 DiffAugment 变换，效果如下所示：\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_readme_e36a48e68a70.jpg\" width=\"800px\"\u002F>\n\n## 引用\n\n如果您觉得这段代码有所帮助，请引用我们的论文：\n```\n@inproceedings{zhao2020diffaugment,\n  title={Differentiable Augmentation for Data-Efficient GAN Training},\n  author={Zhao, Shengyu and Liu, Zhijian and Lin, Ji and Zhu, Jun-Yan and Han, Song},\n  booktitle={Conference on Neural Information Processing Systems (NeurIPS)},\n  year={2020}\n}\n```\n\n## 致谢\n\n我们感谢 NSF 职业生涯奖 #1943349、MIT-IBM 沃森人工智能实验室、谷歌、Adobe 和索尼对本研究的支持。本研究还得到了谷歌 TensorFlow Research Cloud (TFRC) 提供的 Cloud TPU 的支持。同时，我们也感谢 William S. Peebles 和 Yijun Li 提出的有益建议。","# Data-Efficient GANs (DiffAugment) 快速上手指南\n\n本指南帮助开发者快速使用 **Data-Efficient GANs**，通过可微分数据增强（DiffAugment）技术，在极少样本（如仅 100 张图片）下训练高质量的生成对抗网络（GAN）。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐 Ubuntu 18.04+) 或 macOS\n- **GPU**: NVIDIA GPU (支持 CUDA)，显存建议 8GB 以上（根据模型大小调整）\n- **Python**: 3.6 - 3.8\n\n### 前置依赖\n本项目提供 **PyTorch** 和 **TensorFlow** 两个版本，请根据需求选择安装基础框架：\n\n- **PyTorch 版本**: 需要 `torch`, `torchvision`, `ninja`\n- **TensorFlow 版本**: 需要 `tensorflow-gpu` (适用于 StyleGAN2 原版), `numpy`, `scipy`\n\n> **提示**: 若需训练 BigGAN-ImageNet 并使用 TPU，请参考官方仓库中的 `DiffAugment-biggan-imagenet` 分支说明。\n\n## 安装步骤\n\n克隆项目仓库并进入目录：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans.git\ncd data-efficient-gans\n```\n\n### 方案 A：使用 PyTorch (推荐新手)\n进入 PyTorch 子目录并安装依赖（需确保已安装 PyTorch）：\n\n```bash\ncd DiffAugment-stylegan2-pytorch\npip install -r requirements.txt\n```\n\n### 方案 B：使用 TensorFlow\n进入 TensorFlow 子目录并安装依赖（需确保已安装 TensorFlow）：\n\n```bash\ncd DiffAugment-stylegan2\npip install -r requirements.txt\n```\n\n## 基本使用\n\n以下示例展示如何使用 **PyTorch 版本** 进行训练和生成。\n\n### 1. 快速训练 (100 张样本)\n使用官方提供的 100 张奥巴马照片数据集进行训练（单卡 GPU）：\n\n```bash\ncd DiffAugment-stylegan2-pytorch\npython train.py --outdir=training-runs --data=https:\u002F\u002Fdata-efficient-gans.mit.edu\u002Fdatasets\u002F100-shot-obama.zip --gpus=1\n```\n\n*注：你可以将 `--data` 参数替换为其他内置数据集（如 `100-shot-grumpy_cat.zip`）或本地图片文件夹路径。*\n\n### 2. 使用预训练模型生成插值视频\n下载预训练模型后，运行以下命令生成 GIF 动图：\n\n```bash\ncd DiffAugment-stylegan2\npython generate_gif.py -r mit-han-lab:DiffAugment-stylegan2-100-shot-obama.pkl -o obama.gif\n```\n\n### 3. 集成到自己的代码中\n若你想在自己的 GAN 项目中应用 DiffAugment，只需引入增强模块并在判别器输入前应用变换。\n\n**PyTorch 示例代码：**\n\n```python\nfrom DiffAugment_pytorch import DiffAugment\n\n# 定义增强策略：小数据集推荐使用 'color,translation,cutout'\npolicy = 'color,translation,cutout'\n\n# ... 在训练循环中 ...\n\n# 更新判别器 (D)\nreals = sample_real_images()\nz = sample_latent_vectors()\nfakes = Generator(z)\n\n# 对真实图片和生成图片同时应用 DiffAugment\nreal_scores = Discriminator(DiffAugment(reals, policy=policy))\nfake_scores = Discriminator(DiffAugment(fakes, policy=policy))\n\n# 计算 D 的损失...\n\n# 更新生成器 (G)\nz = sample_latent_vectors()\nfakes = Generator(z)\n\n# 仅对生成图片应用 DiffAugment (梯度需回传通过增强操作)\nfake_scores = Discriminator(DiffAugment(fakes, policy=policy))\n\n# 计算 G 的损失...\n```\n\n**TensorFlow 示例代码：**\n只需将导入语句改为 `from DiffAugment_tf import DiffAugment`，其余逻辑相同。","一家小型数字艺术工作室希望为某历史人物展览快速生成高质量的宣传海报，但手头仅收集到该人物珍贵的 100 张高清历史照片，无法凑齐传统深度学习所需的大规模数据集。\n\n### 没有 data-efficient-gans 时\n- 模型因训练样本过少而迅速过拟合，生成的图像仅仅是原始照片的简单复制或带有严重噪点的扭曲画面。\n- 为了获取足够数据，团队不得不花费数周时间进行昂贵且耗时的额外拍摄或人工绘制补全，严重拖慢项目进度。\n- 即使强行训练，输出图像的分辨率和细节清晰度极低，完全无法满足印刷级海报的专业质量要求。\n- 尝试使用预训练模型迁移学习时，发现风格难以对齐，导致生成的人物特征失真，失去了历史真实性。\n\n### 使用 data-efficient-gans 后\n- 利用其可微分增强（DiffAugment）技术，仅凭现有的 100 张照片就训练出了高保真模型，生成了神态自然、细节丰富的全新肖像。\n- 无需任何额外数据采集或预训练步骤，直接将稀缺数据转化为生产力，将原本数周的数据准备期缩短为零。\n- 生成的图像在 256x256 甚至更高分辨率下依然保持清晰纹理，完美达到了商业印刷的视觉标准。\n- 模型成功捕捉了人物的独特面部特征与光影风格，确保了生成内容与历史原貌的高度一致性，避免了风格漂移。\n\ndata-efficient-gans 通过算法创新打破了生成对抗网络对大数据的依赖，让小规模珍贵数据也能释放出巨大的创作价值。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_data-efficient-gans_3ec872a9.jpg","mit-han-lab","MIT HAN Lab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmit-han-lab_65e6a38d.png","Efficient AI Computing. PI: Song Han",null,"songhan_mit","https:\u002F\u002Fhanlab.mit.edu","https:\u002F\u002Fgithub.com\u002Fmit-han-lab",[81,85,89,93,97],{"name":82,"color":83,"percentage":84},"Python","#3572A5",94.9,{"name":86,"color":87,"percentage":88},"Cuda","#3A4E3A",3.3,{"name":90,"color":91,"percentage":92},"Shell","#89e051",0.9,{"name":94,"color":95,"percentage":96},"C++","#f34b7d",0.8,{"name":98,"color":99,"percentage":100},"Dockerfile","#384d54",0.1,1313,175,"2026-04-13T11:48:13","BSD-2-Clause","未说明","训练需要 GPU（命令参数显示支持多卡，如 --num-gpus=4）；ImageNet 版本需要 TPU。具体型号、显存大小及 CUDA 版本未在 README 中明确说明。",{"notes":108,"python":105,"dependencies":109},"该项目提供 TensorFlow 和 PyTorch 两种实现版本。StyleGAN2 和 BigGAN (CIFAR) 版本使用 GPU 训练，BigGAN (ImageNet) 版本专为 TPU 训练设计。项目包含针对小样本（如 100 张图片）训练的预训练模型和脚本。具体依赖库版本需参考子目录（如 DiffAugment-stylegan2-pytorch）的详细说明。",[110,111],"TensorFlow","PyTorch",[14,15,16],[114,115,116,117,118,119,120],"gans","pytorch","tensorflow","data-efficient","generative-adversarial-network","image-generation","neurips-2020","2026-03-27T02:49:30.150509","2026-04-16T08:17:12.113362",[124,129,134,139,144,149],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},35505,"运行代码时遇到 'policy=\"translation\" failed' 或 CuDNN 错误怎么办？","这是一个已知问题，已在主分支（master）中修复。如果仍然遇到 `RuntimeError: CuDNN error: CUDNN_STATUS_NOT_SUPPORTED` 错误，通常是因为输入张量不连续（non-contiguous）。解决方法是在 `rand_translation()` 函数的末尾调用 `.contiguous()` 方法，确保张量在内存中是连续的。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fissues\u002F3",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},35506,"如何在 Google Colab 上恢复训练进度并查看每个 tick 生成的图像？","训练检查点（*.pkl 文件）通常保存在实验目录下的 `results` 文件夹中，而不是数据集文件夹。如果 `results` 文件夹中没有 *.pkl 文件，说明训练尚未达到保存检查点的进度。要恢复训练，请确保加载正确的检查点路径；要查看生成的图像，请检查同一输出目录下的图像文件。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fissues\u002F67",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},35507,"为什么使用更多数据（如 3.8K 图像）训练得到的 FID 分数反而比少数据（如 750 图像）更高？","这通常是因为 FID 统计信息缓存冲突导致的。当你用 750 张图像计算真实图像的 FID 统计信息后，系统可能缓存了这些统计数据。随后评估用 3.8K 图像训练的模型时，如果未清除缓存或重命名数据集，代码可能仍在使用基于 750 张图像的旧统计信息进行计算。解决方法是清除缓存文件或更改数据集名称，然后重新评估模型以生成新的统计信息。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fissues\u002F55",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},35508,"在 TensorFlow 1 版本中如何自定义或查找 D(T(x)) 和 D(T(G(z))) 的损失计算位置？","在 TensorFlow 1 中没有通用的直接修改方法，必须使用 TF 操作符或将自定义函数封装为 TF 的 numpy 函数。建议查阅 TensorFlow 关于图模式（graph mode）的文档。如果需要更灵活地修改损失函数（例如添加自定义变量），建议使用仓库中的 PyTorch 版本（DiffAugment-stylegan2-pytorch），在那里可以直接通过代码修改损失计算逻辑，例如在 `training\u002Floss.py` 中调整 `loss_Gmain`。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fissues\u002F92",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},35509,"在 Colab (P-100) 上运行时出现 OOM (显存不足) 错误如何解决？","OOM 错误通常是因为显存不足以分配所需的张量（例如形状为 [32,128,256,256] 的张量）。对于小样本生成实验，项目主要遵循 StyleGAN2 的架构但做了一些调整。如果在单卡 P-100 (16GB) 上遇到此问题，可以尝试减少 batch size（minibatch），或者参考论文附录 A.2，针对较小图像尺寸（如 CIFAR）的实验，需要修改架构并减少容量。此外，确保没有不必要的显存占用，并检查是否使用了过高的分辨率设置。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fdata-efficient-gans\u002Fissues\u002F7",{"id":150,"question_zh":151,"answer_zh":152,"source_url":148},35510,"复现论文结果时，是否需要使用截断技巧（truncation trick）或修改 StyleGAN2 架构？","1. 截断技巧（truncation trick）仅用于论文中的部分展示图（如 Fig 12），在 FID 计算和我们提供的复现代码中均未使用。\n2. 对于 CIFAR-10\u002F100 等小图像实验，我们修改了架构并减少了容量，具体细节见论文附录 A.2，同时使用了常用于 CIFAR 实验的不同损失函数。\n3. 对于小样本生成实验，主要遵循 StyleGAN2 的损失和架构，仅做了微小调整（如 gamma 参数）。复现时只需按照论文附录描述进行调整即可，无需大幅改动原始 StyleGAN2。",[]]