[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-microsoft--Windows-Machine-Learning":3,"tool-microsoft--Windows-Machine-Learning":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 真正成长为懂上",151918,2,"2026-04-12T11:33:05",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":77,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":117,"forks":118,"last_commit_at":119,"license":120,"difficulty_score":121,"env_os":122,"env_gpu":123,"env_ram":124,"env_deps":125,"category_tags":134,"github_topics":135,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":150,"updated_at":151,"faqs":152,"releases":182},6890,"microsoft\u002FWindows-Machine-Learning","Windows-Machine-Learning","Samples and Tools for Windows ML.","Windows-Machine-Learning 是微软为 Windows 平台打造的高性能机器学习推理解决方案，旨在帮助开发者轻松将 AI 模型集成到各类应用中。它主要解决了在 Windows 环境下部署机器学习模型时面临的性能优化、延迟控制及跨版本兼容性难题，让图像识别、实时分析等智能功能能够流畅运行在游戏、框架及其他对响应速度要求极高的场景中。\n\n这套工具非常适合 Windows 应用开发者使用，尤其是那些希望利用现有 ONNX 格式模型，而不必从头训练算法的软件工程师。其核心技术亮点在于底层由 ONNX Runtime 和 DirectML 强力驱动，既能充分利用 CPU 也能高效调用 GPU 加速，确保推理过程既快速又稳定。此外，它提供了灵活的部署方式：既可以直接调用新版 Windows App SDK 中的现代化 API，也支持通过 NuGet 包分发以兼容 Windows 8.1 及以上旧系统。仓库内还附带了丰富的示例代码和 WinML Dashboard 等辅助工具，手把手教您如何从零开始构建智能化的 Windows 应用程序，是连接算法模型与实际落地应用的坚实桥梁。","# Windows Machine Learning\n\n> ⚠️ **IMPORTANT**\u003Cbr\u002F>For the latest documentation about Windows Machine Learning, see [What is Windows ML](\u002Fwindows\u002Fai\u002Fnew-windows-ml\u002Foverview). That documentation describes APIs that are in the **Microsoft.Windows.AI.MachineLearning** namespace, which ships in the Windows App SDK. Those APIs supersede the ones documented here, which are in the **Windows.AI.MachineLearning** namespace, and were shipped in 2018.\n\nWindows Machine Learning is a high-performance machine learning inference API that is powered by [ONNX Runtime](https:\u002F\u002Fonnxruntime.ai\u002F) and [DirectML](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fdirectml\u002Fdml).\n\n\n[![Alt text](https:\u002F\u002Fi.ytimg.com\u002Fvi\u002F8MCDSlm326U\u002Fhq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCFThAhMuWU3UrHtPjc4Ttz9SSkpQ)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=8MCDSlm326U)\n\nThe Windows ML API is a [Windows Runtime Component](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fuwp\u002Fwinrt-components\u002F) and is suitable for high-performance, low-latency applications such as frameworks, games, and other real-time applications as well as applications built with high-level languages.\n\n\nThis repo contains Windows Machine Learning samples and tools that demonstrate how to build machine learning powered scenarios into Windows applications.\n\n- [Getting Started with Windows ML](#getting-started-with-windows-ml)\n- [Model Samples](#model-samples)\n- [Advanced Scenario Samples](#advanced-scenario-samples)\n- [Developer Tools](#developer-tools)\n- [Feedback](#feedback)\n- [External Links](#external-links)\n- [Contributing](#contributing)\n\nFor additional information on Windows ML, including step-by-step tutorials and how-to guides, please visit the [Windows ML documentation](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002F).\n\n\n| Sample\u002FTool | Status |\n|---------|--------------|\n| All Samples | [![Build Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_readme_ef196a5a87ad.png)](https:\u002F\u002Fmicrosoft.visualstudio.com\u002FWindowsAI\u002F_build\u002Flatest?definitionId=39302&branchName=master) |\n| WinmlRunner | [![Build Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_readme_ef196a5a87ad.png)](https:\u002F\u002Fmicrosoft.visualstudio.com\u002FWindowsAI\u002F_build\u002Flatest?definitionId=38654&branchName=master) |\n| WinML Dashboard | [![Build Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_readme_ef196a5a87ad.png)?branchName=master)](https:\u002F\u002Fmicrosoft.visualstudio.com\u002FWindowsAI\u002F_build\u002Flatest?definitionId=39375&branchName=master) |\n\n## Getting Started with Windows ML\n\n**Prerequisites**\n- [Visual Studio 2017 Version 15.7.4 or Newer](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads)\n\n\nWindows ML offers machine learning inferencing via the inbox Windows SDK as well as a redistributable NuGet package. The table below highlights the availability, distribution, language support, servicing, and forward compatibility aspects of the In-Box and NuGet package for Windows ML.\n\n| |In-Box|\tNuGet|\n|-|-----|------|\n|Availability|\t[Windows 10 - Build 17763 (RS5) or Newer](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fsoftware-download\u002Fwindows10)\u003Cbr\u002F>For more detailed information about version support, checkout our [docs](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fuwp\u002Fapi\u002Fwindows.ai.machinelearning?view=winrt-22000).\t| [Windows 8.1 or Newer](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fsoftware-download\u002Fwindows8ISO)\u003Cbr\u002F>**NOTE**: Some APIs (ie: VideoFrame) are not available on older OSes.|\n|Windows SDK|\t[Windows SDK - Build 17763 (RS5) or Newer](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads\u002Fsdk-archive\u002F) |\t[Windows SDK - Build 17763 (RS5) or Newer](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads\u002Fsdk-archive\u002F)\n|Distribution|\tBuilt into Windows |\tPackage and distribute as part of your application\n|Servicing|\tMicrosoft-driven (customers benefit automatically)\t| Developer-driven\n|Forward| compatibility\tAutomatically rolls forward with new features\t| Developer needs to update package manually\n\nLearn more [here](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fwindows-ml\u002Fget-started).\n\n## Model Samples\nIn this section you will find various model samples for a variety of scenarios across the different Windows ML API offerings.\n\n**Image Classification**\n\nA subdomain of computer vision in which an algorithm looks at an image and assigns it a tag from a collection of predefined tags or categories that it has been trained on.\n\n| Windows App Type \u003Cbr\u002F>Distribution | UWP\u003Cbr\u002F>In-Box |  UWP\u003Cbr\u002F>NuGet | Desktop\u003Cbr\u002F>In-Box | Desktop\u003Cbr\u002F>NuGet |\n|------------|------------------------------------|--------------------------------------|------------------------------------|--------------------------------------|\n| [AlexNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Falexnet)                                | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [CaffeNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fcaffenet)                                  | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [DenseNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fdensenet-121)                              | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [EfficientNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fefficientnet-lite4)             | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [GoogleNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Finception_and_googlenet\u002Fgooglenet)        | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [InceptionV1](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Finception_and_googlenet\u002Finception_v1)      | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [InceptionV2](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Finception_and_googlenet\u002Finception_v2)      | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [MNIST](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fmnist)      | [✔️C++\u002FCX](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FMNIST\u002FUWP)\u003Cbr\u002F>[✔️C#](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FMNIST\u002FTutorial\u002Fcs)\u003Cbr\u002F>    |                                                 |\n| [MobileNetV2](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fmobilenet)                              | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [RCNN](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Frcnn_ilsvrc13)                        | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ResNet50](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fresnet)                          | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ShuffleNetV1](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fshufflenet)                              | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ShuffleNetV2](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fshufflenet)                          | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [SqueezeNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fsqueezenet) | [✔️C#](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FUWP\u002Fcs)\u003Cbr\u002F>[✔️JavaScript](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FUWP\u002Fcs)\u003Cbr\u002F>        |                     |[✔️C++\u002FWinRT](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FDesktop\u002Fcpp)\u003Cbr\u002F> [✔️C# .NET5](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FNET5)\u003Cbr\u002F>[✔️C# .NET Core 2](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FNETCore\u002Fcs)\u003Cbr\u002F>|[✔️C++\u002FWinRT](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FDesktop\u002Fcpp)\u003Cbr\u002F>[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>[✔️Rust](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FRustSqueezenet)\u003Cbr\u002F>|\n| [VGG19](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fvgg)                                          | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [VGG19bn](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fvgg)                                       | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ZFNet512](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fzfnet-512)                                 | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n\n**Style Transfer**\n\nA computer vision technique that allows us to recompose the content of an image in the style of another.\n\n| Windows App Type \u003Cbr\u002F>Distribution | UWP\u003Cbr\u002F>In-Box |  UWP\u003Cbr\u002F>NuGet | Desktop\u003Cbr\u002F>In-Box | Desktop\u003Cbr\u002F>NuGet |\n|------------|------------------------------------|--------------------------------------|------------------------------------|--------------------------------------|\n| FNSCandy   | [✔️C# - FNS Style Transfer](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FFNSCandyStyleTransfer)\u003Cbr\u002F>[✔️C# - Real-Time Style Transfer](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FStyleTransfer)\u003Cbr\u002F>           |                                                 |\n\n\u003C!--\n**Object Detection**\n\n\n|            | Store App\u003Cbr\u002F>Inbox API |  Store App\u003Cbr\u002F>NuGet API | Desktop App\u003Cbr\u002F>Inbox API |  Desktop App\u003Cbr\u002F>NuGet API |\n|------------|------------------------------------|--------------------------------------|------------------------------------|--------------------------------------|\n| [YoloV4](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Fraw\u002Fmaster\u002Fvision\u002Fobject_detection_segmentation\u002Fyolov4\u002Fmodel\u002Fyolov4.onnx)                         | | ||[✔️C# .NET5 - Samples Gallery](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n\n-->\n\n## Advanced Scenario Samples\n\nThese advanced samples show how to use various binding and evaluation features in Windows ML:\n\n- **[Custom Tensorization](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FCustomTensorization)**: A Windows Console Application (C++\u002FWinRT) that shows how to do custom tensorization.\n\n- **[Custom Operator (CPU)](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FCustomOperator)**: A desktop app that defines multiple custom cpu operators. One of these is a debug operator which we invite you to integrate into your own workflow.\n\n- **[Adapter Selection](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FAdapterSelection)**: A desktop app that demonstrates how to choose a specific device adapter for running your model.\n\n- **[Plane Identifier](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**: a UWP app and a WPF app packaged with the Desktop Bridge, sharing the same model trained using [Azure Custom Vision service](https:\u002F\u002Fcustomvision.ai\u002F). For step-by-step instructions for this sample, please see the blog post [Upgrade your WinML application to the latest bits](https:\u002F\u002Fblogs.msdn.microsoft.com\u002Fappconsult\u002F2018\u002F11\u002F06\u002Fupgrade-your-winml-application-to-the-latest-bits\u002F).\n\n- **[Custom Vision and Windows ML](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**: The tutorial shows how to train a neural network model to classify images of food using Azure Custom Vision service, export the model to ONNX format, and deploy the model in a Windows Machine Learning application running locally on Windows device. \n\n- **[ML.NET and Windows ML](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**: This tutorial shows you how to train a neural network model to classify images of food using ML.NET Model Builder, export the model to ONNX format, and deploy the model in a Windows Machine Learning application running locally on a Windows device. \n\n- **[PyTorch Data Analysis](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**: The tutorial shows how to solve a classification task with a neural network using the PyTorch library, export the model to ONNX format and deploy the model with the Windows Machine Learning application that can run on any Windows device.\n\n- **[PyTorch Image Classification](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**: The tutorial shows how to train an image classification neural network model using PyTorch, export the model to the ONNX format, and deploy it in a Windows Machine Learning application running locally on your Windows device.\n\n- **[YoloV4 Object Detection](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**: This tutorial shows how to build a UWP C# app that uses the YOLOv4 model to detect objects in video streams.\n\n## Developer Tools\n\n- **Model Conversion**\n\n  Windows ML provides inferencing capabilities powered by the ONNX Runtime engine. As such, all models run in Windows ML must be converted to the [ONNX Model format](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fonnx). Models built and trained in source frameworks like TensorFlow or PyTorch must be converted to ONNX. Check out the documentation for how to convert to an ONNX model:\n    - https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Ftutorials\u002Fmobile\u002Fmodel-conversion.html\n    - https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fwindows-ml\u002Ftutorials\u002Fpytorch-convert-model\n    - [WinMLTools](https:\u002F\u002Fpypi.org\u002Fproject\u002Fwinmltools\u002F): a Python tool for converting models from different machine learning toolkits into ONNX for use with Windows ML.\n\n- **Model Optimization**\n\n  Models may need further optimizations applied post conversion to support advanced features like batching and quantization. Check out the following tools for optimizing your model:\n\n  - **[WinML Dashboard (Preview)](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FTools\u002FWinMLDashboard)**: a GUI-based tool for viewing, editing, converting, and validating machine learning models for Windows ML inference engine. This tool can be used to enable free dimensions on models that were built with fixed dimensions. [Download Preview Version](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Freleases)\n\n\n  - **[Graph Optimizations](https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Fperformance\u002Fgraph-optimizations.html#:~:text=ONNX%20Runtime%20provides%20various%20graph%20optimizations%20to%20improve,to%20more%20complex%20node%20fusions%20and%20layout%20optimizations):** Graph optimizations are essentially graph-level transformations, ranging from small graph simplifications and node eliminations to more complex node fusions and layout optimizations.\n\n  - **[Graph Quantization](https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Fperformance\u002Fquantization.html#:~:text=Quantization%20in%20ONNX%20Runtime%20refers%20to%208%20bit,the%20floating%20point%20numbers%20to%20a%20quantization%20space.)**: Quantization in ONNX Runtime refers to 8 bit linear quantization of an ONNX model.\n\n- **Model Validation**\n  - **[WinMLRunner](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FTools\u002FWinMLRunner)**: a command-line tool that can run .onnx or .pb models where the input and output variables are tensors or images. It is a very handy tool to quickly validate an ONNX model. It will attempt to load, bind, and evaluate a model and print out helpful messages. It also captures performance measurements.\n\n    [Download x64 Exe](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Freleases)\n\n- **Model Integration**\n  - **[WinML Code Generator (mlgen)](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=WinML.mlgen)**: a Visual Studio extension to help you get started using WinML APIs on UWP apps by generating a template code when you add a trained ONNX file into the UWP project. From the template code you can load a model, create a session, bind inputs, and evaluate with wrapper codes. See [docs](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fmlgen) for more info.\n\n    Download for [VS 2017](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=WinML.mlgen), [VS 2019](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=WinML.MLGenV2)\n\n  - **[WinML Samples Gallery](Samples\u002FWinMLSamplesGallery):** explore a variety of ML integration scenarios and models.\n\n  - Check out the [Model Samples](#model-samples) and [Advanced Scenario Samples](#advanced-scenarios) to learn how to use Windows ML in your application.\n  \n\n\n\n## Feedback\n- For issues, file a bug on [GitHub Issues](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Fissues).\n- Ask questions on [Stack Overflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fwindows-machine-learning).\n- Vote for popular feature requests on [Windows Developer Feedback](https:\u002F\u002Fwpdev.uservoice.com\u002Fforums\u002F110705-universal-windows-platform?category_id=341035) or include your own request.\n\n## External Links\n - [ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fonnxruntime\u002F).\n - [ONNX: Open Neural Network Exchange Project](https:\u002F\u002Fonnx.ai\u002F).\n\n## Contributing\n\nWe're always looking for your help to fix bugs and improve the samples. Create a pull request, and we'll be happy to take a look.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https:\u002F\u002Fopensource.microsoft.com\u002Fcodeofconduct\u002F).\nFor more information see the [Code of Conduct FAQ](https:\u002F\u002Fopensource.microsoft.com\u002Fcodeofconduct\u002Ffaq\u002F) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n","# Windows 机器学习\n\n> ⚠️ **重要提示**\u003Cbr\u002F>有关 Windows 机器学习的最新文档，请参阅[什么是 Windows ML](\u002Fwindows\u002Fai\u002Fnew-windows-ml\u002Foverview)。该文档介绍了位于 **Microsoft.Windows.AI.MachineLearning** 命名空间中的 API，这些 API 随 Windows 应用程序 SDK 一起提供。这些 API 取代了此处记录的、位于 **Windows.AI.MachineLearning** 命名空间中的 API，后者于 2018 年发布。\n\nWindows 机器学习是一个高性能的机器学习推理 API，由 [ONNX Runtime](https:\u002F\u002Fonnxruntime.ai\u002F) 和 [DirectML](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fdirectml\u002Fdml) 提供支持。\n\n\n[![替代文本](https:\u002F\u002Fi.ytimg.com\u002Fvi\u002F8MCDSlm326U\u002Fhq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCFThAhMuWU3UrHtPjc4Ttz9SSkpQ)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=8MCDSlm326U)\n\nWindows ML API 是一个 [Windows 运行时组件](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fuwp\u002Fwinrt-components\u002F)，适用于高性能、低延迟的应用程序，例如框架、游戏和其他实时应用，以及使用高级语言构建的应用程序。\n\n\n此仓库包含 Windows 机器学习示例和工具，演示如何将机器学习功能集成到 Windows 应用程序中。\n\n- [Windows ML 入门](#getting-started-with-windows-ml)\n- [模型示例](#model-samples)\n- [高级场景示例](#advanced-scenario-samples)\n- [开发者工具](#developer-tools)\n- [反馈](#feedback)\n- [外部链接](#external-links)\n- [贡献](#contributing)\n\n有关 Windows ML 的更多信息，包括分步教程和操作指南，请访问 [Windows ML 文档](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002F)。\n\n\n| 示例\u002F工具 | 状态 |\n|---------|--------------|\n| 所有示例 | [![构建状态](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_readme_ef196a5a87ad.png)](https:\u002F\u002Fmicrosoft.visualstudio.com\u002FWindowsAI\u002F_build\u002Flatest?definitionId=39302&branchName=master) |\n| WinmlRunner | [![构建状态](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_readme_ef196a5a87ad.png)](https:\u002F\u002Fmicrosoft.visualstudio.com\u002FWindowsAI\u002F_build\u002Flatest?definitionId=38654&branchName=master) |\n| WinML 仪表板 | [![构建状态](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_readme_ef196a5a87ad.png)?branchName=master)](https:\u002F\u002Fmicrosoft.visualstudio.com\u002FWindowsAI\u002F_build\u002Flatest?definitionId=39375&branchName=master) |\n\n## Windows ML 入门\n\n**先决条件**\n- [Visual Studio 2017 版本 15.7.4 或更高版本](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads)\n\n\nWindows ML 通过预装的 Windows SDK 以及可再分发的 NuGet 包提供机器学习推理功能。下表重点介绍了 Windows ML 的预装版本和 NuGet 包在可用性、分发方式、语言支持、服务更新以及向前兼容性方面的差异。\n\n| |预装版|\tNuGet|\n|-|-----|------|\n|可用性|\t[Windows 10 - 构建 17763 (RS5) 或更高版本](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fsoftware-download\u002Fwindows10)\u003Cbr\u002F>有关版本支持的详细信息，请参阅我们的[文档](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fuwp\u002Fapi\u002Fwindows.ai.machinelearning?view=winrt-22000)。\t| [Windows 8.1 或更高版本](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fsoftware-download\u002Fwindows8ISO)\u003Cbr\u002F>**注意**: 某些 API（如 VideoFrame）在较旧的操作系统上不可用。|\n|Windows SDK|\t[Windows SDK - 构建 17763 (RS5) 或更高版本](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads\u002Fsdk-archive\u002F) |\t[Windows SDK - 构建 17763 (RS5) 或更高版本](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads\u002Fsdk-archive\u002F)\n|分发方式| 内置于 Windows 中 | 作为应用程序的一部分打包并分发\n|服务更新| 由 Microsoft 主导（客户自动受益）\t| 由开发者负责\n|向前兼容性\t自动随新功能更新\t| 开发者需要手动更新包\n\n了解更多信息[请点击这里](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fwindows-ml\u002Fget-started)。\n\n## 模型示例\n在本节中，您将找到适用于不同 Windows ML API 产品线中各种场景的多种模型示例。\n\n**图像分类**\n\n计算机视觉的一个子领域，其中算法会查看一张图像，并根据其训练过的预定义标签或类别集合为其分配一个标签。\n\n| Windows 应用类型 \u003Cbr\u002F>分发方式 | UWP\u003Cbr\u002F>内置 |  UWP\u003Cbr\u002F>NuGet | 桌面\u003Cbr\u002F>内置 | 桌面\u003Cbr\u002F>NuGet |\n|------------|------------------------------------|--------------------------------------|------------------------------------|--------------------------------------|\n| [AlexNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Falexnet)                                | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [CaffeNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fcaffenet)                                  | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [DenseNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fdensenet-121)                              | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [EfficientNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fefficientnet-lite4)             | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [GoogleNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Finception_and_googlenet\u002Fgooglenet)        | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [InceptionV1](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Finception_and_googlenet\u002Finception_v1)      | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [InceptionV2](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Finception_and_googlenet\u002Finception_v2)      | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [MNIST](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fmnist)      | [✔️C++\u002FCX](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FMNIST\u002FUWP)\u003Cbr\u002F>[✔️C#](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FMNIST\u002FTutorial\u002Fcs)\u003Cbr\u002F>    |                                                 |\n| [MobileNetV2](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fmobilenet)                              | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [RCNN](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Frcnn_ilsvrc13)                        | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ResNet50](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fresnet)                          | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ShuffleNetV1](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fshufflenet)                              | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ShuffleNetV2](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fshufflenet)                          | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [SqueezeNet](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fsqueezenet) | [✔️C#](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FUWP\u002Fcs)\u003Cbr\u002F>[✔️JavaScript](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FUWP\u002Fcs)\u003Cbr\u002F>        |                     |[✔️C++\u002FWinRT](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FDesktop\u002Fcpp)\u003Cbr\u002F> [✔️C# .NET5](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FNET5)\u003Cbr\u002F>[✔️C# .NET Core 2](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FNETCore\u002Fcs)\u003Cbr\u002F>|[✔️C++\u002FWinRT](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FSqueezeNetObjectDetection\u002FDesktop\u002Fcpp)\u003Cbr\u002F>[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>[✔️Rust](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FRustSqueezenet)\u003Cbr\u002F>|\n| [VGG19](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fvgg)                                          | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [VGG19bn](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fvgg)                                       | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n| [ZFNet512](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Ftree\u002Fmaster\u002Fvision\u002Fclassification\u002Fzfnet-512)                                 | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n\n**风格迁移**\n\n一种计算机视觉技术，允许我们以另一幅图像的风格重新构图一幅图像的内容。\n\n| Windows 应用类型 \u003Cbr\u002F>分发方式 | UWP\u003Cbr\u002F>内置 |  UWP\u003Cbr\u002F>NuGet | 桌面\u003Cbr\u002F>内置 | 桌面\u003Cbr\u002F>NuGet |\n|------------|------------------------------------|--------------------------------------|------------------------------------|--------------------------------------|\n| FNSCandy   | [✔️C# - FNS 风格迁移](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FFNSCandyStyleTransfer)\u003Cbr\u002F>[✔️C# - 实时风格迁移](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FStyleTransfer)\u003Cbr\u002F>           |                                                 |\n\n\u003C!--\n**目标检测**\n\n\n|            | 商店应用\u003Cbr\u002F>内置 API |  商店应用\u003Cbr\u002F>NuGet API | 桌面应用\u003Cbr\u002F>内置 API |  桌面应用\u003Cbr\u002F>NuGet API |\n|------------|------------------------------------|--------------------------------------|------------------------------------|--------------------------------------|\n| [YoloV4](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fmodels\u002Fraw\u002Fmaster\u002Fvision\u002Fobject_detection_segmentation\u002Fyolov4\u002Fmodel\u002Fyolov4.onnx)                         | | ||[✔️C# .NET5 - 示例库](Samples\u002FWinMLSamplesGallery)\u003Cbr\u002F>|\n\n-->\n\n## 高级场景示例\n\n这些高级示例展示了如何在 Windows ML 中使用各种绑定和评估功能：\n\n- **[自定义张量化](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FCustomTensorization)**：一个 Windows 控制台应用程序（C++\u002FWinRT），演示如何进行自定义张量化。\n\n- **[自定义算子（CPU）](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FCustomOperator)**：一个桌面应用，定义了多个自定义 CPU 算子。其中一个为调试算子，我们邀请您将其集成到自己的工作流中。\n\n- **[适配器选择](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FSamples\u002FAdapterSelection)**：一个桌面应用，演示如何为运行模型选择特定的设备适配器。\n\n- **[平面识别器](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**：一个 UWP 应用和一个 WPF 应用，通过桌面桥打包在一起，共享使用 [Azure Custom Vision 服务](https:\u002F\u002Fcustomvision.ai\u002F) 训练的同一模型。有关此示例的分步说明，请参阅博客文章 [将您的 WinML 应用程序升级到最新版本](https:\u002F\u002Fblogs.msdn.microsoft.com\u002Fappconsult\u002F2018\u002F11\u002F06\u002Fupgrade-your-winml-application-to-the-latest-bits\u002F)。\n\n- **[Custom Vision 和 Windows ML](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**：本教程演示如何使用 Azure Custom Vision 服务训练一个神经网络模型来分类食物图像，将模型导出为 ONNX 格式，并将其部署到本地 Windows 设备上运行的 Windows Machine Learning 应用程序中。\n\n- **[ML.NET 和 Windows ML](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**：本教程向您展示如何使用 ML.NET Model Builder 训练一个神经网络模型来分类食物图像，将模型导出为 ONNX 格式，并将其部署到本地 Windows 设备上运行的 Windows Machine Learning 应用程序中。\n\n- **[PyTorch 数据分析](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**：本教程演示如何使用 PyTorch 库构建神经网络解决分类任务，将模型导出为 ONNX 格式，并使用可在任何 Windows 设备上运行的 Windows Machine Learning 应用程序部署该模型。\n\n- **[PyTorch 图像分类](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**：本教程演示如何使用 PyTorch 训练一个图像分类神经网络模型，将其导出为 ONNX 格式，并部署到您本地 Windows 设备上运行的 Windows Machine Learning 应用程序中。\n\n- **[YoloV4 目标检测](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-AppConsult-Samples-UWP\u002Ftree\u002Fmaster\u002FPlaneIdentifier)**：本教程演示如何构建一个使用 YOLOv4 模型检测视频流中目标的 UWP C# 应用程序。\n\n## 开发者工具\n\n- **模型转换**\n\n  Windows ML 提供由 ONNX Runtime 引擎驱动的推理能力。因此，在 Windows ML 中运行的所有模型都必须转换为 [ONNX 模型格式](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fonnx)。在 TensorFlow 或 PyTorch 等源框架中构建和训练的模型必须转换为 ONNX 格式。请参阅以下文档了解如何转换为 ONNX 模型：\n    - https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Ftutorials\u002Fmobile\u002Fmodel-conversion.html\n    - https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fwindows-ml\u002Ftutorials\u002Fpytorch-convert-model\n    - [WinMLTools](https:\u002F\u002Fpypi.org\u002Fproject\u002Fwinmltools\u002F)：一个用于将来自不同机器学习工具包的模型转换为 ONNX 格式的 Python 工具，以便与 Windows ML 一起使用。\n\n- **模型优化**\n\n  模型在转换后可能需要进一步优化，以支持批处理和量化等高级功能。请查看以下工具以优化您的模型：\n\n  - **[WinML 仪表板（预览版）](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FTools\u002FWinMLDashboard)**：一个基于 GUI 的工具，用于查看、编辑、转换和验证适用于 Windows ML 推理引擎的机器学习模型。该工具可用于为使用固定尺寸构建的模型启用自由维度。[下载预览版](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Freleases)\n\n  - **[图优化](https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Fperformance\u002Fgraph-optimizations.html#:~:text=ONNX%20Runtime%20provides%20various%20graph%20optimizations%20to%20improve,to%20more%20complex%20node%20fusions%20and%20layout%20optimizations)**：图优化本质上是图级别的变换，范围从小型图简化和节点消除，到更复杂的节点融合和布局优化。\n\n  - **[图量化](https:\u002F\u002Fonnxruntime.ai\u002Fdocs\u002Fperformance\u002Fquantization.html#:~:text=Quantization%20in%20ONNX%20Runtime%20refers%20to%208%20bit,the%20floating%20point%20numbers%20to%20a%20quantization%20space.)**：ONNX Runtime 中的量化是指对 ONNX 模型进行 8 位线性量化。\n\n- **模型验证**\n  - **[WinMLRunner](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Ftree\u002Fmaster\u002FTools\u002FWinMLRunner)**：一个命令行工具，可运行输入和输出变量为张量或图像的 .onnx 或 .pb 模型。它是一个非常方便的工具，可以快速验证 ONNX 模型。它会尝试加载、绑定和评估模型，并打印出有用的提示信息。同时还会捕获性能测量数据。\n\n    [下载 x64 可执行文件](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Freleases)\n\n- **模型集成**\n  - **[WinML 代码生成器 (mlgen)](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=WinML.mlgen)**：一个 Visual Studio 扩展，可通过在 UWP 项目中添加经过训练的 ONNX 文件来生成模板代码，帮助您开始在 UWP 应用程序中使用 WinML API。您可以从模板代码中加载模型、创建会话、绑定输入并使用封装代码进行评估。更多信息请参阅 [文档](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fai\u002Fmlgen)。\n\n    下载适用于 [VS 2017](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=WinML.mlgen) 和 [VS 2019](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=WinML.MLGenV2) 的版本\n\n  - **[WinML 示例库](Samples\u002FWinMLSamplesGallery)**：探索各种 ML 集成场景和模型。\n\n  - 请查看 [模型示例](#model-samples) 和 [高级场景示例](#advanced-scenarios)，以了解如何在您的应用程序中使用 Windows ML。\n\n## 反馈\n- 如遇问题，请在 [GitHub Issues](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FWindows-Machine-Learning\u002Fissues) 上提交 bug。\n- 如有疑问，请前往 [Stack Overflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fwindows-machine-learning) 提问。\n- 在 [Windows Developer Feedback](https:\u002F\u002Fwpdev.uservoice.com\u002Fforums\u002F110705-universal-windows-platform?category_id=341035) 上为热门功能请求投票，或提出您自己的需求。\n\n## 外部链接\n - [ONNX Runtime：跨平台、高性能的机器学习推理与训练加速器](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fonnxruntime\u002F)。\n - [ONNX：开放神经网络交换项目](https:\u002F\u002Fonnx.ai\u002F)。\n\n## 贡献\n我们始终欢迎您的帮助，以修复 bug 和改进示例代码。请创建一个拉取请求，我们将非常乐意审阅。\n\n本项目已采纳 [Microsoft 开源行为准则](https:\u002F\u002Fopensource.microsoft.com\u002Fcodeofconduct\u002F)。\n如需更多信息，请参阅 [行为准则常见问题解答](https:\u002F\u002Fopensource.microsoft.com\u002Fcodeofconduct\u002Ffaq\u002F)；如有任何其他问题或意见，请发送邮件至 [opencode@microsoft.com](mailto:opencode@microsoft.com)。","# Windows Machine Learning 快速上手指南\n\nWindows Machine Learning (WinML) 是一个高性能的机器学习推理 API，基于 ONNX Runtime 和 DirectML 构建，专为低延迟应用（如游戏、实时框架）设计。\n\n> **⚠️ 重要提示**：本文档针对的是旧版 `Windows.AI.MachineLearning` 命名空间（2018 年发布）。微软推荐使用最新的 **Windows App SDK** 中的 `Microsoft.Windows.AI.MachineLearning` 命名空间。本指南主要基于仓库提供的经典示例进行介绍。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：\n    *   **内置 API 方案**：Windows 10 版本 1809 (Build 17763\u002FRS5) 或更高版本。\n    *   **NuGet 包方案**：Windows 8.1 或更高版本（部分新特性如 VideoFrame 在旧系统上不可用）。\n*   **开发工具**：\n    *   Visual Studio 2017 (版本 15.7.4 或更高) 或 Visual Studio 2019\u002F2022。\n    *   安装时需勾选 **\"通用 Windows 平台开发\"** (UWP) 或 **\"桌面开发与 C++\"** 工作负载。\n*   **SDK**：\n    *   Windows SDK (Build 17763\u002FRS5 或更高版本)。\n\n## 安装步骤\n\nWinML 可以通过两种方式使用：使用 Windows 内置组件（推荐用于 Win10+）或通过 NuGet 包分发。\n\n### 方式一：使用内置 Windows SDK (推荐)\n\n无需额外安装包，只需在项目配置中引用正确的 Windows 版本。\n\n1.  打开 Visual Studio，创建一个新的 **通用 Windows 平台 (UWP)** 或 **C++ 桌面应用** 项目。\n2.  右键点击项目 -> **属性**。\n3.  将 **目标版本** (Target Version) 和 **最低版本** (Minimum Version) 均设置为 **Windows 10, version 1809 (10.0; Build 17763)** 或更高。\n4.  在代码中直接引用命名空间即可使用：\n    *   C++\u002FWinRT: `#include \u003Cwinrt\u002FWindows.AI.MachineLearning.h>`\n    *   C#: `using Windows.AI.MachineLearning;`\n\n### 方式二：通过 NuGet 包安装 (适用于旧系统或独立分发)\n\n如果您需要支持 Windows 8.1 或将运行时打包分发给用户：\n\n1.  在 Visual Studio 中，右键点击解决方案资源管理器中的项目，选择 **管理 NuGet 程序包**。\n2.  浏览并搜索 `Microsoft.AI.MachineLearning`。\n3.  点击 **安装**。\n    *   *注：国内开发者若遇到下载慢的问题，可在 NuGet 设置中添加国内镜像源（如阿里云：`https:\u002F\u002Fmirrors.aliyun.com\u002Fnuget\u002Fv3\u002Findex.json`）。*\n\n## 基本使用\n\n以下是一个最简单的 C# 示例，展示如何加载一个预训练的 ONNX 模型（例如 MNIST 手写数字识别模型）并执行推理。\n\n### 1. 准备模型\n确保你有一个 `.onnx` 格式的模型文件（例如 `mnist.onnx`），并将其添加到项目的 `Assets` 文件夹中，设置其属性为“内容”且“复制到输出目录”。\n\n### 2. 代码示例\n\n```csharp\nusing Windows.AI.MachineLearning;\nusing Windows.Storage;\nusing System.Threading.Tasks;\n\npublic async Task RunInferenceAsync()\n{\n    \u002F\u002F 1. 加载模型文件\n    StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(\"ms-appx:\u002F\u002F\u002FAssets\u002Fmnist.onnx\"));\n    \n    \u002F\u002F 2. 创建学习会话 (LearningSession)\n    var learningModel = await LearningModel.LoadFromStorageFileAsync(modelFile);\n    var session = new LearningModelSession(learningModel);\n\n    \u002F\u002F 3. 准备输入数据 (此处以 MNIST 的 28x28 灰度图为例)\n    \u002F\u002F 实际使用时需将图像转换为 TensorFloat\n    var imageTensor = TensorFloat.Create();\n    imageTensor.Shape = new ulong[] { 1, 1, 28, 28 }; \u002F\u002F Batch, Channel, Height, Width\n    \n    \u002F\u002F 填充数据 (示例为全零，实际应填入像素值归一化后的数据)\n    for (int i = 0; i \u003C 28 * 28; i++)\n    {\n        imageTensor.Add(0.0f); \n    }\n\n    \u002F\u002F 4. 绑定输入\n    var binding = new LearningModelBinding(session);\n    binding.Bind(\"Input3\", imageTensor); \u002F\u002F \"Input3\" 需替换为你模型实际的输入节点名称\n\n    \u002F\u002F 5. 执行评估 (推理)\n    var result = await session.EvaluateAsync(binding, \"\");\n\n    \u002F\u002F 6. 获取输出\n    var outputTensor = result.Outputs[\"Plus214_Output_0\"] as TensorFloat; \u002F\u002F 名称需根据模型调整\n    \n    \u002F\u002F 处理结果...\n}\n```\n\n### 3. 运行示例项目\n本仓库提供了大量现成的示例代码，是上手最快的方式：\n*   **图像分类**：查看 `Samples\u002FMNIST` (C++\u002FCX 或 C#) 或 `Samples\u002FSqueezeNetObjectDetection`。\n*   **风格迁移**：查看 `Samples\u002FStyleTransfer`。\n*   **高级场景**：查看 `Samples\u002FCustomOperator` (自定义算子) 或 `Samples\u002FAdapterSelection` (指定 GPU\u002FCPU)。\n\n克隆仓库后，直接在 Visual Studio 中打开对应的 `.sln` 文件即可编译运行：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning.git\ncd Windows-Machine-Learning\u002FSamples\u002FMNIST\u002FTutorial\u002Fcs\n# 使用 VS 打开该目录下的 .sln 或 .csproj 文件\n```","一家开发工业质检软件的团队，需要在 Windows 端的边缘计算设备上实时运行深度学习模型，以检测生产线上的产品缺陷。\n\n### 没有 Windows-Machine-Learning 时\n- **部署依赖沉重**：开发者必须捆绑庞大的第三方推理引擎（如完整的 ONNX Runtime 二进制文件），导致安装包体积激增，且需手动管理复杂的 DLL 依赖关系。\n- **硬件加速困难**：难以直接调用显卡（GPU）进行低延迟推理，若仅靠 CPU 运行模型，处理高清工业相机视频流时帧率极低，无法满足实时拦截需求。\n- **系统集成割裂**：模型推理逻辑与现有的 C++\u002FC# Windows 应用架构融合度差，需要编写大量胶水代码来转换数据格式，增加了维护成本和崩溃风险。\n- **版本更新繁琐**：推理引擎的升级完全依赖开发团队重新打包发布，无法利用操作系统的自动更新机制，导致老旧设备上的安全漏洞修复滞后。\n\n### 使用 Windows-Machine-Learning 后\n- **原生轻量集成**：直接调用 Windows SDK 内置的高性能 API，无需分发额外的大型运行时库，显著减小了应用体积并简化了安装流程。\n- **自动硬件加速**：底层自动对接 DirectML 和 ONNX Runtime，无缝利用本地 GPU 进行并行计算，将单张图片的检测延迟从数百毫秒降低至毫秒级，实现流畅的实时质检。\n- **开发效率提升**：作为标准的 Windows 运行时组件，它能自然地嵌入 UWP 或 Win32 应用中，数据流转顺畅，开发者可专注于业务逻辑而非底层适配。\n- **系统级持续服务**：推理引擎随 Windows 系统自动更新和维护，确保了长期的性能优化和安全性，减轻了开发团队的后期运维负担。\n\nWindows-Machine-Learning 通过将高性能机器学习推理能力原生化，让开发者能以最低的成本在 Windows 生态中构建低延迟、高兼容性的智能应用。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_Windows-Machine-Learning_218bacfb.png","microsoft","Microsoft","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmicrosoft_4900709c.png","Open source projects and samples from Microsoft",null,"opensource@microsoft.com","OpenAtMicrosoft","https:\u002F\u002Fopensource.microsoft.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft",[82,86,90,94,98,102,106,110,114],{"name":83,"color":84,"percentage":85},"C++","#f34b7d",48.3,{"name":87,"color":88,"percentage":89},"TypeScript","#3178c6",22.8,{"name":91,"color":92,"percentage":93},"C","#555555",20.6,{"name":95,"color":96,"percentage":97},"C#","#178600",3.7,{"name":99,"color":100,"percentage":101},"JavaScript","#f1e05a",1.9,{"name":103,"color":104,"percentage":105},"Python","#3572A5",1.4,{"name":107,"color":108,"percentage":109},"CSS","#663399",0.7,{"name":111,"color":112,"percentage":113},"HTML","#e34c26",0.3,{"name":115,"color":116,"percentage":113},"Batchfile","#C1F12E",1116,440,"2026-03-30T22:10:19","MIT",4,"Windows","非必需。支持通过 DirectML 利用 GPU 加速（兼容多种显卡），也可在 CPU 上运行。未指定具体显存大小或 CUDA 版本（因不依赖 CUDA）。","未说明",{"notes":126,"python":127,"dependencies":128},"1. 该工具专为 Windows 平台设计，不支持 Linux 或 macOS。\n2. 提供两种分发方式：系统内置（需 Windows 10 Build 17763+）和 NuGet 包（支持 Windows 8.1+，但部分 API 受限）。\n3. 注意：README 警告旧的 Windows.AI.MachineLearning 命名空间已被新的 Microsoft.Windows.AI.MachineLearning (Windows App SDK) 取代。\n4. 开发语言主要为 C++\u002FWinRT, C# (.NET Core\u002F.NET 5+), JavaScript 和 Rust，而非 Python。","未说明 (主要支持 C++, C#, JavaScript, Rust)",[129,130,131,132,133],"Visual Studio 2017 v15.7.4+","Windows SDK Build 17763 (RS5)+","ONNX Runtime","DirectML","Windows App SDK (针对新 API)",[13,15,14],[136,137,138,139,140,141,142,143,144,145,146,147,148,149],"machine-learning","ai","ml","deep-learning","neural-network","onnx","windows","keras","tensorflow","coreml","scikit-learn","caffe2","pytorch","winmltools","2026-03-27T02:49:30.150509","2026-04-12T21:57:52.869987",[153,158,163,167,172,177],{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},31054,"为什么在 Visual Studio 中添加 ONNX 模型后没有生成代码文件（.cs）？","这通常是因为项目所在的完整路径中包含空格。Windows Machine Learning 代码生成扩展（mlgen）无法处理包含空格的路径。解决方法是将项目移动到没有空格的路径下，或者重命名父文件夹以消除空格，之后再次尝试添加模型，代码生成即可立即生效。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fissues\u002F290",{"id":159,"question_zh":160,"answer_zh":161,"source_url":162},31055,"Keras 转换的 ONNX 模型输入形状是 NHWC，但 Windows ML 默认需要 NCHW，如何处理？","Windows ML 默认接受的输入形状为 {batch_size, channels, height, width} (NCHW)，而 Keras 模型通常为 {batch_size, height, width, channels} (NHWC)。解决方法有两种：1. 修改模型元数据，将输入定义为 NCHW 形状，并在图形输入后立即插入一个 Transpose 算子（例如 Transpose(0,3,1,2)）来调整维度；2. 在代码中进行手动张量化（Manual Tensorization），参考 CustomTensorization 示例中的 SoftwareBitmapToSoftwareTensor 方法，根据具体形状进行通道置换。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fissues\u002F132",{"id":164,"question_zh":165,"answer_zh":166,"source_url":162},31056,"加载 ONNX 模型时遇到类型错误：Type parameter (T) bound to different types (tensor(float) and tensor(int32))，如何解决？","该错误通常发生在模型内部的某些节点（如乘法操作）中，操作数的数据类型不一致（一个是 float，一个是 int32）。需要在模型转换或导出阶段检查并统一相关操作的数据类型。如果是在运行时遇到，可能需要重新训练或转换模型，确保所有涉及算术运算的张量类型匹配。有用户反馈通过更改乘法操作的类型解决了此问题并成功加载模型。",{"id":168,"question_zh":169,"answer_zh":170,"source_url":171},31057,"使用纯 C++ API 评估模型时报错\"The size of the buffer provided for a bound variable is invalid\"，原因是什么？","此错误表示绑定变量提供的缓冲区大小无效。即使输入和输出的报告形状看起来正确，也需要确保实际分配的内存缓冲区大小（以字节为单位）严格匹配模型预期的张量大小。计算公式应为：元素总数 × 单个元素的大小（例如 float 为 4 字节）。请仔细检查 pShape 设置的维度以及对应的内存分配逻辑，确保没有遗漏批次大小（Batch Size）或其他维度。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fissues\u002F16",{"id":173,"question_zh":174,"answer_zh":175,"source_url":176},31058,"将 Keras 模型转换为 ONNX 后，在 Windows ML 中运行输出全为零或输出形状被转置，怎么办？","这通常是由于通道顺序（Channel Order）不匹配或模型转换过程中的元数据问题导致的。虽然使用 keras2onnx 脚本可以改变输入形状，但可能导致输出形状转置或数值异常。建议检查转换后的 ONNX 模型结构，确认是否需要额外的 Transpose 操作来恢复正确的输出布局。此外，不同平台对 NCHW 或 NHWC 的处理方式不同，需确保转换参数与 Windows ML 的预期一致。如果问题持续，可能需要手动调整模型图或在后处理阶段修正输出数据。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fissues\u002F205",{"id":178,"question_zh":179,"answer_zh":180,"source_url":181},31059,"Visual Studio 2019 Community Edition 中使用 mlgen 导入 ONNX 模型不生成 CS 文件，是否支持？","理论上支持，但如果遇到不生成文件的情况，首先应排查项目路径是否包含空格（这是最常见的原因）。其次，确认已正确安装\"Windows Machine Learning Code Generation\"扩展，并且使用的是最新版本的 Windows SDK。如果路径无误且环境配置正确但仍失败，可能是特定版本的 ONNX 模型（如 opset 版本过高）与当前工具链不兼容，建议尝试使用较低版本的 ONNX 模型或更新 WinMLTools。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fissues\u002F253",[183,188,193,198,202,207,212,217,222,227,232,237,242,247,252],{"id":184,"version":185,"summary_zh":186,"released_at":187},223001,"1.0.0.0.190304.ecc2b37","x64 and x86 binaries of WinMLRunner as of ecc2b37.\r\n\r\nNew Features:\r\n- SaveTensorData now takes in a second parameter to allow user to specify path to output tensor data.\r\n- Memory Peak Working Set Usage is printed with \"-perf all\".\r\n- Float16 output tensors can now be processed with max index \u002F value printed to console and all the tensor values can be saved to CSV.\r\n- Concurrency Scenarios have been added!\r\n  - WinMLRunner supports concurrently loading a model. Currently it is only loading a model for concurrency, but expect to see more changes in the future to support multi-threaded bind and evaluate scenarios\r\n  - \"-ConcurrentLoad\" will enable multi threaded options where it creates a thread pool of loading a model\r\n  - \"-NumThreads\" specifies the number of threads in the thread pool for work.\r\n  - \"-ThreadInterval\" specifies the number in milliseconds in between two works to be pushed into work queue.\r\n\r\nBug Fixes:\r\n- Printing out version number with \"-version\" flag now has better error checking\r\n- Removed DXCore functionality\r\n- Better invalid commandline args checking\r\n- More efficient output tensor processing\r\n- No longer able to save tensor output if input isn't specified.\r\n- Added extra checking to \"-debug\" flag which checks if WinMLRunner is under debugger before continuing. This flag got renamed to \"-DebugEvaluate\".\r\n- Populating tensors with arbitrary values no longer use memset. The memory is arbitrary.","2019-03-04T23:56:58",{"id":189,"version":190,"summary_zh":191,"released_at":192},223002,"1.0.0.0.190214.bb51359","This release is x86 version of WinMLRunner as of commit: bb51359ff9cf827a1869893f5487d0b68533f5f5\r\n\r\nSome new changes:\r\n- performance output now separates first iteration performance from the rest of the iteration's performance.\r\n- -perf  flag now takes an optional parameter: \"all\" in which max \u002F min metrics will be displayed in addition to averages. To see max \u002F min metrics, run winmlrunner with iterations >=2 and -perf all\r\n- -version flag prints the version information for this build of WinMLRunner.exe. For example:\r\n```\r\n>WinMLRunner.exe -version\r\nWinMLRunner.exe\r\nVersion: 1.0.0.0.190214.bb51359\r\n```\r\n- Bug Fix: -CreateDeviceOnClient is now mapped to the GPU device that is specified using -GPUHighPerformance -GPUMinPower or -GPU","2019-02-22T00:55:45",{"id":194,"version":195,"summary_zh":196,"released_at":197},223003,"v1.0.0.0.190214.bb51359","This release is x64 version of WinMLRunner as of commit: bb51359ff9cf827a1869893f5487d0b68533f5f5\r\n\r\nSome new changes:\r\n- performance output now separates first iteration performance from the rest of the iteration's performance.\r\n- -perf  flag now takes an optional parameter: \"all\" in which max \u002F min metrics will be displayed in addition to averages. To see max \u002F min metrics, run winmlrunner with iterations >=2 and -perf all\r\n- -version flag prints the version information for this build of WinMLRunner.exe. For example:\r\n```\r\n>WinMLRunner.exe -version\r\nWinMLRunner.exe\r\nVersion: 1.0.0.0.190214.bb51359\r\n```\r\n- Bug Fix: -CreateDeviceOnClient is now mapped to the GPU device that is specified using -GPUHighPerformance -GPUMinPower or -GPU","2019-02-15T01:12:26",{"id":199,"version":200,"summary_zh":76,"released_at":201},223004,"v0.5.1","2019-02-01T22:28:34",{"id":203,"version":204,"summary_zh":205,"released_at":206},223005,"v1.0.0.0","This release is x64 version of WinMLRunner as of commit: b9229dc7eaf58ec555f7c83bc0c3735343e41f79","2019-01-31T00:32:08",{"id":208,"version":209,"summary_zh":210,"released_at":211},222991,"v1.3.0","# 一般\n- 当调用方指定了使用 GPU，但运算符回退到 CPU 时，会发出诊断警告。\n- 新增了 **-logCPUFallback** 命令行参数。该参数会输出关于 CPU 回退原因的额外信息。\n\n# 依赖项\n- DirectML 版本升级至 1.8.2。\n- Microsoft.AI.MachineLearning 版本升级至 1.11。\n- OnnxRuntime 版本升级至 1.11。","2022-06-30T19:11:18",{"id":213,"version":214,"summary_zh":215,"released_at":216},222992,"v1.2.2","此更改移除了 WinMLRunner.exe 在 Windows.AI.MachineLearning.dll 与可执行文件位于同一目录时从本地加载该 DLL 的功能。取而代之，应在相同目录中使用 MicrosoftMLRunner.exe 来加载 Microsoft.AI.MachineLearning.dll。更多详细信息见下文。\n\n## 使用 Microsoft.AI.Machinelearning NuGet 包\nMicrosoftMLRunner.exe 会使用可执行文件所在目录下的 ```Microsoft.AI.MachineLearning.dll```，而不是从 System32 加载 ```Windows.AI.MachineLearning.dll```（后者适用于 WinMLRunner）。MicrosoftMLRunner 有助于将性能与旧版本的 WinML 进行比较，或测试新版本的 WinML NuGet 包。有关更多信息，请参阅 [Microsoft.AI.MachineLearning NuGet 页面](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AI.MachineLearning)。","2020-09-10T00:10:59",{"id":218,"version":219,"summary_zh":220,"released_at":221},222993,"1.2.1.2","修复了 bug：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fissues\u002F324","2020-07-13T23:28:17",{"id":223,"version":224,"summary_zh":225,"released_at":226},222994,"v0.7.0","- 支持转换为 opset10 模型\r\n- 更新了 WinMLRunner","2020-03-03T01:32:46",{"id":228,"version":229,"summary_zh":230,"released_at":231},222995,"1.2.1.1","新特性：\n\n- Tensor [函数]：将输入加载为张量，并可选择性地指定用于输入预处理的函数。\n  - 可选函数参数：\n    - Identity（默认）：不执行任何输入变换。\n    - Normalize \u003Cscale> \u003Cmeans> \u003Cstddevs>：浮点型缩放因子，以及用于归一化的按通道均值和标准差，均以逗号分隔。\n\n- 示例用法：\n  - WinMLRunner.exe -model .\u002Fdensenet121.onnx -Tensor Normalize 255 0.485,0.456,0.406 0.229,0.224,0.225 -CPU -SaveTensorData First -PerIterationPath \\\u003CtensorDataPath\\>","2019-08-29T23:08:04",{"id":233,"version":234,"summary_zh":235,"released_at":236},222996,"1.2.0.2","新功能：\n\n- 现可通过 -inputimagefolder 标志评估图像文件夹。\n示例：\n``` \n.\\WinMLRunner.exe -model .\\SqueezeNet.onnx -inputimagefolder .\\images\\\n``` \n\n- 指标的标准差 now 已写入性能文件中。\n\n\n更新与修复：\n\n- DxCore API 调用已更新至最新版本。","2019-07-18T19:25:02",{"id":238,"version":239,"summary_zh":240,"released_at":241},222997,"v0.6.1","## 新功能：\n- 模型调试支持\n  - 现在，当您通过 WinMLDashboard 运行模型时，可以捕获并可视化数据在模型中的流动过程中的中间数据。\n  - 更多信息请参阅：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FWindows-Machine-Learning\u002Fblob\u002Fmaster\u002FTools\u002FWinMLDashboard\u002FREADME.md\n- 其他多项界面改进\n\n## 错误修复\n- 安全性修复","2019-05-07T22:36:05",{"id":243,"version":244,"summary_zh":245,"released_at":246},222998,"1.2.0.1","新变更：\n\n使用 DxCore 路径延迟加载 DXGI 和 D3d11.dll","2019-04-30T21:28:11",{"id":248,"version":249,"summary_zh":250,"released_at":251},222999,"1.2","新功能！\n\n- 支持 DxCore 选择计算设备。使用方法如下：\n  - -GPUAdapterName \u003C适配器名称子字符串>：在指定名称的 GPU 上运行模型。注意：请仅在支持 DxCore 的机器上使用此标志。\n- 现在支持以图像标注作为输入的模型。\n- 张量现在可以绑定到 GPU 内存。\n- 可通过 AddPerformanceFileMetadata(const std::string& key, const std::string& value) 添加性能文件元数据。此功能仅在将 WinMLRunner 作为静态库使用时才公开。\n\n错误修复：\n- 最大迭代次数现已提升至 1024 次。\n- 输出性能文件时，指定期望目标路径的方式更加稳健。\n  - -BaseOutputPath [\\\u003C完全限定路径\\>]：结果的基本输出目录路径，默认为当前工作目录。","2019-04-25T21:53:00",{"id":253,"version":254,"summary_zh":255,"released_at":256},223000,"v1.0.1.0","## 新特性：\n- 新增了一个新标志：\n``` -TopK \u003Cnumber>：在结果中打印前 \u003Cnumber> 个值。默认为 1```\n- 支持通过 PIX 进行程序化捕获！\n  - PIX 是一款用于捕获 Direct3D 12 GPU 工作的工具。在此新版本中，如果 WinMLRunner 是在 PIX 的环境下启动的，它将自动捕获 PIX 跟踪信息。\n    - 第 1 帧：将包含会话创建和第一次迭代绑定、第一次迭代评估的 PIX 捕获。\n    - 第 N 帧：将包含第 N 次迭代绑定和第 N 次迭代评估的 PIX 捕获。\n  - 关于 PIX 的更多信息，请参阅[此处](https:\u002F\u002Fdevblogs.microsoft.com\u002Fpix\u002Fgpu-captures\u002F)。\n- 现在支持 .jpeg 格式的输入文件。\n\n## 错误修复\n- 如果指定了多个计算设备，即使模型在一个设备上运行失败，WinMLRunner 仍将继续在其余设备上运行。\n- 如果输入文件的扩展名不受支持，则会输出错误消息。","2019-03-21T22:22:06"]