[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-yiranran--APDrawingGAN":3,"similar-yiranran--APDrawingGAN":102},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":18,"owner_location":19,"owner_email":20,"owner_twitter":21,"owner_website":22,"owner_url":23,"languages":24,"stars":37,"forks":38,"last_commit_at":39,"license":40,"difficulty_score":41,"env_os":42,"env_gpu":43,"env_ram":44,"env_deps":45,"category_tags":53,"github_topics":56,"view_count":66,"oss_zip_url":21,"oss_zip_packed_at":21,"status":67,"created_at":68,"updated_at":69,"faqs":70,"releases":101},6450,"yiranran\u002FAPDrawingGAN","APDrawingGAN","Code for APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs (CVPR 2019 Oral)","APDrawingGAN 是一款基于生成对抗网络（GAN）的开源项目，旨在将普通的人脸照片自动转化为具有艺术感的肖像素描画。它主要解决了传统图像风格迁移中难以精准捕捉手绘线条神韵、细节丢失或风格不自然的问题，能够生成线条流畅、明暗关系协调且极具手绘质感的艺术作品。\n\n该工具的核心技术亮点在于其提出的“分层 GAN\"架构。不同于普通的端到端转换，APDrawingGAN 通过多层级网络分别处理面部结构、局部细节及整体风格，从而在保持人物特征的同时，模拟出专业画师的笔触逻辑。项目提供了完整的 PyTorch 实现代码、预训练模型以及详细的数据预处理指南，支持用户在本地部署测试或基于自定义数据进行训练。\n\nAPDrawingGAN 非常适合计算机视觉领域的研究人员探索图像生成算法，也适合开发者将其集成到创意应用中。对于数字艺术家和设计师而言，它是一个高效的辅助创作工具，能快速提供灵感草图；而具备一定编程基础的摄影爱好者或普通用户，也可利用其提供的在线演示或简易脚本，轻松将自己的照片转换为独特的素描作品。","\n# APDrawingGAN\n\nWe provide PyTorch implementations for our CVPR 2019 paper \"APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs\".\n\nThis project generates artistic portrait drawings from face photos using a GAN-based model.\nYou may find useful information in [preprocessing steps](preprocess\u002Freadme.md) and [training\u002Ftesting tips](docs\u002Ftips.md).\n\n[[Paper]](http:\u002F\u002Fopenaccess.thecvf.com\u002Fcontent_CVPR_2019\u002Fhtml\u002FYi_APDrawingGAN_Generating_Artistic_Portrait_Drawings_From_Face_Photos_With_Hierarchical_CVPR_2019_paper.html) [[Demo]](https:\u002F\u002Fapdrawing.github.io\u002F)\n\n[[Jittor implementation]](https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN-Jittor)\n\n\n## Our Proposed Framework\n \n\u003Cimg src = 'imgs\u002Farchitecture.png'>\n\n## Sample Results\nUp: input, Down: output\n\u003Cp>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_fb5814e88faf.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_1ed3eb6764fb.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_92750934a2af.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_e10e0ccab5c2.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_5e3cc3d4f2f8.png' width=\"19%\"\u002F>\n\u003C\u002Fp>\n\u003Cp>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_77033802d89d.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_d40557641760.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_f9c93b3da669.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_2f0dee9bf430.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_5a0fa70d4163.png' width=\"19%\"\u002F>\n\u003C\u002Fp>\n\n## Citation\nIf you use this code for your research, please cite our paper.\n```\n@inproceedings{YiLLR19,\n  title     = {{APDrawingGAN}: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs},\n  author    = {Yi, Ran and Liu, Yong-Jin and Lai, Yu-Kun and Rosin, Paul L},\n  booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition (CVPR '19)},\n  pages     = {10743--10752},\n  year      = {2019}\n}\n```\n\n## Prerequisites\n- Linux or macOS\n- Python 2.7\n- CPU or NVIDIA GPU + CUDA CuDNN\n\n\n## Getting Started\n### Installation\n- Install PyTorch 0.4+ and torchvision from http:\u002F\u002Fpytorch.org and other dependencies (e.g., [visdom](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvisdom) and [dominate](https:\u002F\u002Fgithub.com\u002FKnio\u002Fdominate)). You can install all the dependencies by\n```bash\npip install -r requirements.txt\n```\n\n### Quick Start (Apply a Pre-trained Model)\n\n- Download a pre-trained model (using 70 pairs in training set and augmented data) from https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingGAN-Models1.zip (Model1) and put it in `checkpoints\u002Fformal_author`.\n\n- Then generate artistic portrait drawings for example photos in `dataset\u002Fdata\u002Ftest_single` using\n``` bash\npython test.py --dataroot dataset\u002Fdata\u002Ftest_single --name formal_author --model test --dataset_mode single --norm batch --use_local --which_epoch 300\n```\nThe test results will be saved to a html file here: `.\u002Fresults\u002Fformal_author\u002Ftest_300\u002Findex.html`.\n- If you want to test on your own data, please first align your pictures and prepare your data's facial landmarks and background masks according to tutorial in [preprocessing steps](preprocess\u002Freadme.md), then run\n``` bash\npython test.py --dataroot {path_to_aligned_photos} --name formal_author --model test --dataset_mode single --norm batch --use_local --which_epoch 300\n```\n- We also provide an online demo at https:\u002F\u002Fface.lol (optimized, using 120 pairs for training), which will be easier to use if you want to test more photos.\n\n### Train\n- Download our [APDrawing dataset](https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingDB.zip) and copy content to `dataset` folder\n- Download models of pre-traning and auxiliary networks (for fast distance transform and line detection), from https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingGAN-Models2.zip (Model2).\n- Run `python -m visdom.server`\n- Train a model (with pre-training as initialization):\nfirst copy \"pre-training\" models into checkpoints dir of current experiment(`checkpoints\u002F[name]`, e.g. `checkpoints\u002Fformal`), and copy \"auxiliary\" models into `checkpoints\u002Fauxiliary`.\n```bash\npython train.py --dataroot dataset\u002Fdata --name formal --continue_train --use_local --discriminator_local --niter 300 --niter_decay 0 --save_epoch_freq 25\n```\n- Train a model (without initialization):\nfirst copy models of auxiliary networks into `checkpoints\u002Fauxiliary`.\n```bash\npython train.py --dataroot dataset\u002Fdata --name formal_noinit --use_local --discriminator_local --niter 300 --niter_decay 0 --save_epoch_freq 25\n```\n- To view training results and loss plots, click the URL http:\u002F\u002Flocalhost:8097. To see more intermediate results, check out  `.\u002Fcheckpoints\u002Fformal\u002Fweb\u002Findex.html`\n\n### Test\n- Test the model on test set:\n```bash\npython test.py --dataroot dataset\u002Fdata --name formal --use_local --which_epoch 250\n```\nThe test results will be saved to a html file here: `.\u002Fresults\u002Fformal\u002Ftest_250\u002Findex.html`.\n- Test the model on images without paired ground truth (please use `--model test`, `--dataset_mode single` and `--norm batch`):\n```\npython test.py --dataroot dataset\u002Fdata\u002Ftest_single --name formal --model test --dataset_mode single --norm batch --use_local --which_epoch 250\n```\n\nYou can find these scripts at `scripts` directory.\n\n\n## [Preprocessing Steps](preprocess\u002Freadme.md)\nPreprocessing steps for your own data (either for testing or training).\n\n\n## [Training\u002FTest Tips](docs\u002Ftips.md)\nBest practice for training and testing your models.\n\nYou can contact email ranyi@sjtu.edu.cn for any questions.\n\n## Acknowledgments\nOur code is inspired by [pytorch-CycleGAN-and-pix2pix](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix).\n","# APDrawingGAN\n\n我们提供了针对CVPR 2019论文“APDrawingGAN：基于分层GAN从人脸照片生成艺术肖像画”的PyTorch实现。\n\n该项目使用基于GAN的模型，从人脸照片生成艺术肖像画。您可以在[预处理步骤](preprocess\u002Freadme.md)和[训练\u002F测试技巧](docs\u002Ftips.md)中找到有用的信息。\n\n[[论文]](http:\u002F\u002Fopenaccess.thecvf.com\u002Fcontent_CVPR_2019\u002Fhtml\u002FYi_APDrawingGAN_Generating_Artistic_Portrait_Drawings_From_Face_Photos_With_Hierarchical_CVPR_2019_paper.html) [[演示]](https:\u002F\u002Fapdrawing.github.io\u002F)\n\n[[Jittor实现]](https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN-Jittor)\n\n\n## 我们提出的框架\n \n\u003Cimg src = 'imgs\u002Farchitecture.png'>\n\n## 示例结果\n上：输入，下：输出\n\u003Cp>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_fb5814e88faf.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_1ed3eb6764fb.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_92750934a2af.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_e10e0ccab5c2.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_5e3cc3d4f2f8.png' width=\"19%\"\u002F>\n\u003C\u002Fp>\n\u003Cp>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_77033802d89d.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_d40557641760.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_f9c93b3da669.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_2f0dee9bf430.png' width=\"19%\"\u002F>\n    \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_readme_5a0fa70d4163.png' width=\"19%\"\u002F>\n\u003C\u002Fp>\n\n## 引用\n如果您在研究中使用此代码，请引用我们的论文。\n```\n@inproceedings{YiLLR19,\n  title     = {{APDrawingGAN}: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs},\n  author    = {Yi, Ran and Liu, Yong-Jin and Lai, Yu-Kun and Rosin, Paul L},\n  booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition (CVPR '19)},\n  pages     = {10743--10752},\n  year      = {2019}\n}\n```\n\n## 先决条件\n- Linux或macOS\n- Python 2.7\n- CPU或NVIDIA GPU + CUDA CuDNN\n\n\n## 快速入门\n### 安装\n- 从http:\u002F\u002Fpytorch.org安装PyTorch 0.4+和torchvision，以及其他依赖项（例如[visdom](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fvisdom)和[dominate](https:\u002F\u002Fgithub.com\u002FKnio\u002Fdominate)）。您可以使用以下命令安装所有依赖项：\n```bash\npip install -r requirements.txt\n```\n\n### 快速开始（应用预训练模型）\n\n- 从https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingGAN-Models1.zip下载一个预训练模型（使用训练集中的70对数据及增强数据），并将其放入`checkpoints\u002Fformal_author`目录。\n- 然后使用以下命令为`dataset\u002Fdata\u002Ftest_single`中的示例照片生成艺术肖像画：\n``` bash\npython test.py --dataroot dataset\u002Fdata\u002Ftest_single --name formal_author --model test --dataset_mode single --norm batch --use_local --which_epoch 300\n```\n测试结果将保存到此处的html文件中：`.\u002Fresults\u002Fformal_author\u002Ftest_300\u002Findex.html`。\n- 如果您想对自己的数据进行测试，请先按照[预处理步骤](preprocess\u002Freadme.md)中的教程对齐图片，并准备好面部地标和背景掩码，然后运行：\n``` bash\npython test.py --dataroot {path_to_aligned_photos} --name formal_author --model test --dataset_mode single --norm batch --use_local --which_epoch 300\n```\n- 我们还在https:\u002F\u002Fface.lol上提供了一个在线演示（优化版，使用120对数据进行训练），如果您想测试更多照片，这个演示会更容易使用。\n\n### 训练\n- 下载我们的[APDrawing数据集](https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingDB.zip)，并将内容复制到`dataset`文件夹。\n- 从https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingGAN-Models2.zip下载预训练模型和辅助网络模型（用于快速距离变换和线条检测）。\n- 运行`python -m visdom.server`。\n- 训练一个模型（以预训练作为初始化）：\n首先将“预训练”模型复制到当前实验的检查点目录（`checkpoints\u002F[name]`，例如`checkpoints\u002Fformal`），并将“辅助”模型复制到`checkpoints\u002Fauxiliary`。\n```bash\npython train.py --dataroot dataset\u002Fdata --name formal --continue_train --use_local --discriminator_local --niter 300 --niter_decay 0 --save_epoch_freq 25\n```\n- 训练一个模型（不使用初始化）：\n首先将辅助网络的模型复制到`checkpoints\u002Fauxiliary`。\n```bash\npython train.py --dataroot dataset\u002Fdata --name formal_noinit --use_local --discriminator_local --niter 300 --niter_decay 0 --save_epoch_freq 25\n```\n- 要查看训练结果和损失曲线，请访问URL http:\u002F\u002Flocalhost:8097。要查看更多中间结果，请查看`.\u002Fcheckpoints\u002Fformal\u002Fweb\u002Findex.html`。\n\n### 测试\n- 在测试集上测试模型：\n```bash\npython test.py --dataroot dataset\u002Fdata --name formal --use_local --which_epoch 250\n```\n测试结果将保存到此处的html文件中：`.\u002Fresults\u002Fformal\u002Ftest_250\u002Findex.html`。\n- 在没有配对真实标签的图像上测试模型（请使用`--model test`、`--dataset_mode single`和`--norm batch`）：\n```bash\npython test.py --dataroot dataset\u002Fdata\u002Ftest_single --name formal --model test --dataset_mode single --norm batch --use_local --which_epoch 250\n```\n\n这些脚本可以在`scripts`目录中找到。\n\n\n## [预处理步骤](preprocess\u002Freadme.md)\n针对您自己的数据（无论是用于测试还是训练）的预处理步骤。\n\n\n## [训练\u002F测试技巧](docs\u002Ftips.md)\n训练和测试您的模型的最佳实践。\n\n如有任何问题，您可以通过电子邮件ranyi@sjtu.edu.cn与我们联系。\n\n## 致谢\n我们的代码受到[pytorch-CycleGAN-and-pix2pix](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix)的启发。","# APDrawingGAN 快速上手指南\n\nAPDrawingGAN 是一个基于层次化 GAN 的 PyTorch 项目，能够将人脸照片自动转换为艺术风格的肖像画。本指南将帮助你快速配置环境并运行预训练模型。\n\n## 环境准备\n\n在开始之前，请确保你的系统满足以下要求：\n\n*   **操作系统**: Linux 或 macOS\n*   **Python 版本**: Python 2.7 (注意：原项目基于较旧的 Python 版本，若遇兼容性问题建议创建虚拟环境)\n*   **硬件加速**: CPU 或 NVIDIA GPU (需安装 CUDA 和 CuDNN)\n*   **核心依赖**: PyTorch 0.4+ 及 torchvision\n\n## 安装步骤\n\n1.  **克隆项目代码**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN.git\n    cd APDrawingGAN\n    ```\n\n2.  **安装依赖包**\n    推荐使用国内镜像源（如清华源）以加快下载速度：\n    ```bash\n    pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n    *注：如果 `requirements.txt` 中未包含 PyTorch，请前往 [PyTorch 官网](http:\u002F\u002Fpytorch.org) 根据你的 CUDA 版本单独安装 PyTorch 0.4+ 和 torchvision。*\n\n## 基本使用（运行预训练模型）\n\n这是最简单的使用方式，无需训练即可将示例图片转换为艺术肖像画。\n\n### 1. 下载预训练模型\n从清华大学服务器下载预训练模型（Model1），并将其解压放置到指定目录：\n\n```bash\n# 下载模型 (约 70 对训练数据及增强数据)\nwget https:\u002F\u002Fcg.cs.tsinghua.edu.cn\u002Fpeople\u002F~Yongjin\u002FAPDrawingGAN-Models1.zip\n\n# 解压并移动文件\nunzip APDrawingGAN-Models1.zip\nmkdir -p checkpoints\u002Fformal_author\nmv APDrawingGAN-Models1\u002F* checkpoints\u002Fformal_author\u002F\n```\n\n### 2. 生成艺术肖像\n使用项目自带的测试图片进行推理：\n\n```bash\npython test.py --dataroot dataset\u002Fdata\u002Ftest_single --name formal_author --model test --dataset_mode single --norm batch --use_local --which_epoch 300\n```\n\n### 3. 查看结果\n生成完成后，结果将保存为 HTML 文件，你可以直接在浏览器中打开查看对比效果：\n*   结果路径：`.\u002Fresults\u002Fformal_author\u002Ftest_300\u002Findex.html`\n\n---\n\n**提示**：如果你希望测试自己的照片，请先参考项目中的 [预处理步骤](preprocess\u002Freadme.md) 对图片进行人脸对齐、提取关键点及生成背景掩码，然后修改 `--dataroot` 参数指向你的数据目录再次运行上述 `test.py` 命令。","一家小型数字文创工作室正急需为社交媒体活动批量制作具有手绘风格的名人肖像海报，但团队中缺乏专业插画师。\n\n### 没有 APDrawingGAN 时\n- **人力成本高昂**：每张肖像都需聘请画师手工绘制或进行繁琐的后期描摹，单张耗时数小时，难以应对批量需求。\n- **风格难以统一**：不同画师或同一画师在不同状态下的笔触、线条粗细及阴影处理存在差异，导致系列海报视觉风格割裂。\n- **细节还原度低**：人工转换容易丢失人物面部关键特征（如眼神光、特定皱纹），导致成品“形似神不似”，缺乏艺术感染力。\n- **修改迭代缓慢**：若客户对线条风格或局部细节提出调整，重新绘制整个画面的时间成本极高，严重拖慢项目进度。\n\n### 使用 APDrawingGAN 后\n- **生产效率飞跃**：利用预训练模型，只需输入对齐后的人脸照片，APDrawingGAN 即可在秒级时间内自动生成高质量艺术素描，实现批量产出。\n- **风格高度一致**：基于分层 GAN 架构，工具能稳定输出统一的线条质感与阴影层次，确保整套海报呈现出连贯的专业艺术风格。\n- **特征精准保留**：模型自动提取并强化人脸关键 landmarks，生成的画作既保留了人物的辨识度，又赋予了自然流畅的手绘笔触。\n- **灵活快速迭代**：通过调整输入参数或更换基础模型，团队可迅速生成多种风格变体供客户选择，大幅缩短决策与交付周期。\n\nAPDrawingGAN 将原本依赖昂贵人力的艺术创作过程转化为高效的自动化流程，让小型团队也能低成本产出电影级的艺术肖像作品。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyiranran_APDrawingGAN_0a947857.png","yiranran","Ran Yi","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fyiranran_89d3dc31.png","Associate Professor at School of Computer Science, SJTU","Shanghai Jiao Tong University","Shanghai","ranyi@sjtu.edu.cn",null,"https:\u002F\u002Fyiranran.github.io\u002F","https:\u002F\u002Fgithub.com\u002Fyiranran",[25,29,33],{"name":26,"color":27,"percentage":28},"Python","#3572A5",98,{"name":30,"color":31,"percentage":32},"MATLAB","#e16737",1.5,{"name":34,"color":35,"percentage":36},"Shell","#89e051",0.5,810,154,"2026-04-02T11:45:22","Apache-2.0",4,"Linux, macOS","可选（支持 CPU 或 NVIDIA GPU + CUDA CuDNN），具体显存大小和 CUDA 版本未说明","未说明",{"notes":46,"python":47,"dependencies":48},"代码基于 PyTorch 0.4+ 开发，较新版本可能需要调整兼容性；训练前需下载预训练模型和辅助网络模型；测试自定义数据前需按照文档进行人脸对齐、 landmarks 提取和背景掩码制作等预处理步骤。","2.7",[49,50,51,52],"PyTorch>=0.4","torchvision","visdom","dominate",[54,55],"图像","开发框架",[57,58,59,60,61,62,63,64,65],"pytorch","gan","apdrawinggan","computer-vision","computer-graphics","image-generation","image-synthesis","deep-learning","face",2,"ready","2026-03-27T02:49:30.150509","2026-04-11T08:11:51.614725",[71,76,81,86,91,96],{"id":72,"question_zh":73,"answer_zh":74,"source_url":75},29189,"为什么运行代码时出现 'only integer tensors of a single element can be converted to an index' 错误？","该错误通常由 PyTorch 版本差异或 Python 版本（原代码基于 Python 2）引起。解决方案包括：\n1. 确保使用最新版本的代码，作者已提交修复补丁（commit: bc10583）。\n2. 如果是数据类型问题，尝试将 data\u002Fsingle_dataset.py 第 83 行的 `center = torch.tensor(...)` 修改为 `center = torch.IntTensor(...)`。\n3. 检查是否混用了 numpy.int64 和 torch tensor，需统一数据类型。","https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN\u002Fissues\u002F10",{"id":77,"question_zh":78,"answer_zh":79,"source_url":80},29190,"运行程序时遇到 'Could not infer dtype of numpy.int64' 报错如何解决？","这是由于 PyTorch 版本不兼容导致的（作者使用的是 PyTorch 0.4.1）。解决方法是将 data\u002Fsingle_dataset.py 文件中第 83 行代码从 `center = torch.tensor(...)` 改为 `center = torch.IntTensor(...)`，以强制指定整数类型。","https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN\u002Fissues\u002F1",{"id":82,"question_zh":83,"answer_zh":84,"source_url":85},29191,"该项目可以在 Windows 系统上运行吗？","可以。经用户测试，在 Windows 10 + Python 3.6 + PyTorch 1.1 环境下可以正常运行。如果在运行过程中遇到索引类型错误（TypeError），请参考项目中关于 PyTorch 版本兼容性的修复方案（见 Issue #10 和 #1）。","https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN\u002Fissues\u002F5",{"id":87,"question_zh":88,"answer_zh":89,"source_url":90},29192,"在线演示网站 (face.lol) 无法访问或显示忙碌怎么办？","原演示网站地址已变更。请使用新的官方演示页面：https:\u002F\u002Fapdrawing.github.io\u002F。新版本支持多种风格生成。如果新页面仍显示忙碌，可能是服务器负载较高，请稍后重试。","https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN\u002Fissues\u002F9",{"id":92,"question_zh":93,"answer_zh":94,"source_url":95},29193,"为什么下载的预训练模型效果不如在线 Demo 好？","因为在线 Demo 使用了 120 对图像进行训练，而 GitHub 上提供的预训练模型仅使用了 70 对图像训练，因此效果存在差异。目前作者未直接提供与 Demo 完全一致的模型文件，建议有条件的话自行使用更多数据微调模型。","https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN\u002Fissues\u002F12",{"id":97,"question_zh":98,"answer_zh":99,"source_url":100},29194,"训练或测试时出现数据类型相关的 TypeError 该如何排查？","这类错误多源于原始代码是为 Python 2 编写的，而在 Python 3 和高版本 PyTorch 中张量索引要求更严格。请检查 data\u002Faligned_dataset.py 或 data\u002Fsingle_dataset.py 中涉及数组切片索引的地方，确保索引变量是单元素整数张量（integer tensor of a single element）。应用作者最新的 commit (bc10583a244620325c6e4874566112ebbf5d2c7d) 通常可解决此问题。","https:\u002F\u002Fgithub.com\u002Fyiranran\u002FAPDrawingGAN\u002Fissues\u002F19",[],[103,114,122,131,139,148],{"id":104,"name":105,"github_repo":106,"description_zh":107,"stars":108,"difficulty_score":109,"last_commit_at":110,"category_tags":111,"status":67},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",[112,55,54,113],"Agent","数据工具",{"id":115,"name":116,"github_repo":117,"description_zh":118,"stars":119,"difficulty_score":109,"last_commit_at":120,"category_tags":121,"status":67},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",[55,54,112],{"id":123,"name":124,"github_repo":125,"description_zh":126,"stars":127,"difficulty_score":66,"last_commit_at":128,"category_tags":129,"status":67},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 真正成长为懂上",150037,"2026-04-10T23:33:47",[55,112,130],"语言模型",{"id":132,"name":133,"github_repo":134,"description_zh":135,"stars":136,"difficulty_score":66,"last_commit_at":137,"category_tags":138,"status":67},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",[55,54,112],{"id":140,"name":141,"github_repo":142,"description_zh":143,"stars":144,"difficulty_score":66,"last_commit_at":145,"category_tags":146,"status":67},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",[147,112,54,55],"插件",{"id":149,"name":150,"github_repo":151,"description_zh":152,"stars":153,"difficulty_score":66,"last_commit_at":154,"category_tags":155,"status":67},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",[147,55]]