[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-xwying--torchshow":3,"tool-xwying--torchshow":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":81,"owner_website":82,"owner_url":83,"languages":84,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":93,"env_os":94,"env_gpu":95,"env_ram":95,"env_deps":96,"category_tags":103,"github_topics":104,"view_count":23,"oss_zip_url":81,"oss_zip_packed_at":81,"status":16,"created_at":110,"updated_at":111,"faqs":112,"releases":148},3210,"xwying\u002Ftorchshow","torchshow","Visualize PyTorch tensors with a single line of code.","torchshow 是一款专为 PyTorch 开发者设计的可视化工具，旨在通过一行代码即可直观展示张量数据。在计算机视觉项目的调试过程中，研究人员往往需要花费大量精力将张量转换为 NumPy 数组、调整维度形状，并手动处理数据的归一化与反归一化，才能正确显示图像。torchshow 完美解决了这一痛点，它能够自动推断张量类型（如 RGB 图像、灰度图、二值掩膜、语义分割标签及光流等），并智能执行必要的反归一化操作，让数据即刻以正确的形态呈现。\n\n该工具特别适合从事深度学习、尤其是计算机视觉领域的算法工程师和科研人员使用。无论是检查模型输入输出、验证数据增强效果，还是分析特征图激活情况，torchshow 都能显著提升调试效率。其核心技术亮点在于强大的自动感知能力：无需用户预先指定数据类型或编写繁琐的预处理代码，它不仅能处理单张图片，还支持批量图像、视频序列以及复杂的光流场可视化。此外，针对无图形界面的服务器环境，torchshow 还提供了直接保存结果的功能。只需简单导入并调用，即可让原本枯燥的张量数据变得清晰易懂，是 PyTorch 工作流中不可或缺的得力助手。","\u003Cdiv align=\"center\">\n\n![TorchShow Logo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_0a80cbfbf868.png)\n\n[![PyPI version](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ftorchshow.svg)](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ftorchshow)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_496115531268.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Ftorchshow)\n![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fxwying\u002Ftorchshow?color=brightgreen)\n\n\u003C\u002Fdiv>\n\n----\n\nTorchshow visualizes your data in one line of code. It is designed to help debugging Computer Vision project.\n\nTorchshow automatically infers the type of a tensor such as RGB images, grayscale images, binary masks, categorical masks (automatically apply color palette), etc. and perform necessary unnormalization if needed. \n\n**Supported Type:**\n\n- [x] RGB Images\n- [x] Grayscale Images\n- [x] Binary Mask\n- [x] Categorical Mask (Integer Labels)\n- [x] Multiple Images\n- [x] Videos\n- [x] Multiple Videos\n- [x] Optical Flows (powered by [flow_vis](https:\u002F\u002Fgithub.com\u002Ftomrunia\u002FOpticalFlow_Visualization))\n\n\n\n## What's New in v0.5.2\n- Fixed the version comparison bugs in `set_window_title` function ([#24](https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F24)).\n- Support more data dtype for pytorch tensors.\n\nSee the complete [changelogs](changelogs.md).\n\n\n## Installation\nInstall from [PyPI](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftorchshow\u002F):\n\n```bash\npip install torchshow\n```\n\nAlternatively, you can install directly from this repo to test the latest features.\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow.git@master\n```\n\n\n## Basic Usage\n\nThe usage of TorchShow is extremely simple. Simply import the package and visualize your data in one line:\n\n```python\nimport torchshow as ts\nts.show(tensor)\n```\n\nIf you work on a headless server without display. You can use `ts.save(tensor)` command (since version 0.3.2).\n\n```python\nimport torchshow as ts\nts.save(tensor) # Figure will be saved under .\u002F_torchshow\u002F***.png\nts.save(tensor, '.\u002Fvis\u002Ftest.jpg') # You can specify the save path.\n```\n\n## API References\n\nPlease check [this page](.\u002FAPI.md) for detailed API references.\n\n\n## Examples\n\n### Table of Contents\n- [Visualizing Image Tensor](#1-visualizing-image-tensor)\n- [Visualizing Mask Tensors](#2-visualizing-mask-tensors)\n- [Visualizing Batch of Tensors](#3-visualizing-batch-of-tensors)\n- [Visualizing Channels in Feature Maps](#4-visualizing-feature-maps)\n- [Visualizing Multiple Tensors with Custom Layout.](#5-visualizing-multiple-tensors-with-custom-layout)\n- [Examine the pixel with rich information.](#6-examine-the-pixel-with-richer-information)\n- [Visualizing Tensors as Video Clip](#7-visualizing-tensors-as-video-clip)\n- [Display Video Animation in Jupyter Notebook](#8-display-video-animation-in-jupyter-notebook)\n- [Visualizing Optical Flows](#9-visualizing-optical-flows)\n- [Change Channel Order (RGB\u002FBGR)](#10-change-channel-order-rgbbgr)\n- [Change Unnormalization Presets](#11-change-unnormalization-presets)\n- [Overlay Visualizations](#12-overlay-visualizations)\n\n### 1. Visualizing Image Tensor\nVisualizing an image-like tensor is not difficult but could be very cumbersome. You usually need to convert the tensor to numpy array with proper shapes. In many cases images were normalized during dataloader, which means that you have to unnormalize it so it can be displayed correctly.\n\nIf you need to frequently verify what your tensors look like, TorchShow is a very helpful tool. \n\nUsing Matplotlib             |  Using TorchShow\n:-------------------------:|:-------------------------:\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_f3c1e4e9fa85.gif)  |  ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_514e880875ec.gif)\n|The image tensor has been normalized so Matplotlib cannot display it correctly. | TorchShow does the conversion automatically.|\n\n### 2. Visualizing Mask Tensors\nFor projects related to Semantic Segmentation or Instance Segmentation, we often need to visualize mask tensors -- either ground truth annotations or model's prediction. This can be easily done using TorchShow.\n\nUsing Matplotlib             |  Using TorchShow\n:-------------------------:|:-------------------------:\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_91db02f42cb2.gif)  |  ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_8ce3f4a03e4a.gif)\n| Different instances have same colors. Some categories are missing. | TorchShow automatically apply color palletes during visualization.|\n\n### 3. Visualizing Batch of Tensors\nWhen the tensor is a batch of images, TorchShow will automatically create grid layout to visualize them. It is also possible to manually control the number of rows and columns.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_7dd8076bf33f.gif)\n\n### 4. Visualizing Feature Maps\nIf the input tensor has more than 3 channels, TorchShow will visualize each of the channel similar to batch visualization. This is useful to visualize a feature map.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_20b6dd3aa1af.gif)\n\n### 5. Visualizing Multiple Tensors with Custom Layout.\nTorchShow has more flexibility to visualize multiple tensor using a custom layout.\n\nTo control the layout, put the tensors in list of list as an 2D array. The following example will create a 2 x 3 grid layout.\n\n```\nts.show([[tensor1, tensor2, tensor3],\n         [tensor4, tensor5, tensor6]])\n```\n\nIt is worth mentioning that there is no need to fill up all the places in the grid. The following example visualizes 5 tensors in a 2 x 3 grid layout.\n\n```\nts.show([[tensor1, tensor2],\n         [tensor3, tensor4, tensor5]])\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_2c76510a94ed.gif)\n\n\n### 6. Examine the pixel with richer information.\nSince `v0.4.1`, TorchShow allows you to get richer information from a pixel you are interested by simply hovering your mouse over that pixel. This is very helpful for some types of tensors such as Categorical Mask and Optical Flows. \n\nCurrently, Torchshow displays the following information: \n\n- `Mode`: Visualization Mode.\n- `Shape`: Shape of the tensor.\n- `X`, `Y`: The pixel location of the mouse cursor.\n- `Raw`: The raw tensor value at (X, Y).\n- `Disp`: The display value at (X, Y).\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_45338d1add13.gif)\n\n**Note: if the information is not showing on the status bar, try to resize the window and make it wider.**\n\nThis feature can be turned off by `ts.show_rich_info(False)`.\n\n\n### 7. Visualizing Tensors as Video Clip\nTensors can be visualized as video clips, which very helpful if the tensor is a sequence of frames. This can be done using `show_video` function.\n\n```python\nts.show_video(video_tensor)\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_85dd003999b9.gif)\n\nIt is also possible to visualize multiple videos in a custom grid layout.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_cbc452a730cb.gif)\n\n### 8. Display Video Animation in Jupyter Notebook\nTorchShow visualizes video clips as an `matplotlib.func_animation` object and may not display in a notebook by default. The following example shows a simple trick to display it.\n\n```python\nimport torchshow as ts\nfrom IPython.display import HTML\n\nani = ts.show_video(video_tensor)\nHTML(ani.to_jshtml())\n```\n\n### 9. Visualizing Optical Flows\nTorchShow support visualizing optical flow (powered by [flow_vis](https:\u002F\u002Fgithub.com\u002Ftomrunia\u002FOpticalFlow_Visualization)). Below is a demostration using a VSCode debugger remotely attached to a SSH server (with X-server configured). Running in a Jupyter Notebook is also supported.\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_e1827f36d292.gif)\n\n### 10. Change Channel Order (RGB\u002FBGR)\nBy default tensorflow visualize image tensor in the RGB mode, you can switch the setting to BGR in case you are using opencv to load the image.\n```python\nts.set_color_mode('bgr')\n```\n\n### 11. Change Unnormalization Presets\nThe image tensor may have been preprocessed with a normalization function. If not specified, torchshow will automatically rescale it to 0-1. \n\n\nTo change the preset to imagenet normalization. Use the following code.\n```python\nts.show(tensor, unnormalize='imagenet')\n```\n\nTo use a customize mean and std value, use the following command. \n```python\nts.set_image_mean([0., 0., 0.])\nts.set_image_std([1., 1., 1.])\n```\nNote that once this is set, torchshow will use this value for the following visualization. This is useful because usually only a single normalization preset will be used for the entire project.\n\n\n### 12. Overlay Visualizations\nIn Computer Vision project there are many times we will be dealing with different representations of the scene, including but not limited to RGB image, depth image, infrared image, semantic mask, instance mask, etc. Sometimes it will be very helpful to overlay these different data for visualization. Since `v0.5.0`, TorchShow provides a very useful API `ts.overlay()` for this purpose.\n\nIn the below example we have an RGB image and its corresponding semantic mask. Let's first check what they look like using TorchShow.\n\n```python\nimport torchshow as ts\nts.show([\"example_rgb.jpg\", \"example_category_mask.png\"])\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_db93b24705fa.png)\n\nNow I would like to overlay the mask on top of the RGB image to gain more insights, with TorchShow this can be easily done with one line of code.\n\n```python\nimport torchshow as ts\nts.overlay([\"example_rgb.jpg\", \"example_category_mask.png\"], alpha=[1, 0.6])\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_ae8f06b81754.png)\n","\u003Cdiv align=\"center\">\n\n![TorchShow Logo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_0a80cbfbf868.png)\n\n[![PyPI version](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ftorchshow.svg)](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ftorchshow)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_496115531268.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Ftorchshow)\n![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fxwying\u002Ftorchshow?color=brightgreen)\n\n\u003C\u002Fdiv>\n\n----\n\nTorchshow 只需一行代码即可可视化你的数据。它专为帮助调试计算机视觉项目而设计。\n\nTorchshow 会自动推断张量的类型，例如 RGB 图像、灰度图像、二值掩码、分类掩码（自动应用调色板）等，并在必要时执行去归一化操作。\n\n**支持的类型：**\n\n- [x] RGB 图像\n- [x] 灰度图像\n- [x] 二值掩码\n- [x] 分类掩码（整数标签）\n- [x] 多张图像\n- [x] 视频\n- [x] 多段视频\n- [x] 光流（由 [flow_vis](https:\u002F\u002Fgithub.com\u002Ftomrunia\u002FOpticalFlow_Visualization) 提供支持）\n\n\n\n## v0.5.2 新特性\n- 修复了 `set_window_title` 函数中的版本比较错误（[#24](https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F24)）。\n- 支持更多 PyTorch 张量的数据类型。\n\n完整变更日志请参见 [changelogs.md](changelogs.md)。\n\n\n## 安装\n从 [PyPI](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftorchshow\u002F) 安装：\n\n```bash\npip install torchshow\n```\n\n或者，你也可以直接从本仓库安装以体验最新功能：\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow.git@master\n```\n\n\n## 基本用法\n\nTorchShow 的使用非常简单。只需导入该包，然后用一行代码即可可视化你的数据：\n\n```python\nimport torchshow as ts\nts.show(tensor)\n```\n\n如果你在没有显示设备的无头服务器上工作，可以使用 `ts.save(tensor)` 命令（自 0.3.2 版起）。\n\n```python\nimport torchshow as ts\nts.save(tensor) # 图像将保存到 .\u002F_torchshow\u002F***.png\nts.save(tensor, '.\u002Fvis\u002Ftest.jpg') # 你可以指定保存路径。\n```\n\n## API 参考\n\n详细的 API 参考请查看 [API.md](.\u002FAPI.md) 页面。\n\n\n## 示例\n\n### 目录\n- [可视化图像张量](#1-visualizing-image-tensor)\n- [可视化掩码张量](#2-visualizing-mask-tensors)\n- [可视化张量批次](#3-visualizing-batch-of-tensors)\n- [可视化特征图中的通道](#4-visualizing-feature-maps)\n- [使用自定义布局可视化多个张量](#5-visualizing-multiple-tensors-with-custom-layout)\n- [查看包含丰富信息的像素](#6-examine-the-pixel-with-richer-information)\n- [将张量可视化为视频片段](#7-visualizing-tensors-as-video-clip)\n- [在 Jupyter Notebook 中显示视频动画](#8-display-video-animation-in-jupyter-notebook)\n- [可视化光流](#9-visualizing-optical-flows)\n- [更改通道顺序（RGB\u002FBGR）](#10-change-channel-order-rgbbgr)\n- [更改去归一化预设](#11-change-unnormalization-presets)\n- [叠加可视化效果](#12-overlay-visualizations)\n\n### 1. 可视化图像张量\n可视化类似图像的张量并不难，但可能会非常繁琐。通常你需要将张量转换为具有正确形状的 NumPy 数组。在许多情况下，图像在数据加载器中已经被归一化，这意味着你需要先将其去归一化才能正确显示。\n\n如果你需要频繁检查张量的样子，TorchShow 是一个非常有用的工具。\n\n使用 Matplotlib             |  使用 TorchShow\n:-------------------------:|:-------------------------:\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_f3c1e4e9fa85.gif)  |  ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_514e880875ec.gif)\n|图像张量已被归一化，因此 Matplotlib 无法正确显示。 | TorchShow 会自动完成转换。|\n\n### 2. 可视化掩码张量\n对于语义分割或实例分割相关的项目，我们经常需要可视化掩码张量——无论是真实标注还是模型预测结果。这可以轻松地通过 TorchShow 实现。\n\n使用 Matplotlib             |  使用 TorchShow\n:-------------------------:|:-------------------------:\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_91db02f42cb2.gif)  |  ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_8ce3f4a03e4a.gif)\n|不同实例的颜色相同，部分类别缺失。 | TorchShow 在可视化过程中会自动应用调色板。|\n\n### 3. 可视化张量批次\n当张量是一批图像时，TorchShow 会自动创建网格布局来可视化它们。你也可以手动控制行数和列数。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_7dd8076bf33f.gif)\n\n### 4. 可视化特征图\n如果输入张量的通道数超过 3 个，TorchShow 会像处理张量批次一样分别可视化每个通道。这对于可视化特征图非常有用。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_20b6dd3aa1af.gif)\n\n### 5. 使用自定义布局可视化多个张量\nTorchShow 在使用自定义布局可视化多个张量方面更加灵活。\n\n要控制布局，只需将张量放入二维列表中。以下示例将创建一个 2×3 的网格布局：\n\n```\nts.show([[tensor1, tensor2, tensor3],\n         [tensor4, tensor5, tensor6]])\n```\n\n值得注意的是，网格中不需要填满所有位置。以下示例在一个 2×3 的网格布局中可视化了 5 个张量：\n\n```\nts.show([[tensor1, tensor2],\n         [tensor3, tensor4, tensor5]])\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_2c76510a94ed.gif)\n\n\n### 6. 查看包含丰富信息的像素\n自 `v0.4.1` 起，TorchShow 允许你通过将鼠标悬停在感兴趣的像素上来获取更丰富的信息。这对于某些类型的张量，如分类掩码和光流，非常有帮助。\n\n目前，Torchshow 会显示以下信息：\n\n- `Mode`: 可视化模式。\n- `Shape`: 张量的形状。\n- `X`, `Y`: 鼠标光标的像素位置。\n- `Raw`: (X, Y) 处的原始张量值。\n- `Disp`: (X, Y) 处的显示值。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_45338d1add13.gif)\n\n**注意：如果状态栏未显示相关信息，请尝试调整窗口大小，使其更宽一些。**\n\n可以通过 `ts.show_rich_info(False)` 关闭此功能。\n\n\n### 7. 将张量可视化为视频片段\n张量可以被可视化为视频片段，这对于序列帧张量非常有用。这可以通过 `show_video` 函数实现。\n\n```python\nts.show_video(video_tensor)\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_85dd003999b9.gif)\n\n你还可以使用自定义网格布局来可视化多段视频。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_cbc452a730cb.gif)\n\n### 8. 在 Jupyter Notebook 中显示视频动画\nTorchShow 将视频片段可视化为 `matplotlib.func_animation` 对象，默认情况下可能无法在笔记本中显示。以下示例展示了一个简单的技巧来显示它。\n\n```python\nimport torchshow as ts\nfrom IPython.display import HTML\n\nani = ts.show_video(video_tensor)\nHTML(ani.to_jshtml())\n```\n\n### 9. 可视化光流\nTorchShow 支持可视化光流（由 [flow_vis](https:\u002F\u002Fgithub.com\u002Ftomrunia\u002FOpticalFlow_Visualization) 提供支持）。以下是使用远程连接到 SSH 服务器（已配置 X-server）的 VSCode 调试器进行演示的示例。同时，也支持在 Jupyter Notebook 中运行。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_e1827f36d292.gif)\n\n### 10. 更改通道顺序（RGB\u002FBGR）\n默认情况下，TensorFlow 会以 RGB 模式可视化图像张量。如果您使用 OpenCV 加载图像，可以将设置切换为 BGR。\n```python\nts.set_color_mode('bgr')\n```\n\n### 11. 更改反归一化预设\n图像张量可能已经过归一化处理。如果未指定，torchshow 会自动将其重新缩放到 0-1 的范围。\n\n\n要将预设更改为 ImageNet 归一化，可以使用以下代码：\n```python\nts.show(tensor, unnormalize='imagenet')\n```\n\n如果需要使用自定义的均值和标准差，可以使用以下命令：\n```python\nts.set_image_mean([0., 0., 0.])\nts.set_image_std([1., 1., 1.])\n```\n请注意，一旦设置完成，torchshow 将在后续的可视化中使用这些值。这非常有用，因为通常整个项目只会使用一种归一化预设。\n\n### 12. 叠加可视化\n在计算机视觉项目中，我们经常会处理场景的不同表示形式，包括但不限于 RGB 图像、深度图、红外图像、语义分割掩码、实例分割掩码等。有时，为了更好地理解数据，将这些不同的数据叠加在一起进行可视化会非常有帮助。自 `v0.5.0` 版本起，TorchShow 提供了一个非常实用的 API `ts.overlay()` 来实现这一功能。\n\n在下面的例子中，我们有一张 RGB 图像及其对应的语义分割掩码。首先让我们使用 TorchShow 分别查看它们的外观。\n\n```python\nimport torchshow as ts\nts.show([\"example_rgb.jpg\", \"example_category_mask.png\"])\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_db93b24705fa.png)\n\n现在，我想将掩码叠加到 RGB 图像之上，以便获得更深入的洞察。使用 TorchShow，只需一行代码即可轻松完成。\n```python\nimport torchshow as ts\nts.overlay([\"example_rgb.jpg\", \"example_category_mask.png\"], alpha=[1, 0.6])\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_readme_ae8f06b81754.png)","# TorchShow 快速上手指南\n\nTorchShow 是一个专为计算机视觉项目设计的调试工具，只需一行代码即可自动识别并可视化 PyTorch 张量（如 RGB 图像、灰度图、掩码、光流等），自动处理反归一化和颜色映射。\n\n## 环境准备\n\n- **操作系统**：Linux, macOS, Windows\n- **Python 版本**：建议 Python 3.6+\n- **核心依赖**：\n  - `torch` (PyTorch)\n  - `matplotlib`\n  - `numpy`\n- **显示环境**：\n  - 本地开发：需具备图形界面显示能力。\n  - 无头服务器（Headless Server）：支持直接保存为图片文件，无需显示器。\n\n## 安装步骤\n\n推荐使用 pip 从 PyPI 安装稳定版：\n\n```bash\npip install torchshow\n```\n\n如需体验最新功能，可直接从 GitHub 安装：\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow.git@master\n```\n\n> **提示**：国内用户若下载缓慢，可添加国内镜像源加速安装，例如：\n> ```bash\n> pip install torchshow -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 基本使用\n\n### 1. 快速可视化张量\n\n导入库后，调用 `ts.show()` 即可自动识别张量类型并显示：\n\n```python\nimport torchshow as ts\nts.show(tensor)\n```\n\nTorchShow 会自动判断张量是 RGB 图像、灰度图、二值掩码还是类别掩码，并执行必要的反归一化操作。\n\n### 2. 在无头服务器上保存结果\n\n如果在没有显示器的服务器上使用，可以使用 `ts.save()` 将可视化结果保存为图片：\n\n```python\nimport torchshow as ts\nts.save(tensor) # 默认保存至 .\u002F_torchshow\u002F***.png\nts.save(tensor, '.\u002Fvis\u002Ftest.jpg') # 指定保存路径\n```","某计算机视觉算法工程师正在调试一个语义分割模型，需要频繁检查 DataLoader 输出的归一化图像张量与对应的整数标签掩码（Mask）是否正确对齐。\n\n### 没有 torchshow 时\n- **手动反归一化繁琐**：每次查看图像前，必须手写代码将张量从 [-1, 1] 或 [0, 1] 还原到 [0, 255] 范围，否则 Matplotlib 显示的图像是一片黑或颜色失真。\n- **掩码可视化困难**：整数类型的类别掩码直接显示为灰度图，难以区分不同类别，需额外编写代码映射颜色查找表（Color Palette）。\n- **维度转换易出错**：需反复在 (C, H, W) 和 (H, W, C) 之间转换张量维度，并处理 numpy 类型转换，极易因形状不匹配报错。\n- **调试效率低下**：为了看一眼中间结果，往往需要编写十几行样板代码，严重打断建模思路。\n\n### 使用 torchshow 后\n- **智能自动还原**：只需调用 `ts.show(image_tensor)`，torchshow 自动识别归一化参数并还原色彩，立即呈现真实图像效果。\n- **掩码自动着色**：针对整数标签掩码，torchshow 自动应用分类调色板，将不同语义区域渲染为鲜明颜色，无需任何额外配置。\n- **零维度顾虑**：直接支持 PyTorch 原生的 (C, H, W) 格式输入，自动处理通道顺序与数据类型转换，彻底告别维度错误。\n- **单行即时反馈**：无论检查单张图像、批量数据还是视频流，仅需一行代码即可弹出可视化窗口，让调试过程如流水般顺畅。\n\ntorchshow 通过将复杂的张量预处理逻辑封装为一行代码，让开发者能专注于模型逻辑本身，极大提升了计算机视觉项目的调试效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fxwying_torchshow_0a80cbfb.png","xwying","Xiaowen(Shawn) Ying","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fxwying_c3745c99.png","PhD Student","Lehigh University","Bethlehem, PA",null,"xiaowenying.com","https:\u002F\u002Fgithub.com\u002Fxwying",[85],{"name":86,"color":87,"percentage":88},"Python","#3572A5",100,707,16,"2026-03-26T17:27:24","MIT",1,"Linux, macOS, Windows","未说明",{"notes":97,"python":95,"dependencies":98},"该工具主要用于调试计算机视觉项目，自动推断张量类型（如 RGB 图像、掩码等）并执行必要的反归一化。在无显示器的服务器（headless server）上运行时，需使用 ts.save() 将结果保存为图片而非直接显示。可视化光流功能依赖 flow_vis 库。若在 Jupyter Notebook 中播放视频动画，需配合 IPython.display.HTML 使用。",[99,100,101,102],"torch","matplotlib","numpy","flow_vis",[14,13],[105,106,107,108,109],"visualization","tensor","image-tensor","notebook","pytorch","2026-03-27T02:49:30.150509","2026-04-06T07:13:01.512568",[113,118,123,128,133,138,143],{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},14793,"如何设置显示图像的大小（figsize）和分辨率（dpi）？","可以通过在 `ts.show()` 函数中直接传递 `figsize` 和 `dpi` 参数来实现。例如：`ts.show(x, figsize=(10,10), dpi=300)`。如果当前版本不支持，可以安装主分支版本：`pip install git+https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow.git@master`。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F1",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},14794,"如何在可视化特征图时使用特定的颜色映射（如 'jet'）？","TorchShow 支持通过 `cmap` 参数指定颜色映射，该参数接受 matplotlib 支持的所有 colormap。例如，要使用类似 OpenCV 的 JET 配色，可以使用：`ts.show(tensor, cmap='jet')`。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F18",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},14795,"保存二值掩码（Binary Mask）时遇到报错怎么办？","当通道数小于等于 3 时，TorchShow 会尝试将其作为单张图像渲染，而布尔类型的张量可能导致 matplotlib 报错。解决方案是将张量转换为列表形式进行保存。例如：`ts.save(list(a > 0))`，其中 `a` 是形状为 (3, H, W) 的张量。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F7",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},14796,"如何在循环中保存图片时避免“打开过多 figure”的内存警告？","该警告通常出现在旧版本中。建议升级到最新版本的 torchshow 以解决此问题。运行命令：`pip install --upgrade torchshow` 或从源码安装最新版。新版本已优化了 figure 的关闭逻辑。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F6",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},14797,"导入库时出现 'Key error - axes.titlecolor' 错误如何解决？","这是一个已知问题，已在最新的 commit 中通过移除不必要的代码行修复。你可以暂时从主分支安装来解决问题：`pip install git+https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow.git@master`。该修复也将包含在下一个正式发布版本中。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F22",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},14798,"如何以网格布局展示视频帧或批量张量，并为每帧添加标题？","视频本质上是一系列图像列表，TorchShow 原生支持批量张量的网格展示。此外，可以使用 `axes_title` 参数为每个子图添加标题（例如帧序号）。参考文档中的“可视化批量张量”部分，并查阅 API 文档了解 `axes_title` 的具体用法。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F15",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},14799,"如何获取绘图对象列表（plot_list）而不直接显示图像？","在 v0.4.2 及以上版本中，可以通过设置 `display=False` 参数来获取绘图对象列表而不是直接渲染。调用方式为：`plot_list = ts.show(tensor, display=False)`。这允许用户对生成的 matplotlib 对象进行进一步自定义。","https:\u002F\u002Fgithub.com\u002Fxwying\u002Ftorchshow\u002Fissues\u002F2",[]]