{"id":13468048,"url":"https://github.com/youyuge34/Anime-InPainting","last_synced_at":"2025-03-26T03:31:30.428Z","repository":{"id":41390164,"uuid":"164412075","full_name":"youyuge34/Anime-InPainting","owner":"youyuge34","description":"An application tool of edge-connect, which can do anime inpainting and drawing.   动漫人物图片自动修复，去马赛克，填补，去瑕疵","archived":false,"fork":false,"pushed_at":"2019-03-27T15:07:00.000Z","size":5899,"stargazers_count":1093,"open_issues_count":16,"forks_count":153,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-21T05:04:15.227Z","etag":null,"topics":["anime","computer-vision","cv","deep-learning","gan","generative-adversarial-network","inpainting","mosaic","neural-network","opencv","python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youyuge34.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-07T09:53:36.000Z","updated_at":"2025-03-18T12:17:28.000Z","dependencies_parsed_at":"2022-07-19T02:32:10.516Z","dependency_job_id":null,"html_url":"https://github.com/youyuge34/Anime-InPainting","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyuge34%2FAnime-InPainting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyuge34%2FAnime-InPainting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyuge34%2FAnime-InPainting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyuge34%2FAnime-InPainting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youyuge34","download_url":"https://codeload.github.com/youyuge34/Anime-InPainting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245584893,"owners_count":20639640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anime","computer-vision","cv","deep-learning","gan","generative-adversarial-network","inpainting","mosaic","neural-network","opencv","python","pytorch"],"created_at":"2024-07-31T15:01:04.713Z","updated_at":"2025-03-26T03:31:28.759Z","avatar_url":"https://github.com/youyuge34.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Anime-InPainting: An application Tool based on [Edge-Connect](https://github.com/knazeri/edge-connect)\n------------------------------------------------------------------------------------------------------\n\u003cp align=\"left\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/version-0.2-brightgreen.svg?style=flat-square\"\n\t\t\t alt=\"Version\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/status-Release-gold.svg?style=flat-square\"\n\t\t\t alt=\"Status\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/platform-win | linux-lightgrey.svg?style=flat-square\"\n\t\t\t alt=\"Platform\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/PyTorch version-1.0-blue.svg?style=flat-square\"\n\t\t\t alt=\"PyTorch\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/License-CC BY·NC 4.0-green.svg?style=flat-square\"\n\t\t\t alt=\"License\"\u003e\n\u003c/p\u003e\n\nEnglish | [中文版介绍](#jump_zh)\n\n\u003chr\u003e\n\n### Important\n**2019.3.27 Update:**     \nOur **latest** drawing method [PI-REC](https://github.com/youyuge34/PI-REC) is more powerful.      \n Take a look on it, and I'm sure it won't disappoint you.\n\u003chr\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"files/banner.png\" width=\"720\" height=\"240\"\u003e\n\u003c/p\u003e\n\n## Tool show time 🏳️‍🌈\n#### Outputs\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"files/show1.jpg\" width=\"720\" height=\"400\"\u003e\n\u003c/p\u003e\n\n#### Tool operation\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"files/cut2.gif\" width=\"425\" height=\"425\"\u003e\n\u003cimg src=\"files/cut3.gif\" width=\"406\" height=\"222\"\u003e\n\u003c/p\u003e\n\nIntroduction:\n-----\nThis is an optimized application tool which has a frontend based on `Opencv`, whose backend used [Edge-Connect](https://github.com/knazeri/edge-connect).\nMake sure you have read their awesome work and license thoroughly.\nCompared with the original work, this project has such \u003cspan id=\"improve\"\u003eimprovements\u003c/span\u003e :\n- Add tool application modes\n- Optimize the training phase\n  - Auto-save and auto-load latest weights files\n  - Add a fast training phase combined with origin phase 2 and 3\n- bugs fixed (most of them are merged into the original work)\n- Add utility files\n- Add configs in `config.yml`\n  - PRINT_FREQUENCY\n  - DEVICE : cpu or gpu\n- ... ...\n\n**You can do the amazing Anime inpainting conveniently here.**\n\n**And detailed [training manual](training_manual.md) is released. You may train your own dataset smoothly now.**\n\n## \u003cspan id='pre'\u003ePrerequisites\u003c/span\u003e\n- Python 3\n- PyTorch `1.0` (`0.4` is not supported)\n- NVIDIA GPU + CUDA cuDNN\n\n## \u003cspan id='ins'\u003eInstallation\u003c/span\u003e\n- Clone this repo\n- Install PyTorch and dependencies from http://pytorch.org\n- Install python requirements:\n```bash\npip install -r requirements.txt\n```\n\n## Run the Tool\nI want to run the tool! Calm down and follow such step:\n\n\n**Info: The following weights files are trained on anime face dataset which performs not good on a large whole anime character.**\n1. Download the well trained model weights file --\u003e [Google Drive](https://drive.google.com/file/d/12I-K7GQEXEL_rEOVJnRv7ecVHyuZE-1-/view?usp=sharing) | [Baidu](https://pan.baidu.com/s/1WkeRtYViGGGw4fUqPo3nsg)\n2. Unzip the `.7z` and put it under your root directory.\nSo make sure your path now is: `./model/getchu/\u003cxxxxx.pth\u003e`\n3. Complete the above [Prerequisites](#pre) and [Installation](#ins)\n4. (Optional) Check and edit the `./model/getchu/config.yml` config file as you wish\n5. Run the cooool tool:\n\n#### Default Tool:\n\n```bash\npython tool_patch.py --path model/getchu/\n```\n\n#### Tool with edge window:\n\n```bash\npython tool_patch.py --edge --path model/getchu/\n```\n\n#### Args help\n```bash\npython tool_patch.py -h\n```\n\n\u003e PS. You can run any well trained model, not only above one. You can download more model weights files\nfrom the original work [Edge-Connect](https://github.com/knazeri/edge-connect). Then you can run the Tool as above.\nOnly one thing to be careful: The `config.yml` in this project has some additional options than the config from the [Edge-Connect](https://github.com/knazeri/edge-connect).\n\n\n## Tool operation\nFor detailed manual, refer to your `terminal` prints or the `__doc__` in `tool_patch.py`.\n\nBelow is the simplified tool operation manual:\n\n\n\nKey | description\n-----|-----\nMouse `Left` | To draw out the defective area in window `input` and to draw the edge in window `edge`\nMouse `Right` | To erase edge in window `edge`\nKey `[` | To make the brush thickness smaller\nKey `]` | To make the brush thickness larger\nKey `0` | Todo\nKey `1` | Todo\nKey `n` | To patch the black part of image, just use input image\nKey `e` | To patch the black part of image, use the input image and edit edge (only work under edge window opened)\nKey `r` | To reset the setup\nKey `s` | To save the output\nKey `q` | To quit\n\n## Training manual\nClick here --\u003e [Training manual by yourself](training_manual.md)\n\n\n\n\u003cspan id=\"jump_zh\"\u003e中文版介绍🇨🇳 \u003c/span\u003e\n-----\n\n\u003chr\u003e\n\n### 重要\n**2019.3.27 更新:**     \n我们的最新模型 [PI-REC](https://github.com/youyuge34/PI-REC) 更强大.            \n如果你想用最新的AI绘画黑科技，而非仅仅是修补图像，请点击上面的链接👆\n\u003chr\u003e\n\n\n## 简介\nTool效果看上面👆 | Bilibili视频教程：TO DO\n\n这是图像修补方向最新研究成果[Edge-Connect](https://github.com/knazeri/edge-connect)的~~阿姆斯特朗氮气加速魔改~~（优化）版。\n用`Opencv`写了个前端部分，后端是[Edge-Connect](https://github.com/knazeri/edge-connect)，方便当作工具使用。\n此工具可以用来自动图像修补，去马赛克……同样优化了模型训练的过程。具体优化内容请看[英文版Improvements](#improve)。\n\n更新：[训练手册](training_manual.md#jump_zh)已经填坑完发布了！你可以照着指南训练自己数据集了~\n\n## 基础环境\n- Python 3\n- PyTorch `1.0` (`0.4` 会报错)\n- NVIDIA GPU + CUDA cuDNN （当前版本已可选cpu，请修改`config.yml`中的`DEVICE`）\n\n## 第三方库安装\n- Clone this repo\n- 安装PyTorch和torchvision --\u003e http://pytorch.org\n- 安装 python requirements:\n```bash\npip install -r requirements.txt\n```\n\n## 运行Tool\n教练！我有个大胆的想法🈲……别急，一步步来：\n\n\n**注意：以下模型是在动漫头像数据集上训练的，所以对动漫全身大图修补效果一般，想自己再训练的参考下面的训练指南**\n1. 下训练好的模型文件 --\u003e [Google Drive](https://drive.google.com/file/d/12I-K7GQEXEL_rEOVJnRv7ecVHyuZE-1-/view?usp=sharing) | [Baidu](https://pan.baidu.com/s/1WkeRtYViGGGw4fUqPo3nsg)\n2. 解压 `.7z` 放到你的根目录下.\n确保你的目录现在是这样: `./model/getchu/\u003cxxxxx.pth\u003e`\n3. 完成上面的基础环境和第三方库安装步骤\n4. (可选) 检查并编辑 `./model/getchu/config.yml` 配置文件\n5. 使用以下命令运行：\n\n#### 默认Tool:\n\n```bash\npython tool_patch.py --path model/getchu/\n```\n\n#### 带Edge编辑窗口的Tool:\n\n```bash\npython tool_patch.py --edge --path model/getchu/\n```\n\n#### 命令行参数帮助\n```bash\npython tool_patch.py -h\n```\n\n\u003e PS. 你也能用tool跑别的任何模型，在这里下载原作更多模型[Edge-Connect](https://github.com/knazeri/edge-connect).\n文件组织方式参考上面，其余运行命令都一样。唯一注意的是这个项目的 `config.yml` 比原作的多了几个选项，报错了的话注意修改。\n\n## Tool操作指南\n详细内容请翻看控制台的打印内容，或查看`tool_patch.py`里的`__doc__`      \n简略版tool使用指南：\n\n按键 | 说明\n-----|------\n鼠标左键 | Input窗口：画出瑕疵区域的遮盖，Edge窗口：手动画边缘\n鼠标右键 | Edge窗口：橡皮擦\n按键 `[` | 笔刷变细 （控制台打印粗细大小）\n按键 `]` | 笔刷变粗\n按键 `0` | Todo\n按键 `1` | Todo\n按键 `n` | 修补黑色涂抹区域，只使用一张输入图片\n按键 `e` | 修补黑色涂抹区域，使用输入图片和边缘图片（仅当edge窗口启动时有效）\n按键 `r` | 全部重置\n按键 `s` | 保存输出图片\n按键 `q` | 退出\n\n\n## 训练指南\n训练指南 --\u003e [阅读](training_manual.md#jump_zh)\n\n\n## License\nLicensed under a [Creative Commons Attribution-NonCommercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/).\n\nExcept where otherwise noted, this content is published under a [CC BY-NC](https://creativecommons.org/licenses/by-nc/4.0/) license, which means that you can copy, remix, transform and build upon the content as long as you do not use the material for commercial purposes and give appropriate credit and provide a link to the license.\n\n\n## Citation\nIf you use this code for your research, please cite our paper \u003ca href=\"https://arxiv.org/abs/1901.00212\"\u003eEdgeConnect: Generative Image Inpainting with Adversarial Edge Learning\u003c/a\u003e:\n\n```\n@inproceedings{nazeri2019edgeconnect,\n  title={EdgeConnect: Generative Image Inpainting with Adversarial Edge Learning},\n  author={Nazeri, Kamyar and Ng, Eric and Joseph, Tony and Qureshi, Faisal and Ebrahimi, Mehran},\n  journal={arXiv preprint},\n  year={2019},\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyuge34%2FAnime-InPainting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouyuge34%2FAnime-InPainting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyuge34%2FAnime-InPainting/lists"}