[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-clovaai--stargan-v2":3,"tool-clovaai--stargan-v2":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 真正成长为懂上",160784,2,"2026-04-19T11:32: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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[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":77,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":10,"env_os":93,"env_gpu":94,"env_ram":95,"env_deps":96,"category_tags":110,"github_topics":111,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":116,"updated_at":117,"faqs":118,"releases":154},9621,"clovaai\u002Fstargan-v2","stargan-v2","StarGAN v2 - Official PyTorch Implementation (CVPR 2020)","StarGAN v2 是一款基于 PyTorch 开发的图像生成工具，专注于实现跨多个视觉领域的高质量图像转换。它旨在解决传统图像翻译模型面临的两大难题：一是生成结果缺乏多样性，往往只能产生单一风格的输出；二是难以灵活扩展至多个目标领域，通常需为每个领域单独训练模型。\n\nStarGAN v2 通过统一的框架，仅需一个模型即可将源图像转换为多种不同风格（如改变人脸的发色、性别或动物品种），同时确保生成图像具有高清晰度和丰富的变化性。其核心技术亮点在于引入了风格编码器和映射网络，能够从参考图像中提取多样化的风格特征，并支持在同一领域内生成截然不同的结果。此外，项目还发布了高质量的动物面部数据集（AFHQ），进一步推动了该领域的评估标准。\n\n这款工具非常适合计算机视觉研究人员、AI 开发者以及需要批量生成多样化图像内容的设计师使用。对于希望探索图像合成前沿技术或构建多风格图像应用的用户来说，StarGAN v2 提供了完善的预训练模型和易于复现的代码库，是兼具学术价值与实用性的优秀开源项目。","\n## StarGAN v2 - Official PyTorch Implementation\n\n\u003Cp align=\"left\">\u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_0b11d986249a.jpg\" \u002F>\u003C\u002Fp>\n\n> **StarGAN v2: Diverse Image Synthesis for Multiple Domains**\u003Cbr>\n> [Yunjey Choi](https:\u002F\u002Fgithub.com\u002Fyunjey)\\*, [Youngjung Uh](https:\u002F\u002Fgithub.com\u002Fyoungjung)\\*, [Jaejun Yoo](http:\u002F\u002Fjaejunyoo.blogspot.com\u002Fsearch\u002Flabel\u002Fkr)\\*, [Jung-Woo Ha](https:\u002F\u002Fwww.facebook.com\u002Fjungwoo.ha.921)\u003Cbr>\n> In CVPR 2020. (* indicates equal contribution)\u003Cbr>\n\n> Paper: https:\u002F\u002Farxiv.org\u002Fabs\u002F1912.01865\u003Cbr>\n> Video: https:\u002F\u002Fyoutu.be\u002F0EVh5Ki4dIY\u003Cbr>\n\n> **Abstract:** *A good image-to-image translation model should learn a mapping between different visual domains while satisfying the following properties: 1) diversity of generated images and 2) scalability over multiple domains. Existing methods address either of the issues, having limited diversity or multiple models for all domains. We propose StarGAN v2, a single framework that tackles both and shows significantly improved results over the baselines. Experiments on CelebA-HQ and a new animal faces dataset (AFHQ) validate our superiority in terms of visual quality, diversity, and scalability. To better assess image-to-image translation models, we release AFHQ, high-quality animal faces with large inter- and intra-domain variations. The code, pre-trained models, and dataset are available at clovaai\u002Fstargan-v2.*\n\n## Teaser video\nClick the figure to watch the teaser video. \u003Cbr\u002F>\n\n[![IMAGE ALT TEXT HERE](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_72b58d9a34ac.jpg)](https:\u002F\u002Fyoutu.be\u002F0EVh5Ki4dIY)\n\n## TensorFlow implementation\nThe TensorFlow implementation of StarGAN v2 by our team member junho can be found at [clovaai\u002Fstargan-v2-tensorflow](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2-tensorflow).\n\n## Software installation\nClone this repository:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2.git\ncd stargan-v2\u002F\n```\n\nInstall the dependencies:\n```bash\nconda create -n stargan-v2 python=3.6.7\nconda activate stargan-v2\nconda install -y pytorch=1.4.0 torchvision=0.5.0 cudatoolkit=10.0 -c pytorch\nconda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge\npip install opencv-python==4.1.2.30 ffmpeg-python==0.2.0 scikit-image==0.16.2\npip install pillow==7.0.0 scipy==1.2.1 tqdm==4.43.0 munch==2.5.0\n```\n\n## Datasets and pre-trained networks\nWe provide a script to download datasets used in StarGAN v2 and the corresponding pre-trained networks. The datasets and network checkpoints will be downloaded and stored in the `data` and `expr\u002Fcheckpoints` directories, respectively.\n\n\u003Cb>CelebA-HQ.\u003C\u002Fb> To download the [CelebA-HQ](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B4qLcYyJmiz0TXY1NG02bzZVRGs) dataset and the pre-trained network, run the following commands:\n```bash\nbash download.sh celeba-hq-dataset\nbash download.sh pretrained-network-celeba-hq\nbash download.sh wing\n```\n\n\u003Cb>AFHQ.\u003C\u002Fb> To download the [AFHQ](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002FREADME.md#animal-faces-hq-dataset-afhq) dataset and the pre-trained network, run the following commands:\n```bash\nbash download.sh afhq-dataset\nbash download.sh pretrained-network-afhq\n```\n\n\n## Generating interpolation videos\nAfter downloading the pre-trained networks, you can synthesize output images reflecting diverse styles (e.g., hairstyle) of reference images. The following commands will save generated images and interpolation videos to the `expr\u002Fresults` directory. \n\n\n\u003Cb>CelebA-HQ.\u003C\u002Fb> To generate images and interpolation videos, run the following command:\n```bash\npython main.py --mode sample --num_domains 2 --resume_iter 100000 --w_hpf 1 \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fceleba_hq \\\n               --result_dir expr\u002Fresults\u002Fceleba_hq \\\n               --src_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fsrc \\\n               --ref_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fref\n```\n\nTo transform a custom image, first crop the image manually so that the proportion of face occupied in the whole is similar to that of CelebA-HQ. Then, run the following command for additional fine rotation and cropping. All custom images in the `inp_dir` directory will be aligned and stored in the `out_dir` directory.\n\n```bash\npython main.py --mode align \\\n               --inp_dir assets\u002Frepresentative\u002Fcustom\u002Ffemale \\\n               --out_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fsrc\u002Ffemale\n```\n\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_f1a30d171953.gif\" \u002F>\u003C\u002Fp>\n\n\n\u003Cb>AFHQ.\u003C\u002Fb> To generate images and interpolation videos, run the following command:\n```bash\npython main.py --mode sample --num_domains 3 --resume_iter 100000 --w_hpf 0 \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fafhq \\\n               --result_dir expr\u002Fresults\u002Fafhq \\\n               --src_dir assets\u002Frepresentative\u002Fafhq\u002Fsrc \\\n               --ref_dir assets\u002Frepresentative\u002Fafhq\u002Fref\n```\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_5d313b6689d7.gif\" \u002F>\u003C\u002Fp>\n\n## Evaluation metrics\nTo evaluate StarGAN v2 using [Fr&eacute;chet Inception Distance (FID)](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.08500) and [Learned Perceptual Image Patch Similarity (LPIPS)](https:\u002F\u002Farxiv.org\u002Fabs\u002F1801.03924), run the following commands:\n\n\n```bash\n# celeba-hq\npython main.py --mode eval --num_domains 2 --w_hpf 1 \\\n               --resume_iter 100000 \\\n               --train_img_dir data\u002Fceleba_hq\u002Ftrain \\\n               --val_img_dir data\u002Fceleba_hq\u002Fval \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fceleba_hq \\\n               --eval_dir expr\u002Feval\u002Fceleba_hq\n\n# afhq\npython main.py --mode eval --num_domains 3 --w_hpf 0 \\\n               --resume_iter 100000 \\\n               --train_img_dir data\u002Fafhq\u002Ftrain \\\n               --val_img_dir data\u002Fafhq\u002Fval \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fafhq \\\n               --eval_dir expr\u002Feval\u002Fafhq\n```\n\nNote that the evaluation metrics are calculated using random latent vectors or reference images, both of which are selected by the [seed number](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002Fmain.py#L35). In the paper, we reported the average of values from 10 measurements using different seed numbers. The following table shows the calculated values for both latent-guided and reference-guided synthesis.\n\n| Dataset \u003Cimg width=50\u002F> | \u003Cimg width=15\u002F> FID (latent) \u003Cimg width=15\u002F>  | \u003Cimg width=10\u002F> LPIPS (latent) \u003Cimg width=10\u002F> | \u003Cimg width=5\u002F> FID (reference) \u003Cimg width=5\u002F> | LPIPS (reference) | \u003Cimg width=10\u002F> Elapsed time \u003Cimg width=10\u002F>  |\n| :---------- | :------------: | :----: | :-----: | :----: | :----------:|\n| `celeba-hq` | 13.73 &pm; 0.06 | 0.4515 &pm; 0.0006  | 23.84  &pm; 0.03 | 0.3880 &pm; 0.0001 | 49min 51s\n| `afhq` | 16.18 &pm; 0.15 | 0.4501 &pm; 0.0007 | 19.78 &pm; 0.01 | 0.4315 &pm; 0.0002 | 64min 49s\n\n\n\n## Training networks\nTo train StarGAN v2 from scratch, run the following commands. Generated images and network checkpoints will be stored in the `expr\u002Fsamples` and `expr\u002Fcheckpoints` directories, respectively. Training takes about three days on a single Tesla V100 GPU. Please see [here](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002Fmain.py#L86-L179) for training arguments and a description of them. \n\n```bash\n# celeba-hq\npython main.py --mode train --num_domains 2 --w_hpf 1 \\\n               --lambda_reg 1 --lambda_sty 1 --lambda_ds 1 --lambda_cyc 1 \\\n               --train_img_dir data\u002Fceleba_hq\u002Ftrain \\\n               --val_img_dir data\u002Fceleba_hq\u002Fval\n\n# afhq\npython main.py --mode train --num_domains 3 --w_hpf 0 \\\n               --lambda_reg 1 --lambda_sty 1 --lambda_ds 2 --lambda_cyc 1 \\\n               --train_img_dir data\u002Fafhq\u002Ftrain \\\n               --val_img_dir data\u002Fafhq\u002Fval\n```\n\n## Animal Faces-HQ dataset (AFHQ)\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_95adce84d235.jpg\" \u002F>\u003C\u002Fp>\n\nWe release a new dataset of animal faces, Animal Faces-HQ (AFHQ), consisting of 15,000 high-quality images at 512×512 resolution. The figure above shows example images of the AFHQ dataset. The dataset includes three domains of cat, dog, and wildlife, each providing about 5000 images. By having multiple (three) domains and diverse images of various breeds per each domain, AFHQ sets a challenging image-to-image translation problem. For each domain, we select 500 images as a test set and provide all remaining images as a training set. To download the dataset, run the following command:\n\n```bash\nbash download.sh afhq-dataset\n```\n\n\n**[Update: 2021.07.01]** We rebuild the original AFHQ dataset by using high-quality resize filtering (i.e., Lanczos resampling). Please see the [clean FID paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2104.11222) that brings attention to the unfortunate software library situation for downsampling. We thank to [Alias-Free GAN](https:\u002F\u002Fnvlabs.github.io\u002Falias-free-gan\u002F) authors for their suggestion and contribution to the updated AFHQ dataset. If you use the updated dataset, we recommend to cite not only our paper but also their paper.\n\nThe differences from the original dataset are as follows:\n* We resize the images using Lanczos resampling instead of nearest neighbor downsampling.\n* About 2% of the original images had been removed. So the set is now has 15803 images, whereas the original had 16130.\n* Images are saved as PNG format to avoid compression artifacts. This makes the files bigger than the original, but it's worth it.\n\n\nTo download the updated dataset, run the following command:\n\n```bash\nbash download.sh afhq-v2-dataset\n```\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_86520e9fb5a2.jpg\" \u002F>\u003C\u002Fp>\n\n\n\n## License\nThe source code, pre-trained models, and dataset are available under [Creative Commons BY-NC 4.0](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002FLICENSE) license by NAVER Corporation. You can **use, copy, tranform and build upon** the material for **non-commercial purposes** as long as you give **appropriate credit** by citing our paper, and indicate if changes were made. \n\nFor business inquiries, please contact clova-jobs@navercorp.com.\u003Cbr\u002F>\t\nFor technical and other inquires, please contact yunjey.choi@navercorp.com.\n\n\n## Citation\nIf you find this work useful for your research, please cite our paper:\n\n```\n@inproceedings{choi2020starganv2,\n  title={StarGAN v2: Diverse Image Synthesis for Multiple Domains},\n  author={Yunjey Choi and Youngjung Uh and Jaejun Yoo and Jung-Woo Ha},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  year={2020}\n}\n```\n\n## Acknowledgements\nWe would like to thank the full-time and visiting Clova AI Research (now NAVER AI Lab) members for their valuable feedback and an early review: especially Seongjoon Oh, Junsuk Choe, Muhammad Ferjad Naeem, and Kyungjune Baek. We also thank Alias-Free GAN authors for their contribution to the updated AFHQ dataset.\n","## StarGAN v2 - 官方 PyTorch 实现\n\n\u003Cp align=\"left\">\u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_0b11d986249a.jpg\" \u002F>\u003C\u002Fp>\n\n> **StarGAN v2：多域多样化图像合成**\u003Cbr>\n> [Yunjey Choi](https:\u002F\u002Fgithub.com\u002Fyunjey)\\*, [Youngjung Uh](https:\u002F\u002Fgithub.com\u002Fyoungjung)\\*, [Jaejun Yoo](http:\u002F\u002Fjaejunyoo.blogspot.com\u002Fsearch\u002Flabel\u002Fkr)\\*, [Jung-Woo Ha](https:\u002F\u002Fwww.facebook.com\u002Fjungwoo.ha.921)\u003Cbr>\n> 于 CVPR 2020 发表。(* 表示共同第一作者)\u003Cbr>\n\n> 论文：https:\u002F\u002Farxiv.org\u002Fabs\u002F1912.01865\u003Cbr>\n> 视频：https:\u002F\u002Fyoutu.be\u002F0EVh5Ki4dIY\u003Cbr>\n\n> **摘要：** *优秀的图像到图像转换模型应在不同视觉域之间学习映射关系，同时满足以下特性：1) 生成图像的多样性；2) 对多个域的可扩展性。现有方法往往只解决其中一个问题，要么生成的图像缺乏多样性，要么需要为每个域单独训练一个模型。我们提出了 StarGAN v2，这是一个能够同时解决这两个问题的统一框架，并在基准测试中显著优于现有方法。我们在 CelebA-HQ 数据集以及一个新的动物人脸数据集 (AFHQ) 上进行的实验验证了我们在视觉质量、多样性和可扩展性方面的优越性。为了更好地评估图像到图像转换模型，我们发布了 AFHQ 数据集，该数据集包含高质量的动物人脸图像，具有较大的域间和域内差异。代码、预训练模型和数据集均可在 clovaai\u002Fstargan-v2 中获取。*\n\n## 预告视频\n点击图片观看预告视频。\u003Cbr\u002F>\n\n[![IMAGE ALT TEXT HERE](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_72b58d9a34ac.jpg)](https:\u002F\u002Fyoutu.be\u002F0EVh5Ki4dIY)\n\n## TensorFlow 实现\n我们团队成员 junho 提供的 StarGAN v2 的 TensorFlow 实现可在 [clovaai\u002Fstargan-v2-tensorflow](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2-tensorflow) 找到。\n\n## 软件安装\n克隆本仓库：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2.git\ncd stargan-v2\u002F\n```\n\n安装依赖项：\n```bash\nconda create -n stargan-v2 python=3.6.7\nconda activate stargan-v2\nconda install -y pytorch=1.4.0 torchvision=0.5.0 cudatoolkit=10.0 -c pytorch\nconda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge\npip install opencv-python==4.1.2.30 ffmpeg-python==0.2.0 scikit-image==0.16.2\npip install pillow==7.0.0 scipy==1.2.1 tqdm==4.43.0 munch==2.5.0\n```\n\n## 数据集与预训练网络\n我们提供了一个脚本，用于下载 StarGAN v2 中使用的数据集及其对应的预训练网络。数据集和网络检查点将分别下载并存储在 `data` 和 `expr\u002Fcheckpoints` 目录中。\n\n\u003Cb>CelebA-HQ。\u003C\u002Fb> 若要下载 [CelebA-HQ](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B4qLcYyJmiz0TXY1NG02bzZVRGs) 数据集及预训练网络，请运行以下命令：\n```bash\nbash download.sh celeba-hq-dataset\nbash download.sh pretrained-network-celeba-hq\nbash download.sh wing\n```\n\n\u003Cb>AFHQ。\u003C\u002Fb> 若要下载 [AFHQ](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002FREADME.md#animal-faces-hq-dataset-afhq) 数据集及预训练网络，请运行以下命令：\n```bash\nbash download.sh afhq-dataset\nbash download.sh pretrained-network-afhq\n```\n\n\n## 生成插值视频\n下载预训练网络后，您可以合成反映参考图像多样化风格（例如发型）的输出图像。以下命令会将生成的图像和插值视频保存到 `expr\u002Fresults` 目录中。\n\n\n\u003Cb>CelebA-HQ。\u003C\u002Fb> 若要生成图像和插值视频，请运行以下命令：\n```bash\npython main.py --mode sample --num_domains 2 --resume_iter 100000 --w_hpf 1 \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fceleba_hq \\\n               --result_dir expr\u002Fresults\u002Fceleba_hq \\\n               --src_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fsrc \\\n               --ref_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fref\n```\n\n若要转换自定义图像，首先需手动裁剪图像，使面部占整个图像的比例与 CelebA-HQ 数据集相似。然后，运行以下命令进行进一步的微调旋转和裁剪。所有位于 `inp_dir` 目录中的自定义图像都将被对齐并存储在 `out_dir` 目录中。\n\n```bash\npython main.py --mode align \\\n               --inp_dir assets\u002Frepresentative\u002Fcustom\u002Ffemale \\\n               --out_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fsrc\u002Ffemale\n```\n\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_f1a30d171953.gif\" \u002F>\u003C\u002Fp>\n\n\n\u003Cb>AFHQ。\u003C\u002Fb> 若要生成图像和插值视频，请运行以下命令：\n```bash\npython main.py --mode sample --num_domains 3 --resume_iter 100000 --w_hpf 0 \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fafhq \\\n               --result_dir expr\u002Fresults\u002Fafhq \\\n               --src_dir assets\u002Frepresentative\u002Fafhq\u002Fsrc \\\n               --ref_dir assets\u002Frepresentative\u002Fafhq\u002Fref\n```\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_5d313b6689d7.gif\" \u002F>\u003C\u002Fp>\n\n## 评估指标\n要使用 [Fr&eacute;chet Inception Distance (FID)](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.08500) 和 [Learned Perceptual Image Patch Similarity (LPIPS)](https:\u002F\u002Farxiv.org\u002Fabs\u002F1801.03924) 评估 StarGAN v2，请运行以下命令：\n\n\n```bash\n# celeba-hq\npython main.py --mode eval --num_domains 2 --w_hpf 1 \\\n               --resume_iter 100000 \\\n               --train_img_dir data\u002Fceleba_hq\u002Ftrain \\\n               --val_img_dir data\u002Fceleba_hq\u002Fval \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fceleba_hq \\\n               --eval_dir expr\u002Feval\u002Fceleba_hq\n\n# afhq\npython main.py --mode eval --num_domains 3 --w_hpf 0 \\\n               --resume_iter 100000 \\\n               --train_img_dir data\u002Fafhq\u002Ftrain \\\n               --val_img_dir data\u002Fafhq\u002Fval \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fafhq \\\n               --eval_dir expr\u002Feval\u002Fafhq\n```\n\n请注意，评估指标是通过随机潜在向量或参考图像计算得出的，而这些向量或图像均由 [seed number](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002Fmain.py#L35) 决定。在论文中，我们报告了使用不同 seed number 进行 10 次测量后的平均值。下表展示了基于潜在向量引导和基于参考图像引导的合成所计算出的数值。\n\n| 数据集 \u003Cimg width=50\u002F> | \u003Cimg width=15\u002F> FID (潜在) \u003Cimg width=15\u002F>  | \u003Cimg width=10\u002F> LPIPS (潜在) \u003Cimg width=10\u002F> | \u003Cimg width=5\u002F> FID (参考) \u003Cimg width=5\u002F> | LPIPS (参考) | \u003Cimg width=10\u002F> 耗时 \u003Cimg width=10\u002F>  |\n| :---------- | :------------: | :----: | :-----: | :----: | :----------:|\n| `celeba-hq` | 13.73 &pm; 0.06 | 0.4515 &pm; 0.0006  | 23.84  &pm; 0.03 | 0.3880 &pm; 0.0001 | 49分51秒\n| `afhq` | 16.18 &pm; 0.15 | 0.4501 &pm; 0.0007 | 19.78 &pm; 0.01 | 0.4315 &pm; 0.0002 | 64分49秒\n\n## 训练网络\n要从头开始训练 StarGAN v2，请运行以下命令。生成的图像和网络检查点将分别存储在 `expr\u002Fsamples` 和 `expr\u002Fcheckpoints` 目录中。在单个 Tesla V100 GPU 上，训练大约需要三天时间。有关训练参数及其说明，请参阅 [此处](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002Fmain.py#L86-L179)。\n\n```bash\n# celeba-hq\npython main.py --mode train --num_domains 2 --w_hpf 1 \\\n               --lambda_reg 1 --lambda_sty 1 --lambda_ds 1 --lambda_cyc 1 \\\n               --train_img_dir data\u002Fceleba_hq\u002Ftrain \\\n               --val_img_dir data\u002Fceleba_hq\u002Fval\n\n# afhq\npython main.py --mode train --num_domains 3 --w_hpf 0 \\\n               --lambda_reg 1 --lambda_sty 1 --lambda_ds 2 --lambda_cyc 1 \\\n               --train_img_dir data\u002Fafhq\u002Ftrain \\\n               --val_img_dir data\u002Fafhq\u002Fval\n```\n\n## Animal Faces-HQ 数据集 (AFHQ)\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_95adce84d235.jpg\" \u002F>\u003C\u002Fp>\n\n我们发布了一个新的动物人脸数据集——Animal Faces-HQ (AFHQ)，包含 15,000 张 512×512 分辨率的高质量图像。上图展示了 AFHQ 数据集的一些示例图像。该数据集包含猫、狗和野生动物三个类别，每个类别约有 5,000 张图像。由于具有多个（三个）类别，并且每个类别中还包含多种不同的品种，AFHQ 构成了一个极具挑战性的图像到图像翻译问题。对于每个类别，我们选取 500 张图像作为测试集，其余所有图像则作为训练集。要下载该数据集，请运行以下命令：\n\n```bash\nbash download.sh afhq-dataset\n```\n\n\n**[更新：2021年7月1日]** 我们使用高质量的缩放滤波器（即 Lanczos 重采样）重新构建了原始 AFHQ 数据集。请参阅 [clean FID 论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2104.11222)，其中指出了下采样过程中不幸存在的软件库问题。我们感谢 [Alias-Free GAN](https:\u002F\u002Fnvlabs.github.io\u002Falias-free-gan\u002F) 的作者们对更新后的 AFHQ 数据集提出的建议和贡献。如果您使用更新后的数据集，我们建议您不仅引用我们的论文，也引用他们的论文。\n\n与原始数据集相比，更新后的数据集有以下不同之处：\n* 我们使用 Lanczos 重采样来调整图像大小，而不是最近邻下采样。\n* 原始数据集中约有 2% 的图像已被移除。因此，现在的数据集共有 15,803 张图像，而原始数据集则有 16,130 张。\n* 图像以 PNG 格式保存，以避免压缩伪影。这使得文件体积比原始版本更大，但这样做是值得的。\n\n\n要下载更新后的数据集，请运行以下命令：\n\n```bash\nbash download.sh afhq-v2-dataset\n```\n\n\u003Cp align=\"left\">\u003Cimg width=\"99%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_readme_86520e9fb5a2.jpg\" \u002F>\u003C\u002Fp>\n\n\n\n## 许可证\n源代码、预训练模型和数据集均采用 NAVER Corporation 提供的 [知识共享署名-非商业性使用 4.0](https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fblob\u002Fmaster\u002FLICENSE) 许可证。只要您通过引用我们的论文给予 **适当署名**，并注明是否进行了修改，您就可以出于 **非商业目的** 对这些材料进行 **使用、复制、改编和二次创作**。\n\n如需商务合作，请联系 clova-jobs@navercorp.com。\u003Cbr\u002F>\n如需技术或其他咨询，请联系 yunjey.choi@navercorp.com。\n\n\n## 引用\n如果您发现本研究对您的工作有所帮助，请引用我们的论文：\n\n```\n@inproceedings{choi2020starganv2,\n  title={StarGAN v2: Diverse Image Synthesis for Multiple Domains},\n  author={Yunjey Choi and Youngjung Uh and Jaejun Yoo and Jung-Woo Ha},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  year={2020}\n}\n```\n\n## 致谢\n我们衷心感谢 Clova AI Research（现为 NAVER AI Lab）的全职及访问研究人员提供的宝贵反馈和早期审阅，尤其是 Seongjoon Oh、Junsuk Choe、Muhammad Ferjad Naeem 和 Kyungjune Baek。同时，我们也感谢 Alias-Free GAN 的作者们对更新后的 AFHQ 数据集所做出的贡献。","# StarGAN v2 快速上手指南\n\nStarGAN v2 是一个用于多域图像合成的高质量生成模型，支持在单个框架内实现多样化的风格迁移（如人脸属性编辑、动物品种转换等）。本指南帮助中国开发者快速完成环境搭建与基础推理。\n\n## 环境准备\n\n- **操作系统**：Linux（推荐 Ubuntu 18.04+）\n- **Python 版本**：3.6.7\n- **GPU 要求**：支持 CUDA 10.0 的 NVIDIA GPU（训练建议 Tesla V100 或同等性能）\n- **前置依赖**：\n  - Conda（推荐使用 [清华镜像源](https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Fhelp\u002Fanaconda\u002F) 加速安装）\n  - Git\n\n> 💡 提示：国内用户可配置 Conda 使用清华或中科大镜像源以提升包下载速度：\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> conda config --set show_channel_urls yes\n> ```\n\n## 安装步骤\n\n1. 克隆项目仓库：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2.git\ncd stargan-v2\u002F\n```\n\n2. 创建并激活 Conda 环境：\n```bash\nconda create -n stargan-v2 python=3.6.7\nconda activate stargan-v2\n```\n\n3. 安装核心依赖（PyTorch 及相关工具）：\n```bash\nconda install -y pytorch=1.4.0 torchvision=0.5.0 cudatoolkit=10.0 -c pytorch\nconda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge\npip install opencv-python==4.1.2.30 ffmpeg-python==0.2.0 scikit-image==0.16.2\npip install pillow==7.0.0 scipy==1.2.1 tqdm==4.43.0 munch==2.5.0\n```\n\n> ⚠️ 若 `conda-forge` 下载缓慢，可尝试替换为国内镜像源或使用 `pip` 安装对应包。\n\n## 基本使用\n\n以下示例演示如何使用预训练模型对 CelebA-HQ 数据集进行风格迁移并生成插值视频。\n\n### 1. 下载预训练模型与示例数据\n```bash\nbash download.sh celeba-hq-dataset\nbash download.sh pretrained-network-celeba-hq\nbash download.sh wing\n```\n\n### 2. 生成风格迁移结果与插值视频\n```bash\npython main.py --mode sample --num_domains 2 --resume_iter 100000 --w_hpf 1 \\\n               --checkpoint_dir expr\u002Fcheckpoints\u002Fceleba_hq \\\n               --result_dir expr\u002Fresults\u002Fceleba_hq \\\n               --src_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fsrc \\\n               --ref_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fref\n```\n\n生成的图像和视频将保存在 `expr\u002Fresults\u002Fceleba_hq` 目录中。\n\n### （可选）处理自定义人脸图像\n若需使用自己的人脸图片，请先手动裁剪使面部占比接近 CelebA-HQ 风格，然后运行对齐命令：\n```bash\npython main.py --mode align \\\n               --inp_dir assets\u002Frepresentative\u002Fcustom\u002Ffemale \\\n               --out_dir assets\u002Frepresentative\u002Fceleba_hq\u002Fsrc\u002Ffemale\n```\n处理后的图像将保存至指定输出目录，随后可用于上述 `sample` 模式进行风格迁移。\n\n---\n\n完成以上步骤后，即可体验 StarGAN v2 的多域多样化图像生成功能。更多高级用法（如训练新模型、评估指标计算等）请参考官方文档。","一家数字娱乐公司的美术团队正在为一款古风 RPG 游戏快速生成大量不同发型和发色的 NPC 角色立绘，以丰富游戏世界的多样性。\n\n### 没有 stargan-v2 时\n- **模型维护成本高**：每增加一种新的发型或发色风格，都需要重新训练一个独立的图像转换模型，导致服务器存储和管理数十个模型文件，极其繁琐。\n- **生成结果单一**：传统方法针对同一张源图只能生成一种固定结果，美术师若想获得多个不同细节的变体，必须反复调整噪声种子或手动修图，效率低下。\n- **跨域扩展困难**：若后续需求从“人物发型”扩展到“动物伙伴毛色”，现有架构无法直接复用，需重新收集数据并从头搭建训练流程。\n- **风格一致性差**：不同模型生成的图像在光照、脸型保持度上存在差异，导致最终素材库风格割裂，后期统一修饰工作量巨大。\n\n### 使用 stargan-v2 后\n- **单模型多域支持**：仅需部署一个 stargan-v2 模型，即可通过切换目标域标签（如“金发”、“黑发”、“红发”）实现多种风格的自由转换，大幅降低运维负担。\n- **多样化样本生成**：利用其潜在的样式编码能力，输入同一张原图配合不同的参考图，能一次性批量生成数十张细节各异但结构一致的高质量变体，供策划挑选。\n- **无缝扩展新类别**：当需要新增“狐狸毛色”或“猫咪花纹”域时，只需在原有框架下微调训练，无需重构代码或更换模型架构，敏捷响应策划需求。\n- **高质量属性保持**：stargan-v2 在改变发型发色的同时，能完美保留人物的面部特征、表情和背景光影，确保所有产出素材视觉风格高度统一。\n\nstargan-v2 通过单一框架实现了多领域、高多样性的图像合成，将美术资源的生产周期从“周级”缩短至“小时级”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fclovaai_stargan-v2_72b58d9a.jpg","clovaai","Clova AI Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fclovaai_47694549.jpg","Open source repository of Clova AI Research, NAVER & LINE",null,"clova-ai-research@navercorp.com","https:\u002F\u002Fclova.ai\u002Fen\u002Fresearch\u002Fresearch-areas.html","https:\u002F\u002Fgithub.com\u002Fclovaai",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",97.4,{"name":86,"color":87,"percentage":88},"Shell","#89e051",2.6,3606,674,"2026-04-16T12:35:33","NOASSERTION","Linux, macOS, Windows","需要 NVIDIA GPU (官方测试环境为 Tesla V100)，需安装 CUDA Toolkit 10.0","未说明",{"notes":97,"python":98,"dependencies":99},"1. 官方推荐使用 Conda 进行环境管理。2. 训练过程在单张 Tesla V100 GPU 上约需 3 天。3. 首次运行需执行脚本下载数据集（CelebA-HQ 或 AFHQ）及预训练模型。4. 若使用自定义图片，需先运行对齐命令进行裁剪和旋转预处理。5. 许可证为 Creative Commons BY-NC 4.0，仅限非商业用途。","3.6.7",[100,101,102,103,104,105,106,107,108,109],"pytorch==1.4.0","torchvision==0.5.0","cudatoolkit==10.0","opencv-python==4.1.2.30","ffmpeg-python==0.2.0","scikit-image==0.16.2","pillow==7.0.0","scipy==1.2.1","tqdm==4.43.0","munch==2.5.0",[15,35,14],[112,113,114,64,115],"pytorch","image-to-image-translation","generative-models","cvpr2020","2026-03-27T02:49:30.150509","2026-04-20T04:06:00.841428",[119,124,129,134,139,144,149],{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},43193,"运行图像对齐（wing alignment）时出现 \"Segmentation fault\" 错误怎么办？","这通常是由 OpenCV 版本或线程设置引起的。解决方法有两种：\n1. 重新安装旧版本的 OpenCV（例如 3.x 版本）：`conda install opencv=3.x`。\n2. 或者在代码中添加 `cv2.setNumThreads(1)` 来限制线程数，参考 OpenCV 相关问题修复：https:\u002F\u002Fgithub.com\u002Fopencv\u002Fopencv\u002Fissues\u002F16030","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F18",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},43194,"生成视频时进程被 \"Killed\" 且未生成视频文件，如何解决？","这通常是由于内存不足导致进程被系统杀死。解决方案是减小验证批大小（batch size）。在运行命令时添加参数 `--val_batch_size 4`（或 8、16），例如：\n`python main.py --mode sample ... --val_batch_size 4`\n即使拥有较大内存（如 64GB），调整此参数也能解决该问题。","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F24",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},43195,"使用较小的 batch size（如 4）训练模型会导致效果变差吗？","是的。为了获得稳定的训练效果和高质量的生成结果（特别是发型和风格多样性），官方建议使用 `batch_size >= 8`。维护者指出，使用 `batch_size=4` 会观察到结果变差。如果受限于显存必须使用小 batch size，即使增加迭代次数或降低学习率，也很难达到与 `batch_size=8` 相同的性能。","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F40",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},43196,"在 Windows 上运行时出现路径错误（FileNotFoundError: Path not found: '{:'）如何解决？","这是由于 Windows 对路径格式的处理差异导致的。解决方法是修改 `core\u002Fsolver.py` 第 58 行，将动态路径格式化改为直接链接到具体的检查点文件。例如，将代码修改为：\n`self.ckptios = [CheckpointIO(ospj(args.checkpoint_dir, '100000_nets_ema.ckpt'), **self.nets_ema)]`\n并确保 `100000_nets_ema.ckpt` 文件直接位于 `expr\u002Fcheckpoints` 文件夹下。或者手动创建所需的目录结构（如 `expr\u002Fcheckpoints`）。","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F3",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},43197,"ResBlk 函数的输出为什么要除以 'math.sqrt(2)'？","这是为了保持信号方差稳定。在残差块（ResBlock）中，通常有两个分支相加。如果每个分支的权重初始化方差为 1，相加后方差会变为 2。除以 `sqrt(2)` 可以将方差归一化回 1，防止信号在前向传播过程中爆炸或消失，有助于训练稳定性。","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F6",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},43198,"生成器（Generator）是否需要 tanh 激活函数？","在该项目的 PyTorch 实现中，生成器的最后输出通常不需要显式的 tanh 激活函数，或者其处理方式与原始 TensorFlow 版本略有不同。如果你是在复现模型，建议检查梯度惩罚（gp）的实现细节或各个模块的参数设置。部分用户反馈在 TensorFlow 版本中有特殊处理，但在本仓库的 PyTorch 代码中需依据具体网络结构确认，通常输入图像已归一化到 [-1, 1] 范围。","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F15",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},43199,"计算 FID 和 LPIPS 指标时出现 \"UnBoundLocalError: local variable 'loader_ref' referenced before assignment\" 错误？","当使用自定义数据集且域数量（num_domains）不是默认的 3 个时，可能会触发此错误。这通常是因为代码逻辑在处理特定模式（mode=\"latent\"）和非标准域数量时存在缺陷。建议检查 `eval` 相关的代码逻辑，确保 `loader_ref` 在所有分支中都被正确初始化，或者尝试使用标准的域数量配置进行评测。","https:\u002F\u002Fgithub.com\u002Fclovaai\u002Fstargan-v2\u002Fissues\u002F11",[]]