[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-anishathalye--neural-style":3,"tool-anishathalye--neural-style":62},[4,18,26,35,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},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,2,"2026-04-10T11:39:34",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":32,"last_commit_at":41,"category_tags":42,"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",[43,13,15,14],"插件",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[52,15,13,14],"语言模型",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,61],"视频",{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":78,"owner_email":79,"owner_twitter":73,"owner_website":80,"owner_url":81,"languages":82,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":32,"env_os":91,"env_gpu":92,"env_ram":91,"env_deps":93,"category_tags":99,"github_topics":100,"view_count":32,"oss_zip_url":100,"oss_zip_packed_at":100,"status":17,"created_at":101,"updated_at":102,"faqs":103,"releases":134},7509,"anishathalye\u002Fneural-style","neural-style","Neural style in TensorFlow! 🎨","neural-style 是一个基于 TensorFlow 实现的神经风格迁移开源项目，它能将著名画作的艺术风格（如梵高的《星夜》）自动融合到普通照片中，生成兼具内容结构与艺术笔触的独特图像。该工具主要解决了传统图像处理难以模拟复杂艺术风格的问题，让非专业用户也能轻松创作出高质量的艺术合成图。\n\n相比其他实现，neural-style 充分利用了 TensorFlow 简洁的 API 和自动微分特性，代码结构更加清晰易懂。虽然因框架限制使用 Adam 优化器替代了原论文中的 L-BFGS，可能需要微调学习率等参数以获得最佳效果，但它提供了丰富的调节选项：支持多风格混合、通过调整层权重控制风格的抽象程度，以及选择池化方式来平衡细节保留与整体质感。\n\n这款工具非常适合开发者学习深度学习图像生成原理，也适合设计师快速探索视觉创意，甚至普通摄影爱好者只需简单命令即可玩转艺术创作。无论是想复现经典算法的研究人员，还是希望为照片增添艺术气息的用户，neural-style 都提供了一个高效且灵活的解决方案。","# neural-style [![Build Status](https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Factions\u002Fworkflows\u002Fci.yml)\n\nAn implementation of [neural style][paper] in TensorFlow.\n\nThis implementation is a lot simpler than a lot of the other ones out there,\nthanks to TensorFlow's really nice API and [automatic differentiation][ad].\n\nTensorFlow doesn't support [L-BFGS][l-bfgs] (which is what the original authors\nused), so we use [Adam][adam]. This may require a little bit more\nhyperparameter tuning to get nice results.\n\n## Running\n\nThis project uses the [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) project and package manager; you can install it by [following these instructions](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F) (e.g., installing it with your system package manager, like `brew install uv`).\n\nYou also need to download [required data files](#requirements).\n\nAfter that, you can run this program with:\n\n```bash\nuv run neural_style.py --content \u003Ccontent file> --styles \u003Cstyle file> --output \u003Coutput file>\n```\n\nRun `uv run neural_style.py --help` to see a list of all options.\n\nUse `--checkpoint-output` and `--checkpoint-iterations` to save checkpoint images.\n\nUse `--iterations` to change the number of iterations (default 1000). For a 512×512 pixel content file, 1000 iterations take 90 seconds on an M3 MacBook Pro, and significantly less time with a more powerful (e.g., NVIDIA) GPU.\n\n## Example 1\n\nRunning it for 500-2000 iterations seems to produce nice results. With certain\nimages or output sizes, you might need some hyperparameter tuning (especially\n`--content-weight`, `--style-weight`, and `--learning-rate`).\n\nThe following example was run for 1000 iterations to produce the result (with\ndefault parameters):\n\n![output](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_37590c1a743a.jpg)\n\nThese were the input images used (me sleeping at a hackathon and Starry Night):\n\n![input-content](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_e20216b642bc.jpg)\n\n![input-style](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_a9d7b535ce16.jpg)\n\n## Example 2\n\nThe following example demonstrates style blending, and was run for 1000\niterations to produce the result (with style blend weight parameters 0.8 and\n0.2):\n\n![output](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_6ead55355493.jpg)\n\nThe content input image was a picture of the Stata Center at MIT:\n\n![input-content](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_2bad7453351f.jpg)\n\nThe style input images were Picasso's \"Dora Maar\" and Starry Night, with the\nPicasso image having a style blend weight of 0.8 and Starry Night having a\nstyle blend weight of 0.2:\n\n![input-style](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_e4bc4cf70d45.jpg)\n![input-style](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_5cfe2ab96809.jpg)\n\n## Tweaking\n\n`--style-layer-weight-exp` command line argument could be used to tweak how \"abstract\"\nthe style transfer should be. Lower values mean that style transfer of a finer features\nwill be favored over style transfer of a more coarse features, and vice versa. Default\nvalue is 1.0 - all layers treated equally. Somewhat extreme examples of what you can achieve:\n\n![--style-layer-weight-exp 0.2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_682142f29c49.jpg)\n![--style-layer-weight-exp 2.0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_51ec9290c9dd.jpg)\n\n(**left**: 0.2 - finer features style transfer; **right**: 2.0 - coarser features style transfer)\n\n`--content-weight-blend` specifies the coefficient of content transfer layers. Default value -\n1.0, style transfer tries to preserve finer grain content details. The value should be\nin range [0.0; 1.0].\n\n![--content-weight-blend 1.0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_ff39c3f0a48d.jpg)\n![--content-weight-blend 0.1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_8baf50790504.jpg)\n\n(**left**: 1.0 - default value; **right**: 0.1 - more abstract picture)\n\n`--pooling` allows to select which pooling layers to use (specify either `max` or `avg`).\nOriginal VGG topology uses max pooling, but the [style transfer paper][paper] suggests\nreplacing it with average pooling. The outputs are perceptually different, max pool in\ngeneral tends to have finer detail style transfer, but could have troubles at\nlower-freqency detail level:\n\n![--pooling max](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_fa0d01afeb09.jpg)\n![--pooling avg](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_5f7e668525c2.jpg)\n\n(**left**: max pooling; **right**: average pooling)\n\n`--preserve-colors` boolean command line argument adds post-processing step, which\ncombines colors from the original image and luma from the stylized image (YCbCr color\nspace), thus producing color-preserving style transfer:\n\n![--pooling max](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_fa0d01afeb09.jpg)\n![--pooling max](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_7e2da3fb6908.jpg)\n\n(**left**: original stylized image; **right**: color-preserving style transfer)\n\n## Requirements\n\n### Data Files\n\n* [Pre-trained VGG network][net] (SHA256 `abdb57167f82a2a1fbab1e1c16ad9373411883f262a1a37ee5db2e6fb0044695`) - put it in the top level of this repository, or specify its location using the `--network` option.\n\n## Related Projects\n\nSee [here][lengstrom-fast-style-transfer] for an implementation of [fast\n(feed-forward) neural style][fast-neural-style] in TensorFlow.\n\n**[Try neural style](https:\u002F\u002Ftenso.rs\u002Fdemos\u002Ffast-neural-style\u002F) client-side in\nyour web browser without installing any software (using\n[TensorFire](https:\u002F\u002Ftenso.rs\u002F)).**\n\n## Citation\n\n```bibtex\n@misc{athalye2015neuralstyle,\n  author = {Anish Athalye},\n  title = {Neural Style},\n  year = {2015},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style}},\n}\n```\n\n## License\n\nCopyright (c) Anish Athalye. Released under GPLv3. See\n[LICENSE.txt][license] for details.\n\n[net]: https:\u002F\u002Fwww.vlfeat.org\u002Fmatconvnet\u002Fmodels\u002Fimagenet-vgg-verydeep-19.mat\n[paper]: http:\u002F\u002Farxiv.org\u002Fpdf\u002F1508.06576v2.pdf\n[l-bfgs]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLimited-memory_BFGS\n[adam]: http:\u002F\u002Farxiv.org\u002Fabs\u002F1412.6980\n[ad]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAutomatic_differentiation\n[lengstrom-fast-style-transfer]: https:\u002F\u002Fgithub.com\u002Flengstrom\u002Ffast-style-transfer\n[fast-neural-style]: https:\u002F\u002Farxiv.org\u002Fpdf\u002F1603.08155v1.pdf\n[license]: LICENSE.txt\n","# neural-style [![构建状态](https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Factions\u002Fworkflows\u002Fci.yml)\n\n一个基于 TensorFlow 的 [神经风格迁移][paper]实现。\n\n得益于 TensorFlow 非常友好的 API 和 [自动微分][ad]，这个实现比市面上许多其他实现要简单得多。\n\nTensorFlow 不支持 [L-BFGS][l-bfgs]（这是原作者所使用的方法），因此我们使用了 [Adam][adam]。这可能需要进行一些超参数调优才能获得较好的效果。\n\n## 运行\n\n该项目使用 [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) 项目和包管理器；你可以按照[这些说明](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F)来安装它（例如，通过你的系统包管理器安装，如 `brew install uv`）。\n\n你还需要下载[所需的数据文件](#requirements)。\n\n之后，你可以通过以下命令运行该程序：\n\n```bash\nuv run neural_style.py --content \u003C内容文件 > --styles \u003C 风格文件 > --output \u003C 输出文件 >\n```\n\n运行 `uv run neural_style.py --help` 可以查看所有选项的列表。\n\n使用 `--checkpoint-output` 和 `--checkpoint-iterations` 来保存检查点图像。\n\n使用 `--iterations` 来更改迭代次数（默认为 1000 次）。对于一个 512×512 像素的内容文件，在 M3 MacBook Pro 上执行 1000 次迭代需要 90 秒；如果使用更强大的（例如 NVIDIA）GPU，则所需时间会显著减少。\n\n## 示例 1\n\n运行 500 到 2000 次迭代似乎可以产生不错的效果。对于某些特定的图像或输出尺寸，你可能需要对超参数进行一些调整（尤其是 `--content-weight`、`--style-weight` 和 `--learning-rate`）。\n\n下面的示例运行了 1000 次迭代以生成结果（使用默认参数）：\n\n![output](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_37590c1a743a.jpg)\n\n以下是使用的输入图像：我在黑客马拉松上睡觉的照片和《星夜》：\n\n![input-content](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_e20216b642bc.jpg)\n\n![input-style](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_a9d7b535ce16.jpg)\n\n## 示例 2\n\n下面的示例展示了风格混合的效果，运行了 1000 次迭代以生成结果（风格混合权重分别为 0.8 和 0.2）：\n\n![output](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_6ead55355493.jpg)\n\n内容输入图像是麻省理工学院斯塔塔中心的照片：\n\n![input-content](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_2bad7453351f.jpg)\n\n风格输入图像分别是毕加索的《朵拉·马尔》和《星夜》，其中毕加索的图像风格混合权重为 0.8，而《星夜》的权重为 0.2：\n\n![input-style](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_e4bc4cf70d45.jpg)\n![input-style](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_5cfe2ab96809.jpg)\n\n## 调整\n\n`--style-layer-weight-exp` 命令行参数可用于调整风格迁移的“抽象”程度。较低的值意味着风格迁移会更倾向于保留较精细的特征，而较高的值则更倾向于保留较粗糙的特征。默认值为 1.0，即所有层同等对待。以下是一些极端的例子：\n\n![--style-layer-weight-exp 0.2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_682142f29c49.jpg)\n![--style-layer-weight-exp 2.0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_51ec9290c9dd.jpg)\n\n（**左**：0.2——保留更精细的特征；**右**：2.0——保留更粗糙的特征）\n\n`--content-weight-blend` 指定内容传递层的系数。默认值为 1.0，此时风格迁移会尽量保留内容中的细粒度细节。该值应在 [0.0; 1.0] 范围内。\n\n![--content-weight-blend 1.0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_ff39c3f0a48d.jpg)\n![--content-weight-blend 0.1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_8baf50790504.jpg)\n\n（**左**：1.0——默认值；**右**：0.1——更加抽象的图像）\n\n`--pooling` 允许选择使用的池化层类型（可指定 `max` 或 `avg`）。原始 VGG 网络采用最大池化，但 [风格迁移论文][paper]建议将其替换为平均池化。两种方法产生的效果在感知上有所不同：最大池化通常能更好地保留细节，但在低频细节方面可能会遇到困难：\n\n![--pooling max](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_fa0d01afeb09.jpg)\n![--pooling avg](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_5f7e668525c2.jpg)\n\n（**左**：最大池化；**右**：平均池化）\n\n`--preserve-colors` 是一个布尔型命令行参数，它会在后处理步骤中将原始图像的颜色与风格化图像的亮度信息相结合（使用 YCbCr 颜色空间），从而实现色彩保留的风格迁移：\n\n![--pooling max](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_fa0d01afeb09.jpg)\n![--pooling max](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_readme_7e2da3fb6908.jpg)\n\n（**左**：原始风格化图像；**右**：色彩保留的风格迁移）\n\n## 需求\n\n### 数据文件\n\n* [预训练的 VGG 网络][net]（SHA256 `abdb57167f82a2a1fbab1e1c16ad9373411883f262a1a37ee5db2e6fb0044695`）——将其放置在本仓库的根目录下，或使用 `--network` 选项指定其位置。\n\n## 相关项目\n\n有关 [快速（前馈）神经风格迁移][fast-neural-style] 在 TensorFlow 中的实现，请参阅[这里][lengstrom-fast-style-transfer]。\n\n**[尝试神经风格迁移](https:\u002F\u002Ftenso.rs\u002Fdemos\u002Ffast-neural-style\u002F)——无需安装任何软件，即可在你的网页浏览器中进行客户端体验（使用 [TensorFire](https:\u002F\u002Ftenso.rs\u002F)）。**\n\n## 引用\n\n```bibtex\n@misc{athalye2015neuralstyle,\n  author = {Anish Athalye},\n  title = {Neural Style},\n  year = {2015},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style}},\n}\n```\n\n## 许可证\n\n版权所有 © Anish Athalye。根据 GPLv3 发布。详情请参阅 [LICENSE.txt][license]。\n\n[net]: https:\u002F\u002Fwww.vlfeat.org\u002Fmatconvnet\u002Fmodels\u002Fimagenet-vgg-verydeep-19.mat\n[paper]: http:\u002F\u002Farxiv.org\u002Fpdf\u002F1508.06576v2.pdf\n[l-bfgs]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLimited-memory_BFGS\n[adam]: http:\u002F\u002Farxiv.org\u002Fabs\u002F1412.6980\n[ad]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAutomatic_differentiation\n[lengstrom-fast-style-transfer]: https:\u002F\u002Fgithub.com\u002Flengstrom\u002Ffast-style-transfer\n[fast-neural-style]: https:\u002F\u002Farxiv.org\u002Fpdf\u002F1603.08155v1.pdf\n[license]: LICENSE.txt","# neural-style 快速上手指南\n\n`neural-style` 是一个基于 TensorFlow 实现的神经风格迁移工具，能够将一张图片的艺术风格应用到另一张内容图片上。本项目利用 TensorFlow 的自动微分特性，代码简洁易懂。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows (需配置相应环境)\n*   **Python 环境**：项目推荐使用 `uv` 作为项目和包管理器（自动处理 Python 版本和依赖）。\n*   **硬件加速**：虽然可以在 CPU 上运行，但强烈建议使用 NVIDIA GPU 以显著缩短生成时间（例如：512x512 图片在 M3 MacBook Pro 上约需 90 秒，而在高性能 GPU 上会快得多）。\n\n### 前置依赖安装\n\n首先安装 `uv` 工具。\n\n**macOS (使用 Homebrew):**\n```bash\nbrew install uv\n```\n\n**Linux\u002FmacOS (通用脚本):**\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n```\n\n**Windows (PowerShell):**\n```powershell\npowershell -c \"irm https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.ps1 | iex\"\n```\n\n> **提示**：国内用户若访问上述安装源较慢，可尝试配置国内镜像或使用 pip 安装 uv：`pip install uv -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n## 安装步骤\n\n本项目无需传统的 `pip install` 全局安装，`uv` 会在运行时自动创建隔离环境并安装依赖。\n\n1.  **克隆仓库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style.git\n    cd neural-style\n    ```\n\n2.  **下载预训练模型**\n    程序运行需要 VGG 预训练网络文件。\n    *   **下载地址**：[imagenet-vgg-verydeep-19.mat](https:\u002F\u002Fwww.vlfeat.org\u002Fmatconvnet\u002Fmodels\u002Fimagenet-vgg-verydeep-19.mat)\n    *   **操作**：将下载好的 `.mat` 文件放置在项目根目录下。\n    *   *(可选)* 如果放在其他位置，后续运行时需通过 `--network` 参数指定路径。\n\n## 基本使用\n\n准备好内容图片（Content Image）和风格图片（Style Image）后，即可开始生成。\n\n### 最简单的运行命令\n\n```bash\nuv run neural_style.py --content \u003Ccontent file> --styles \u003Cstyle file> --output \u003Coutput file>\n```\n\n**参数说明：**\n*   `\u003Ccontent file>`：你想要保留内容的图片路径（例如：`photo.jpg`）。\n*   `\u003Cstyle file>`：你想要提取风格的图片路径（例如：`starry_night.jpg`）。支持传入多个文件进行风格混合。\n*   `\u003Coutput file>`：生成结果的保存路径（例如：`result.jpg`）。\n\n### 实用示例\n\n假设你有一张名为 `me.jpg` 的照片和一张名为 `picasso.jpg` 的画作，想要生成一张结合了两者风格的图片 `out.jpg`，并迭代 1000 次（默认值）：\n\n```bash\nuv run neural_style.py --content me.jpg --styles picasso.jpg --output out.jpg\n```\n\n### 常用调整参数\n\n为了获得更好的效果，你可能需要调整以下参数：\n\n*   **调整迭代次数**（默认 1000，增加次数通常细节更丰富但耗时更长）：\n    ```bash\n    uv run neural_style.py --content input.jpg --styles style.jpg --output out.jpg --iterations 2000\n    ```\n*   **保存中间过程图**（用于观察生成进度）：\n    ```bash\n    uv run neural_style.py --content input.jpg --styles style.jpg --output out.jpg --checkpoint-output checkpoint_%.jpg --checkpoint-iterations 100\n    ```\n*   **查看完整帮助信息**：\n    ```bash\n    uv run neural_style.py --help\n    ```\n\n> **注意**：由于本项目使用 Adam 优化器替代了原论文的 L-BFGS，如果发现效果不佳，可能需要微调 `--content-weight`（内容权重）、`--style-weight`（风格权重）和 `--learning-rate`（学习率）。","一位独立游戏开发者需要为复古风格的冒险游戏快速生成大量具有统一艺术氛围的场景概念图，但团队缺乏专业画师且预算有限。\n\n### 没有 neural-style 时\n- 手动绘制或外包每张场景图成本高昂，耗时数天甚至数周，严重拖慢开发进度。\n- 难以保证多张概念图之间的艺术风格高度一致，导致游戏视觉体验割裂。\n- 尝试调整画面抽象程度或细节保留度时，必须重新委托画师修改，沟通成本极高且灵活性差。\n- 缺乏技术手段将经典名画（如梵高、毕加索作品）的笔触自然融合到现代摄影素材中。\n\n### 使用 neural-style 后\n- 开发者只需提供一张实景照片和一幅目标风格画作，运行一条命令即可在几分钟内生成高质量概念图。\n- 通过固定风格源图像并批量处理不同内容图，轻松确保整个游戏场景库的艺术风格完美统一。\n- 利用 `--style-layer-weight-exp` 和 `--content-weight-blend` 参数，可即时微调画面的抽象程度与细节保留比例，无需外部依赖。\n- 支持混合多种艺术风格（如 80% 毕加索 +20% 星空），创造出独一无二的视觉效果，激发创意灵感。\n\nneural-style 将原本昂贵且耗时的艺术创作过程转化为高效、可控的代码流程，让小型团队也能拥有电影级的视觉表现力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fanishathalye_neural-style_37590c1a.jpg","anishathalye","Anish Athalye","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fanishathalye_34441b56.png","@joinhandshake, prev @mit-pdos","@joinhandshake","San Francisco, CA","me@anishathalye.com","https:\u002F\u002Fanishathalye.com","https:\u002F\u002Fgithub.com\u002Fanishathalye",[83],{"name":84,"color":85,"percentage":86},"Python","#3572A5",100,5547,1492,"2026-04-13T10:50:45","GPL-3.0","未说明","非必需，但推荐使用 NVIDIA GPU 以显著加速；文中提及在 M3 MacBook Pro (CPU) 上运行 512x512 图像需 90 秒",{"notes":94,"python":95,"dependencies":96},"该项目使用 uv 作为项目和包管理器，需先安装。必须下载预训练的 VGG 网络模型文件 (imagenet-vgg-verydeep-19.mat) 才能运行。由于 TensorFlow 不支持 L-BFGS 优化器，本项目使用 Adam 优化器，可能需要调整超参数（如学习率、内容权重等）以获得最佳效果。","未说明 (由 uv 包管理器自动管理)",[97,98],"tensorflow","uv",[15],null,"2026-03-27T02:49:30.150509","2026-04-15T04:18:23.071106",[104,109,114,119,124,129],{"id":105,"question_zh":106,"answer_zh":107,"source_url":108},33660,"加载 .mat 文件时出现 'KeyError: normalization' 错误怎么办？","这是因为下载了不兼容的 VGG 模型文件。请勿直接从 VLFeat 或其他来源搜索下载新的 .mat 文件。必须使用项目 README 文档中明确链接提供的特定 `imagenet-vgg-verydeep-19.mat` 文件，该文件已针对此代码库进行了预处理和格式化。","https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Fissues\u002F4",{"id":110,"question_zh":111,"answer_zh":112,"source_url":113},33661,"运行程序时出现 'conv2d_v2() got an unexpected keyword argument filter' 错误？","该错误通常是因为使用了从 VLFeat MatConvNet 官网直接下载的原始预训练模型文件，其格式与本项目代码不兼容。解决方法是忽略通用下载链接，严格使用项目 README 的 'Data files' 部分中提供的专用模型文件链接。","https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Fissues\u002F32",{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},33662,"输出图像全是随机噪点或无法显示风格迁移效果？","这通常是由 Python 和 TensorFlow 版本不兼容引起的。特别是当使用 Python 3.7 和 TensorFlow 1.14 时容易出现问题。建议将环境降级至 Python 3.5 并安装 TensorFlow 1.9 版本，这通常能解决该问题并生成正确的结果。","https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Fissues\u002F155",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},33663,"运行时出现 'AttributeError: module object has no attribute imread' 错误？","这是由于 SciPy 版本更新导致 `scipy.misc.imread` 函数被移除或弃用。虽然维护者未直接提供代码修复，但此类问题通常需要通过降级 SciPy 到 0.18 或更早版本，或者修改代码使用 `imageio` 或 `Pillow` 库来替代读取图像的功能。","https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Fissues\u002F7",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},33664,"程序运行时报错 'Aborted (core dumped)' 或 'CUDA_ERROR_NO_DEVICE'？","这表示 TensorFlow 无法检测到可用的 GPU 设备，通常是因为 NVIDIA 驱动程序版本过旧或与安装的 CUDA\u002FcuDNN 版本不匹配。请检查 `nvidia-smi` 输出，确保显卡驱动正常，并重新安装与当前驱动匹配的 CUDA Toolkit 和 cuDNN 库。","https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Fissues\u002F28",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},33665,"运行过程中出现大量关于 SSE、AVX、FMA 指令集的警告并被系统杀死（killed）？","SSE\u002FAVX 警告仅表示 TensorFlow 未针对你的 CPU 优化编译，可忽略。如果进程随后被 'killed'，通常是因为内存不足（OOM）。解决方案包括：减小输入图片的分辨率、减少迭代次数，或者在拥有更大内存的服务器（如 Floyd Hub）或带有 GPU 的环境中运行。","https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fneural-style\u002Fissues\u002F112",[]]