[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mit-han-lab--anycost-gan":3,"tool-mit-han-lab--anycost-gan":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 真正成长为懂上",152630,2,"2026-04-12T23:33:54",[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":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":10,"env_os":101,"env_gpu":102,"env_ram":103,"env_deps":104,"category_tags":113,"github_topics":114,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":126,"updated_at":127,"faqs":128,"releases":158},7054,"mit-han-lab\u002Fanycost-gan","anycost-gan","[CVPR 2021] Anycost GANs for Interactive Image Synthesis and Editing","Anycost GAN 是一款专为交互式图像合成与编辑设计的开源人工智能模型，曾发表于计算机视觉顶级会议 CVPR 2021。它核心解决了传统高质量图像生成模型计算量大、渲染速度慢，导致无法实时响应用户编辑操作的痛点。\n\n在传统流程中，生成一张高保真图像可能需要数秒，这使得“调整 - 预览”的交互体验变得极其卡顿。Anycost GAN 的创新之处在于其“弹性计算”能力：同一个模型可以根据当前的算力预算，动态调整通道数量和图像分辨率。这意味着用户在进行拖拽滑块或修改属性等交互操作时，模型能以快 5 倍的速度生成视觉效果一致的低算力预览图；待用户确认满意后，再一键切换至全算力模式输出最终的高清结果。\n\n该工具的技术亮点包括基于采样的多分辨率训练、自适应通道训练以及生成器条件判别器，确保了在不同计算配置下输出图像的高度一致性与高质量。Anycost GAN 非常适合需要开发实时图像编辑应用的开发者、研究高效深度学习架构的科研人员，以及希望在工作流中集成快速原型验证功能的数字艺术家使用。项目提供了详细的代码库、预训练模型及 Colab 演示笔记，便于用户快速上手体验灵活的图像生成技术。","# Anycost GAN\n\n### [video](https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM) | [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.03243) | [website](https:\u002F\u002Fhanlab18.mit.edu\u002Fprojects\u002Fanycost-gan\u002F) [![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fmit-han-lab\u002Fanycost-gan\u002Fblob\u002Fmaster\u002Fnotebooks\u002Fintro_colab.ipynb)\n\n[Anycost GANs for Interactive Image Synthesis and Editing](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.03243)\n\n[Ji Lin](http:\u002F\u002Flinji.me\u002F), [Richard Zhang](https:\u002F\u002Frichzhang.github.io\u002F), Frieder Ganz, [Song Han](https:\u002F\u002Fsonghan.mit.edu\u002F), [Jun-Yan Zhu](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002F)\n\nMIT, Adobe Research, CMU\n\nIn CVPR 2021\n\n![flexible](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_a7a355f592fc.gif)\n\nAnycost GAN generates consistent outputs under various computational budgets.\n\n\n\n## Demo\n\n\u003Ca href=\"https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM?t=90\">\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_40c5391abfc2.gif' width=600>\u003C\u002Fa>\n\nHere, we can use the Anycost generator for **interactive image editing**. A full generator takes **~3s** to render an image, which is too slow for editing. While with Anycost generator, we can provide a visually similar preview at **5x faster speed**. After adjustment, we hit the \"Finalize\" button to synthesize the high-quality final output. Check [here](https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM?t=90) for the full demo.\n\n\n\n## Overview\n\nAnycost generators can be run at *diverse computation costs* by using different *channel* and *resolution* configurations. Sub-generators achieve high output consistency compared to the full generator, providing a fast preview.\n\n![overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_f59f4bba6086.jpg)\n\n\n\nWith (1) Sampling-based multi-resolution training, (2) adaptive-channel training, and (3) generator-conditioned discriminator, we achieve high image quality and consistency at different resolutions and channels.\n\n![method](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_fd4ab7c87754.gif)\n\n## Results\n\nAnycost GAN (uniform channel version) supports 4 resolutions and 4 channel ratios, producing visually consistent images with different image fidelity.\n\n![uniform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_c78cf93d510a.gif)\n\n\n\nThe consistency retains during image projection and editing:\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_48b9a7e813c4.jpg)\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_b24ec60c6e56.jpg)\n\n\n\n## Usage\n\n### Getting Started\n\n- Clone this repo:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan.git\ncd anycost-gan\n```\n\n- Install PyTorch 1.7 and other dependeinces.\n\nWe recommend setting up the environment using Anaconda: `conda env create -f environment.yml`\n\n\n\n### Introduction Notebook\n\nWe provide a jupyter notebook example to show how to use the anycost generator for image synthesis at diverse costs: `notebooks\u002Fintro.ipynb`.\n\nWe also provide a colab version of the notebook: [![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fmit-han-lab\u002Fanycost-gan\u002Fblob\u002Fmaster\u002Fnotebooks\u002Fintro_colab.ipynb). Be sure to select the GPU as the accelerator in runtime options.\n\n\n\n### Interactive Demo\n\nWe provide an interactive demo showing how we can use anycost GAN to enable interactive image editing. To run the demo:\n\n```bash\npython demo.py\n```\n\nIf your computer contains a CUDA GPU, try running with:\n```bash\nFORCE_NATIVE=1 python demo.py\n```\n\nYou can find a video recording of the demo [here](https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM?t=90).\n\n\n\n### Using Pre-trained Models\n\nTo get the pre-trained generator, encoder, and editing directions, run:\n\n```python\nimport models\n\npretrained_type = 'generator'  # choosing from ['generator', 'encoder', 'boundary']\nconfig_name = 'anycost-ffhq-config-f'  # replace the config name for other models\nmodels.get_pretrained(pretrained_type, config=config_name)\n```\n\nWe also provide the face attribute classifier (which is general for different generators) for computing the editing directions. You can get it by running:\n\n```python\nmodels.get_pretrained('attribute-predictor')\n```\n\nThe attribute classifier takes in the face images in FFHQ format.\n\n\n\nAfter loading the Anycost generator, we can run it at a wide range of computational costs. For example:\n\n```python\nfrom models.dynamic_channel import set_uniform_channel_ratio, reset_generator\n\ng = models.get_pretrained('generator', config='anycost-ffhq-config-f')  # anycost uniform\nset_uniform_channel_ratio(g, 0.5)  # set channel\ng.target_res = 512  # set resolution\nout, _ = g(...)  # generate image\nreset_generator(g)  # restore the generator\n```\n\nFor detailed usage and *flexible-channel* anycost generator, please refer to `notebooks\u002Fintro.ipynb`.\n\n\n\n### Model Zoo\n\nCurrently, we provide the following pre-trained generators, encoders, and editing directions. We will add more in the future.\n\nFor Anycost generators, by default, we refer to the uniform setting.\n\n| config name                    | generator          | encoder            | edit direction     |\n| ------------------------------ | ------------------ | ------------------ | ------------------ |\n| anycost-ffhq-config-f          | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| anycost-ffhq-config-f-flexible | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| anycost-car-config-f           | :heavy_check_mark: |                    |                    |\n| stylegan2-ffhq-config-f        | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n`stylegan2-ffhq-config-f` refers to the official StyleGAN2 generator converted from the [repo](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fstylegan2).\n\n\n\n### Datasets\n\nWe prepare the [FFHQ](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fffhq-dataset), [CelebA-HQ](https:\u002F\u002Fgithub.com\u002Fswitchablenorms\u002FCelebAMask-HQ), and [LSUN Car](https:\u002F\u002Fgithub.com\u002Ffyu\u002Flsun) datasets into a directory of images, so that it can be easily used with `ImageFolder` from `torchvision`. The dataset layout looks like:\n\n```\n├── PATH_TO_DATASET\n│   ├── images\n│   │   ├── 00000.png\n│   │   ├── 00001.png\n│   │   ├── ...\n```\n\nDue to the copyright issue, you need to download the dataset from official site and process them accordingly.\n\n\n\n### Evaluation\n\nWe provide the code to evaluate some metrics presented in the paper. Some of the code is written with [`horovod`](https:\u002F\u002Fgithub.com\u002Fhorovod\u002Fhorovod) to support distributed evaluation and reduce the cost of inter-GPU communication, which greatly improves the speed. Check its website for a proper installation.\n\n#### Fre ́chet Inception Distance (FID)\n\nBefore evaluating the FIDs, you need to compute the inception features of the real images using scripts like:\n\n```bash\npython tools\u002Fcalc_inception.py \\\n    --resolution 1024 --batch_size 64 -j 16 --n_sample 50000 \\\n    --save_name assets\u002Finceptions\u002Finception_ffhq_res1024_50k.pkl \\\n    PATH_TO_FFHQ\n```\n\nor you can download the pre-computed inceptions from [here](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fbc8a7ewlvcxa2cf\u002FAAD8NFzDWKmBDpbLef-gGhRZa?dl=0) and put it under `assets\u002Finceptions`.\n\nThen, you can evaluate the FIDs by running:\n\n```bash\nhorovodrun -np N_GPU \\\n    python metrics\u002Ffid.py \\\n    --config anycost-ffhq-config-f \\\n    --batch_size 16 --n_sample 50000 \\\n    --inception assets\u002Finceptions\u002Finception_ffhq_res1024_50k.pkl\n    # --channel_ratio 0.5 --target_res 512  # optionally using a smaller resolution\u002Fchannel\n```\n\n#### Perceptual Path Lenght (PPL)\n\nSimilary, evaluting the PPL with:\n\n```bash\nhorovodrun -np N_GPU \\\n    python metrics\u002Fppl.py \\\n    --config anycost-ffhq-config-f\n```\n\n#### Attribute Consistency\n\nEvaluating the attribute consistency by running:\n\n```bash\nhorovodrun -np N_GPU \\\n    python metrics\u002Fattribute_consistency.py \\\n    --config anycost-ffhq-config-f \\\n    --channel_ratio 0.5 --target_res 512  # config for the sub-generator; necessary\n```\n\n#### Encoder Evaluation\n\nTo evaluate the performance of the encoder, run:\n\n```bash\npython metrics\u002Feval_encoder.py \\\n    --config anycost-ffhq-config-f \\\n    --data_path PATH_TO_CELEBA_HQ\n```\n\n\n\n### Training\n\nWe provide the scripts to train Anycost GAN on FFHQ dataset.\n\n- Training the original StyleGAN2 on FFHQ\n\n```\nhorovodrun -np 8 bash scripts\u002Ftrain_stylegan2_ffhq.sh\n```\n\nThe training of original StyleGAN2 is time-consuming. We recommend downloading the converted checkpoints from [here](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fl8g9amoduz99kjh\u002FAAAY9LYZk2CnsO43ywDrLZpEa?dl=0) and place it under `checkpoint\u002F`.\n\n- Training Anycost GAN: mult-resolution \n\n```\nhorovodrun -np 8 bash scripts\u002Ftrain_stylegan2_multires_ffhq.sh\n```\n\nNote that after each epoch, we evaluate the FIDs of two resolutions (1024&512) to better monitor the training progress. We also apply distillation to accelearte the convergence, which is not used for the ablation in the paper.\n\n- Training Anycost GAN: adaptive-channel\n\n```\nhorovodrun -np 8 bash scripts\u002Ftrain_stylegan2_multires_adach_ffhq.sh\n```\n\nHere we set a longer training epoch for a more stable reproduction, which might not be necessary (depending on the randomness).\n\n\n\n**Note**: We trained our models on Titan RTX GPUs with 24GB memory. For GPUs with smaller memory, you may need to reduce the resolution\u002Fmodel size\u002Fbatch size\u002Fetc. and adjust other hyper-parameters accordingly.\n\n\n\n## Citation\n\nIf you use this code for your research, please cite our paper.\n\n```\n@inproceedings{lin2021anycost,\n  author    = {Lin, Ji and Zhang, Richard and Ganz, Frieder and Han, Song and Zhu, Jun-Yan},\n  title     = {Anycost GANs for Interactive Image Synthesis and Editing},\n  booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year      = {2021},\n}\n```\n\n\n\n## Related Projects\n\n**[GAN Compression](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fgan-compression) | [Once for All](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fonce-for-all) | [iGAN](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FiGAN) | [StyleGAN2](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fstylegan2)**\n\n\n\n## Acknowledgement\n\nWe thank Taesung Park, Zhixin Shu, Muyang Li, and Han Cai for the helpful discussion. Part of the work is supported by NSF CAREER Award #1943349, Adobe, SONY, Naver Corporation, and MIT-IBM Watson AI Lab.\n\nThe codebase is build upon a PyTorch implementation of StyleGAN2: [rosinality\u002Fstylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Frosinality\u002Fstylegan2-pytorch). For editing direction extraction, we refer to [InterFaceGAN](https:\u002F\u002Fgithub.com\u002Fgenforce\u002Finterfacegan).\n","# Anycost GAN\n\n### [视频](https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM) | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.03243) | [网站](https:\u002F\u002Fhanlab18.mit.edu\u002Fprojects\u002Fanycost-gan\u002F) [![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fmit-han-lab\u002Fanycost-gan\u002Fblob\u002Fmaster\u002Fnotebooks\u002Fintro_colab.ipynb)\n\n[用于交互式图像合成与编辑的 Anycost GAN](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.03243)\n\n[Ji Lin](http:\u002F\u002Flinji.me\u002F)、[Richard Zhang](https:\u002F\u002Frichzhang.github.io\u002F)、Frieder Ganz、[Song Han](https:\u002F\u002Fsonghan.mit.edu\u002F)、[Jun-Yan Zhu](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002F)\n\n麻省理工学院、Adobe Research、卡内基梅隆大学\n\n发表于 CVPR 2021\n\n![flexible](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_a7a355f592fc.gif)\n\nAnycost GAN 可以在不同的计算预算下生成一致的输出。\n\n\n\n## 演示\n\n\u003Ca href=\"https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM?t=90\">\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_40c5391abfc2.gif' width=600>\u003C\u002Fa>\n\n在这里，我们可以使用 Anycost 生成器进行**交互式图像编辑**。完整的生成器渲染一张图像大约需要 **3 秒钟**，这对于编辑来说太慢了。而使用 Anycost 生成器，我们可以在**5 倍更快的速度**下提供视觉上相似的预览。调整完成后，点击“Finalize”按钮即可合成高质量的最终输出。完整演示请查看 [这里](https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM?t=90)。\n\n\n\n## 概述\n\nAnycost 生成器可以通过使用不同的*通道*和*分辨率*配置，在*多种计算成本*下运行。子生成器与完整生成器相比，能够实现更高的输出一致性，从而提供快速预览。\n\n![overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_f59f4bba6086.jpg)\n\n\n\n通过 (1) 基于采样的多分辨率训练、(2) 自适应通道训练以及 (3) 生成器条件判别器，我们在不同分辨率和通道下实现了高图像质量和一致性。\n\n![method](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_fd4ab7c87754.gif)\n\n## 结果\n\nAnycost GAN（统一通道版本）支持 4 种分辨率和 4 种通道比例，在不同图像保真度下都能生成视觉上一致的图像。\n\n![uniform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_c78cf93d510a.gif)\n\n\n\n这种一致性在图像投影和编辑过程中依然保持：\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_48b9a7e813c4.jpg)\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_readme_b24ec60c6e56.jpg)\n\n\n\n## 使用方法\n\n### 入门\n\n- 克隆本仓库：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan.git\ncd anycost-gan\n```\n\n- 安装 PyTorch 1.7 及其他依赖项。\n\n我们建议使用 Anaconda 设置环境：`conda env create -f environment.yml`\n\n\n\n### 入门笔记本\n\n我们提供了一个 Jupyter 笔记本示例，展示如何使用 Anycost 生成器在不同计算成本下进行图像合成：`notebooks\u002Fintro.ipynb`。\n\n我们还提供了该笔记本的 Colab 版本：[![](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fmit-han-lab\u002Fanycost-gan\u002Fblob\u002Fmaster\u002Fnotebooks\u002Fintro_colab.ipynb)。请务必在运行时选项中选择 GPU 作为加速器。\n\n\n\n### 交互式演示\n\n我们提供了一个交互式演示，展示如何使用 Anycost GAN 实现交互式图像编辑。要运行演示：\n\n```bash\npython demo.py\n```\n\n如果你的电脑配备了 CUDA GPU，可以尝试以下命令：\n\n```bash\nFORCE_NATIVE=1 python demo.py\n```\n\n你可以在 [这里](https:\u002F\u002Fyoutu.be\u002F_yEziPl9AkM?t=90)找到该演示的视频记录。\n\n\n\n### 使用预训练模型\n\n要获取预训练的生成器、编码器和编辑方向，运行以下代码：\n\n```python\nimport models\n\npretrained_type = 'generator'  # 从 ['generator', 'encoder', 'boundary'] 中选择\nconfig_name = 'anycost-ffhq-config-f'  # 替换为其他模型的配置名称\nmodels.get_pretrained(pretrained_type, config=config_name)\n```\n\n我们还提供了人脸属性分类器（适用于不同生成器），用于计算编辑方向。你可以通过以下命令获取：\n\n```python\nmodels.get_pretrained('attribute-predictor')\n```\n\n该属性分类器接受 FFHQ 格式的人脸图像输入。\n\n\n\n加载 Anycost 生成器后，我们可以在广泛的计算成本范围内运行它。例如：\n\n```python\nfrom models.dynamic_channel import set_uniform_channel_ratio, reset_generator\n\ng = models.get_pretrained('generator', config='anycost-ffhq-config-f')  # Anycost 统一通道\nset_uniform_channel_ratio(g, 0.5)  # 设置通道比例\ng.target_res = 512  # 设置分辨率\nout, _ = g(...)  # 生成图像\nreset_generator(g)  # 恢复生成器\n```\n\n有关详细用法和*灵活通道*的 Anycost 生成器，请参阅 `notebooks\u002Fintro.ipynb`。\n\n\n\n### 模型库\n\n目前，我们提供了以下预训练的生成器、编码器和编辑方向。未来还将添加更多内容。\n\n对于 Anycost 生成器，默认情况下指的是统一设置。\n\n| 配置名称                    | 生成器          | 编码器            | 编辑方向     |\n| ------------------------------ | ------------------ | ------------------ | ------------------ |\n| anycost-ffhq-config-f          | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| anycost-ffhq-config-f-flexible | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| anycost-car-config-f           | :heavy_check_mark: |                    |                    |\n| stylegan2-ffhq-config-f        | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n`stylegan2-ffhq-config-f` 指的是从 [repo](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fstylegan2) 转换而来的官方 StyleGAN2 生成器。\n\n\n\n### 数据集\n\n我们已将 [FFHQ](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fffhq-dataset)、[CelebA-HQ](https:\u002F\u002Fgithub.com\u002Fswitchablenorms\u002FCelebAMask-HQ) 和 [LSUN Car](https:\u002F\u002Fgithub.com\u002Ffyu\u002Flsun) 数据集整理成一个图像目录，以便于与 `torchvision` 中的 `ImageFolder` 一起使用。数据集的布局如下：\n\n```\n├── PATH_TO_DATASET\n│   ├── images\n│   │   ├── 00000.png\n│   │   ├── 00001.png\n│   │   ├── ...\n```\n\n由于版权问题，你需要从官方网站下载这些数据集并进行相应处理。\n\n### 评估\n\n我们提供了用于评估论文中所提部分指标的代码。部分代码使用了 [`horovod`](https:\u002F\u002Fgithub.com\u002Fhorovod\u002Fhorovod) 编写，以支持分布式评估并降低 GPU 间通信开销，从而显著提升速度。请参考其官网进行正确安装。\n\n#### Fréchet Inception 距离 (FID)\n\n在计算 FID 之前，您需要使用类似以下脚本计算真实图像的 Inception 特征：\n\n```bash\npython tools\u002Fcalc_inception.py \\\n    --resolution 1024 --batch_size 64 -j 16 --n_sample 50000 \\\n    --save_name assets\u002Finceptions\u002Finception_ffhq_res1024_50k.pkl \\\n    FFHQ 数据集路径\n```\n\n或者您可以从 [这里](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fbc8a7ewlvcxa2cf\u002FAAD8NFzDWKmBDpbLef-gGhRZa?dl=0) 下载预先计算好的 Inception 特征，并将其放置在 `assets\u002Finceptions` 目录下。\n\n随后，您可以通过运行以下命令来计算 FID：\n\n```bash\nhorovodrun -np N_GPU \\\n    python metrics\u002Ffid.py \\\n    --config anycost-ffhq-config-f \\\n    --batch_size 16 --n_sample 50000 \\\n    --inception assets\u002Finceptions\u002Finception_ffhq_res1024_50k.pkl\n    # --channel_ratio 0.5 --target_res 512  # 可选：使用较小分辨率或通道数\n```\n\n#### 感知路径长度 (PPL)\n\n同样地，可以通过以下命令评估 PPL：\n\n```bash\nhorovodrun -np N_GPU \\\n    python metrics\u002Fppl.py \\\n    --config anycost-ffhq-config-f\n```\n\n#### 属性一致性\n\n通过运行以下命令可以评估属性一致性：\n\n```bash\nhorovodrun -np N_GPU \\\n    python metrics\u002Fattribute_consistency.py \\\n    --config anycost-ffhq-config-f \\\n    --channel_ratio 0.5 --target_res 512  # 子生成器的配置；必需\n```\n\n#### 编码器评估\n\n要评估编码器的性能，请运行以下命令：\n\n```bash\npython metrics\u002Feval_encoder.py \\\n    --config anycost-ffhq-config-f \\\n    --data_path CELEBA HQ 数据集路径\n```\n\n\n\n### 训练\n\n我们提供了在 FFHQ 数据集上训练 Anycost GAN 的脚本。\n\n- 在 FFHQ 上训练原始 StyleGAN2\n\n```\nhorovodrun -np 8 bash scripts\u002Ftrain_stylegan2_ffhq.sh\n```\n\n原始 StyleGAN2 的训练非常耗时。我们建议从 [这里](https:\u002F\u002Fwww.dropbox.com\u002Fsh\u002Fl8g9amoduz99kjh\u002FAAAY9LYZk2CnsO43ywDrLZpEa?dl=0) 下载转换后的检查点，并将其放置在 `checkpoint\u002F` 目录下。\n\n- 训练 Anycost GAN：多分辨率\n\n```\nhorovodrun -np 8 bash scripts\u002Ftrain_stylegan2_multires_ffhq.sh\n```\n\n请注意，每完成一个 epoch，我们都会评估两种分辨率（1024 和 512）的 FID，以便更好地监控训练进度。此外，我们还应用了蒸馏技术来加速收敛，但该技术并未用于论文中的消融实验。\n\n- 训练 Anycost GAN：自适应通道\n\n```\nhorovodrun -np 8 bash scripts\u002Ftrain_stylegan2_multires_adach_ffhq.sh\n```\n\n在此设置中，我们采用了更长的训练周期以获得更稳定的生成效果，但这并非必要条件（取决于随机性）。\n\n\n\n**注意**：我们是在配备 24GB 显存的 Titan RTX GPU 上训练模型的。对于显存较小的 GPU，您可能需要降低分辨率、模型规模、批量大小等，并相应调整其他超参数。\n\n\n\n## 引用\n\n如果您在研究中使用此代码，请引用我们的论文。\n\n```\n@inproceedings{lin2021anycost,\n  author    = {Lin, Ji and Zhang, Richard and Ganz, Frieder and Han, Song and Zhu, Jun-Yan},\n  title     = {Anycost GANs for Interactive Image Synthesis and Editing},\n  booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year      = {2021},\n}\n```\n\n\n\n## 相关项目\n\n**[GAN 压缩](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fgan-compression) | [Once for All](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fonce-for-all) | [iGAN](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FiGAN) | [StyleGAN2](https:\u002F\u002Fgithub.com\u002FNVlabs\u002Fstylegan2)**\n\n\n\n## 致谢\n\n我们感谢 Taesung Park、Zhixin Shu、Muyang Li 和 Han Cai 提供的有益讨论。本工作部分得到了 NSF CAREER 奖 #1943349、Adobe、SONY、Naver 公司以及 MIT-IBM Watson AI 实验室的支持。\n\n该代码库基于 StyleGAN2 的 PyTorch 实现：[rosinality\u002Fstylegan2-pytorch](https:\u002F\u002Fgithub.com\u002Frosinality\u002Fstylegan2-pytorch)。在编辑方向提取方面，我们参考了 [InterFaceGAN](https:\u002F\u002Fgithub.com\u002Fgenforce\u002Finterfacegan)。","# Anycost GAN 快速上手指南\n\nAnycost GAN 是一个支持在不同计算预算（分辨率和通道数）下生成一致图像的生成对抗网络。它特别适用于交互式图像编辑，能够提供快速的低精度预览和高质量最终输出。\n\n## 环境准备\n\n*   **操作系统**: Linux (推荐) 或 macOS\n*   **Python**: 3.6+\n*   **深度学习框架**: PyTorch 1.7+\n*   **硬件要求**:\n    *   **推理\u002F演示**: 任意 CUDA GPU (显存建议 4GB+)\n    *   **训练**: 多卡环境推荐 (原文使用 Titan RTX 24GB)，小显存需调整 batch size 或分辨率。\n*   **依赖管理**: 推荐使用 Conda 进行环境隔离。\n\n> **注意**: 国内用户若无法访问默认源，建议在创建环境前配置清华或中科大镜像源：\n> ```bash\n> conda config --add channels https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Fanaconda\u002Fpkgs\u002Fmain\u002F\n> conda config --add channels https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Fanaconda\u002Fpkgs\u002Ffree\u002F\n> ```\n\n## 安装步骤\n\n1.  **克隆项目代码**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan.git\n    cd anycost-gan\n    ```\n\n2.  **创建并激活虚拟环境**\n    项目提供了 `environment.yml` 文件，可一键安装所有依赖。\n    ```bash\n    conda env create -f environment.yml\n    conda activate anycost-gan\n    ```\n    *(如果自动安装失败，请手动安装 `torch==1.7` 及其他列出的依赖包)*\n\n3.  **下载预训练模型 (可选但推荐)**\n    首次运行代码时，脚本会自动下载模型。若网络较慢，可手动下载后放入对应目录，或直接运行以下 Python 代码触发下载：\n    ```python\n    import models\n    # 下载生成器、编码器和编辑方向模型 (FFHQ 数据集)\n    models.get_pretrained('generator', config='anycost-ffhq-config-f')\n    models.get_pretrained('encoder', config='anycost-ffhq-config-f')\n    models.get_pretrained('boundary', config='anycost-ffhq-config-f')\n    ```\n\n## 基本使用\n\n### 1. 运行交互式演示 (Interactive Demo)\n这是体验 Anycost GAN \"快速预览 + 高清生成\" 特性的最简单方式。\n\n```bash\n# 标准运行\npython demo.py\n\n# 如果遇到兼容性问题或需要强制本地渲染，尝试：\nFORCE_NATIVE=1 python demo.py\n```\n*操作说明*: 启动后会弹出界面，拖动滑块可实时看到低算力下的快速预览（约快 5 倍），点击 \"Finalize\" 按钮生成高分辨率最终图像。\n\n### 2. 代码调用示例 (Python API)\n在 Python 脚本中加载模型并动态调整计算成本（通道比例和分辨率）。\n\n```python\nimport torch\nfrom models.dynamic_channel import set_uniform_channel_ratio, reset_generator\nimport models\n\n# 1. 加载预训练生成器\ng = models.get_pretrained('generator', config='anycost-ffhq-config-f')\ng.eval()\n\n# 2. 设置计算预算\n# 设置通道比例为 0.5 (即使用 50% 的通道数)\nset_uniform_channel_ratio(g, 0.5) \n# 设置目标分辨率为 512\ng.target_res = 512 \n\n# 3. 准备输入噪声 (示例为 batch_size=1)\nz = torch.randn(1, 512).cuda() \n\n# 4. 生成图像\nwith torch.no_grad():\n    out, _ = g(z)\n\n# out 即为生成的图像张量\nprint(f\"Generated image shape: {out.shape}\")\n\n# 5. 恢复生成器到默认状态 (满血版)\nreset_generator(g)\n```\n\n### 3. 使用 Colab 在线体验\n无需本地配置，可直接在 Google Colab 中运行官方提供的 Notebook：\n*   [Anycost GAN Intro Colab](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fmit-han-lab\u002Fanycost-gan\u002Fblob\u002Fmaster\u002Fnotebooks\u002Fintro_colab.ipynb)\n*   **提示**: 进入 Colab 后，请在菜单栏选择 `运行时 (Runtime)` -> `更改运行时类型` -> 硬件加速器选择 `GPU`。","一位数字艺术家正在使用生成式 AI 辅助创作高精度人像，需要在实时调整面部特征（如年龄、表情）的同时确保最终输出达到出版级画质。\n\n### 没有 anycost-gan 时\n- **交互延迟严重**：每次微调参数后，完整模型渲染一张高清图需耗时约 3 秒，导致操作反馈滞后，创作灵感频繁被打断。\n- **试错成本高昂**：由于无法快速预览效果，艺术家不敢大胆尝试多种风格组合，只能保守地进行少量修改。\n- **硬件资源浪费**：为了获得流畅体验，不得不持续占用高性能 GPU 进行全量计算，即使在简单的构思阶段也无法释放算力。\n- **工作流割裂**：通常需要先利用低质模型快速草拟，再切换至高精度模型重绘，两个阶段的图像风格难以保持完全一致。\n\n### 使用 anycost-gan 后\n- **实时流畅预览**：anycost-gan 能以 5 倍于原模型的速度生成视觉相似的预览图，将等待时间压缩至毫秒级，实现“所调即所见”的丝滑交互。\n- **激发创作潜能**：极低的响应延迟鼓励艺术家自由探索大量参数组合，快速验证创意想法，显著提升了设计迭代效率。\n- **动态算力分配**：在编辑阶段自动调用低通道、低分辨率的子生成器以节省资源，仅在点击“最终确定”时才启动全量计算输出高清成品。\n- **高度一致性保障**：得益于多分辨率训练技术，预览图与最终成图在结构和细节上保持高度一致，消除了二次重绘带来的偏差风险。\n\nanycost-gan 通过动态调整计算预算，完美平衡了交互式编辑的实时速度与最终生成的图像质量，让人像合成工作流既快又准。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmit-han-lab_anycost-gan_a7a355f5.gif","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],{"name":82,"color":83,"percentage":84},"Python","#3572A5",88,{"name":86,"color":87,"percentage":88},"Cuda","#3A4E3A",9.8,{"name":90,"color":91,"percentage":92},"C++","#f34b7d",1.2,{"name":94,"color":95,"percentage":96},"Shell","#89e051",1,782,98,"2026-04-06T05:44:10","MIT","Linux, macOS","需要 NVIDIA GPU (支持 CUDA)，官方训练环境使用 Titan RTX (24GB 显存)。显存较小需降低分辨率或批次大小。Colab 演示需选择 GPU 加速器。","未说明",{"notes":105,"python":106,"dependencies":107},"1. 推荐使用 Anaconda 通过 'environment.yml' 文件创建环境。2. 评估指标计算支持分布式运行，需安装 Horovod。3. 官方模型在 24GB 显存的 Titan RTX 上训练，小显存用户需调整超参数。4. 数据集（FFHQ, CelebA-HQ, LSUN Car）需自行下载并按指定目录结构整理。5. 交互式演示在原生模式下可尝试设置 FORCE_NATIVE=1。","未说明 (依赖 Anaconda 环境配置)",[108,109,110,111,112],"torch==1.7","horovod","torchvision","numpy","pillow",[15,14],[115,116,117,118,119,120,121,122,123,124,125],"computer-vision","deep-learning","computer-graphics","generative-adversarial-network","gan","image-generation","image-manipulation","image-editing","gans","pytorch","stylegan2","2026-03-27T02:49:30.150509","2026-04-13T16:41:55.930074",[129,134,139,144,149,154],{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},31757,"如何将该工具应用于其他数据集（如 LSUN Churches 或 Cars）并发现编辑方向？","对于非人脸数据集（如 LSUN），由于没有预定义的属性标签，你需要使用无监督方法来发现编辑方向。可以参考论文 https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.02546 中描述的方法。基本步骤包括：确保数据格式匹配、更改配置名称以对应预训练网络（如 'stylegan2-church-config-f'），并自行计算或加载属性预测器。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan\u002Fissues\u002F19",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},31754,"使用配置 'stylegan2-' 生成的图像不正确或报错，如何解决？","这是因为你使用了原始的 StyleGAN2 配置而不是 AnycostGAN 的配置。请将配置文件名从 `gan_config = 'stylegan2-ffhq-config-f'` 替换为 `gan_config = 'anycost-ffhq-config-f'`。修改后通常能正常工作。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan\u002Fissues\u002F23",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},31755,"运行代码时生成全灰图像，且指定特定 GPU（如 'cuda:2'）失败怎么办？","这是 PyTorch 自定义 CUDA 内核实现的一个已知问题。解决方法是将设备设置从 `device = 'cuda:2'` 改为 `device = 'cuda'`。如果必须指定特定 GPU，可以在环境变量中添加 `FORCE_NATIVE=1`，然后使用 `device='cuda:2'`（注意冒号格式可能需调整，或者直接设为 'cuda' 让系统自动调度）。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan\u002Fissues\u002F18",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},31756,"在哪里可以下载到多分辨率训练步骤（mult-resolution step）的中间检查点（checkpoint）？","生成器（Generator）和判别器（Discriminator）的多分辨率检查点可以从以下链接下载：https:\u002F\u002Fhanlab.mit.edu\u002Fprojects\u002Fanycost-gan\u002Ffiles\u002Fgnd_multires-ffhq-config-f.pth。如果链接仅包含生成器，请检查项目文件页面获取最新的完整包。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan\u002Fissues\u002F17",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},31758,"在计算 FID 指标时发现训练代码和评估代码的数据增强策略不一致（如随机翻转），这是 Bug 吗？","这是一个值得注意的差异。在计算 FID 时使用了带随机翻转的变换，而训练代码中仅做了 clamp 操作没有翻转。虽然维护者确认了这一点，但在实际评估中，这种不一致可能导致评估结果偏差。建议在复现或严格评估时，确保评估管道的预处理与训练保持一致，或者理解该差异对最终分数的潜在影响。","https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Fanycost-gan\u002Fissues\u002F27",{"id":155,"question_zh":156,"answer_zh":157,"source_url":153},31759,"如何使用 ResNet50 编码器替换映射网络（Mapping Network）进行图像增强任务？效果如何？","有用户尝试用 ResNet50 编码器替换映射网络用于人脸图像增强任务，但发现结果不如预期（相比 GPEN 或原始 StyleGAN2），生成的图像虽然清晰但看起来明显虚假（类似 ESRGAN 的效果）。目前官方未提供针对此修改的最佳实践，建议谨慎使用或继续优化编码器与合成网络之间的适配。",[]]