[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-alankbi--detecto":3,"tool-alankbi--detecto":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":75,"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":94,"env_ram":94,"env_deps":95,"category_tags":102,"github_topics":103,"view_count":10,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":110,"updated_at":111,"faqs":112,"releases":133},445,"alankbi\u002Fdetecto","detecto","Build fully-functioning computer vision models with PyTorch","Detecto 是一个基于 PyTorch 构建的 Python 库，旨在帮助用户以极低的代码量构建功能完备的计算机视觉和目标检测模型。它最大的亮点在于“极简主义”，仅需 5 行代码即可完成从模型加载到推理的全过程。\n\n对于许多开发者而言，搭建目标检测模型往往面临门槛高、配置繁琐的问题，Detecto 正是为了解决这一痛点而生。它不仅支持对静态图片和视频进行推理，还允许用户在自定义数据集上轻松进行迁移学习，无需深厚的深度学习背景即可快速上手。\n\nDetecto 特别适合想要快速实现视觉识别功能的开发者、计算机视觉初学者以及需要验证原型的技术人员。它底层封装了 Faster R-CNN ResNet-50 FPN 等成熟算法，并提供了丰富的可视化工具，能够直接生成标注后的图像或视频。此外，由于直接基于 PyTorch 开发，用户在需要更高级功能时，也能无缝对接 PyTorch 生态，在易用性与灵活性之间取得了良好的平衡。","![Detecto Logo](assets\u002Flogo_words.svg)\n--------------------------------------\n    \n[![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_13d664e1afd7.png)](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_ebb6f3e68407.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdetecto)\n\nDetecto is a Python package that allows you to build fully-functioning computer vision and object detection models with just 5 lines of code. \nInference on still images and videos, transfer learning on custom datasets, and serialization of models to files are just a few of Detecto's features. \nDetecto is also built on top of PyTorch, allowing an easy transfer of models between the two libraries.\n\nThe table below shows a few examples of Detecto's performance:   \n\nStill Image                                                                   |  Video\n:----------------------------------------------------------------------------:|:-----------------------------------------:\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_6a46b902404b.png\" alt=\"Detecto still image\" width=\"500px\"> | ![Video demo of Detecto](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_944072a530df.gif)\n\n# Installation\n\nTo install Detecto using pip, run the following command:\n\n`pip3 install detecto`\n\nInstalling with pip should download all of Detecto's dependencies automatically. \nHowever, if an issue arises, you can manually download the dependencies listed in the [requirements.txt](requirements.txt) file.\n\n# Usage\n\nThe power of Detecto comes from its simplicity and ease of use. Creating and running a pre-trained \n[Faster R-CNN ResNet-50 FPN](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftorchvision\u002Fmodels.html#object-detection-instance-segmentation-and-person-keypoint-detection) \nfrom PyTorch's model zoo takes 4 lines of code:\n\n```python\nfrom detecto.core import Model\nfrom detecto.visualize import detect_video\n\nmodel = Model()  # Initialize a pre-trained model\ndetect_video(model, 'input_video.mp4', 'output.avi')  # Run inference on a video\n```\n\nBelow are several more examples of things you can do with Detecto:\n\n### Transfer Learning on Custom Datasets\n\nMost of the times, you want a computer vision model that can detect custom objects. With Detecto, you can train a model on a custom dataset with 5 lines of code: \n\n```python\nfrom detecto.core import Model, Dataset\n\ndataset = Dataset('custom_dataset\u002F')  # Load images and label data from the custom_dataset\u002F folder\n\nmodel = Model(['dog', 'cat', 'rabbit'])  # Train to predict dogs, cats, and rabbits\nmodel.fit(dataset)\n\nmodel.predict(...)  # Start using your trained model!\n```\n\n### Inference and Visualization\n\nWhen using a model for inference, Detecto returns predictions in an easy-to-use format and provides several visualization tools:\n\n```python\n\nfrom detecto.core import Model\nfrom detecto import utils, visualize\n\nmodel = Model()\n\nimage = utils.read_image('image.jpg')  # Helper function to read in images\n\nlabels, boxes, scores = model.predict(image)  # Get all predictions on an image\npredictions = model.predict_top(image)  # Same as above, but returns only the top predictions\n\nprint(labels, boxes, scores)\nprint(predictions)\n\nvisualize.show_labeled_image(image, boxes, labels)  # Plot predictions on a single image\n\nimages = [...]\nvisualize.plot_prediction_grid(model, images)  # Plot predictions on a list of images\n\nvisualize.detect_video(model, 'input_video.mp4', 'output.avi')  # Run inference on a video\nvisualize.detect_live(model)  # Run inference on a live webcam\n```\n\n### Advanced Usage\n\nIf you want more control over how you train your model, Detecto lets you do just that:\n\n```python\n\nfrom detecto import core, utils\nfrom torchvision import transforms\nimport matplotlib.pyplot as plt\n\n# Convert XML files to CSV format\nutils.xml_to_csv('training_labels\u002F', 'train_labels.csv')\nutils.xml_to_csv('validation_labels\u002F', 'val_labels.csv')\n\n# Define custom transforms to apply to your dataset\ncustom_transforms = transforms.Compose([\n    transforms.ToPILImage(),\n    transforms.Resize(800),\n    transforms.ColorJitter(saturation=0.3),\n    transforms.ToTensor(),\n    utils.normalize_transform(),\n])\n\n# Pass in a CSV file instead of XML files for faster Dataset initialization speeds\ndataset = core.Dataset('train_labels.csv', 'images\u002F', transform=custom_transforms)\nval_dataset = core.Dataset('val_labels.csv', 'val_images')  # Validation dataset for training\n\n# Create your own DataLoader with custom options\nloader = core.DataLoader(dataset, batch_size=2, shuffle=True) \n\n# Use MobileNet instead of the default ResNet\nmodel = core.Model(['car', 'truck', 'boat', 'plane'], model_name='fasterrcnn_mobilenet_v3_large_fpn')\nlosses = model.fit(loader, val_dataset, epochs=15, learning_rate=0.001, verbose=True)\n\nplt.plot(losses)  # Visualize loss throughout training\nplt.show()\n\nmodel.save('model_weights.pth')  # Save model to a file\n\n# Directly access underlying torchvision model for even more control\ntorch_model = model.get_internal_model()\nprint(type(torch_model))\n```\n\nFor more examples, visit the [docs](https:\u002F\u002Fdetecto.readthedocs.io\u002F), which includes a [quickstart](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fusage\u002Fquickstart.html) tutorial.\n\nAlternatively, check out the [demo on Colab](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ISaTV5F-7b4i2QqtjTa7ToDPQ2k8qEe0).  \n\n# API Documentation\n\nThe full API documentation can be found at [detecto.readthedocs.io](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Findex.html).\nThe docs are split into three sections, each corresponding to one of Detecto's modules:\n\n### Core\n\nThe [detecto.core](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fcore.html) module contains the central classes of the package: Dataset, DataLoader, and Model. \nThese are used to read in a labeled dataset and train a functioning object detection model.\n\n### Utils\n\nThe [detecto.utils](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Futils.html) module contains a variety of useful helper functions. \nWith it, you can read in images, convert XML files into CSV files, apply standard transforms to images, and more.\n\n### Visualize\n\nThe [detecto.visualize](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fvisualize.html) module is used to display labeled images, plot predictions, and run object detection on videos.\n\n\n\n# Contributing\n\nAll issues and pull requests are welcome! To run the code locally, first fork the repository and then run the following commands on your computer: \n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002F\u003Cyour-username>\u002Fdetecto.git\ncd detecto\n# Recommended to create a virtual environment before the next step\npip3 install -r requirements.txt\n```\n\nWhen adding code, be sure to write unit tests and docstrings where necessary.  \n\nTests are located in `detecto\u002Ftests` and can be run using pytest:\n\n`python3 -m pytest`\n\nNote that some tests may fail due to them requiring a pretrained model file. \nThis file can be downloaded [here](https:\u002F\u002Fwww.dropbox.com\u002Fs\u002Fkjalrfs3la97du8\u002Fmodel.pth?dl=1)\nand should be placed at `detecto\u002Ftests\u002Fstatic\u002Fmodel.pth`.\n\nTo generate the documentation locally, run the following commands:\n\n```bash\ncd docs\nmake html\n```\n\nThe documentation can then be viewed at `docs\u002F_build\u002Fhtml\u002Findex.html`.\n\n# Contact\n\nDetecto was created by [Alan Bi](https:\u002F\u002Fwww.alanbi.com\u002F). Feel free to reach out on [Twitter](https:\u002F\u002Ftwitter.com\u002Falankbi) or through [email](mailto:alan.bi326@gmail.com)!\n","![Detecto Logo](assets\u002Flogo_words.svg)\n--------------------------------------\n    \n[![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_13d664e1afd7.png)](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_ebb6f3e68407.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdetecto)\n\nDetecto 是一个 Python 包，只需 5 行代码即可构建功能完备的计算机视觉 (Computer Vision) 和目标检测 (Object Detection) 模型。对静态图像和视频进行推理、在自定义数据集上进行迁移学习 (Transfer Learning) 以及将模型序列化到文件，这些只是 Detecto 的部分功能。Detecto 基于 PyTorch 构建，允许在两个库之间轻松迁移模型。\n\n下表展示了 Detecto 性能的几个示例：   \n\n静态图像                                                                   |  视频\n:----------------------------------------------------------------------------:|:-----------------------------------------:\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_6a46b902404b.png\" alt=\"Detecto still image\" width=\"500px\"> | ![Video demo of Detecto](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_readme_944072a530df.gif)\n\n# 安装\n\n要使用 pip 安装 Detecto，请运行以下命令：\n\n`pip3 install detecto`\n\n使用 pip 安装应会自动下载 Detecto 的所有依赖项。但是，如果出现问题，您可以手动下载 [requirements.txt](requirements.txt) 文件中列出的依赖项。\n\n# 用法\n\nDetecto 的强大之处在于其简单性和易用性。从 PyTorch 的模型库创建并运行预训练的 [Faster R-CNN ResNet-50 FPN](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftorchvision\u002Fmodels.html#object-detection-instance-segmentation-and-person-keypoint-detection) 只需 4 行代码：\n\n```python\nfrom detecto.core import Model\nfrom detecto.visualize import detect_video\n\nmodel = Model()  # Initialize a pre-trained model\ndetect_video(model, 'input_video.mp4', 'output.avi')  # Run inference on a video\n```\n\n以下是使用 Detecto 可以完成的更多示例：\n\n### 在自定义数据集上进行迁移学习\n\n大多数情况下，您需要一个能够检测自定义目标的计算机视觉模型。使用 Detecto，您只需 5 行代码即可在自定义数据集上训练模型： \n\n```python\nfrom detecto.core import Model, Dataset\n\ndataset = Dataset('custom_dataset\u002F')  # Load images and label data from the custom_dataset\u002F folder\n\nmodel = Model(['dog', 'cat', 'rabbit'])  # Train to predict dogs, cats, and rabbits\nmodel.fit(dataset)\n\nmodel.predict(...)  # Start using your trained model!\n```\n\n### 推理与可视化\n\n当使用模型进行推理时，Detecto 以易于使用的格式返回预测结果，并提供多种可视化工具：\n\n```python\n\nfrom detecto.core import Model\nfrom detecto import utils, visualize\n\nmodel = Model()\n\nimage = utils.read_image('image.jpg')  # Helper function to read in images\n\nlabels, boxes, scores = model.predict(image)  # Get all predictions on an image\npredictions = model.predict_top(image)  # Same as above, but returns only the top predictions\n\nprint(labels, boxes, scores)\nprint(predictions)\n\nvisualize.show_labeled_image(image, boxes, labels)  # Plot predictions on a single image\n\nimages = [...]\nvisualize.plot_prediction_grid(model, images)  # Plot predictions on a list of images\n\nvisualize.detect_video(model, 'input_video.mp4', 'output.avi')  # Run inference on a video\nvisualize.detect_live(model)  # Run inference on a live webcam\n```\n\n### 高级用法\n\n如果您想更多地控制模型的训练方式，Detecto 也能满足您的需求：\n\n```python\n\nfrom detecto import core, utils\nfrom torchvision import transforms\nimport matplotlib.pyplot as plt\n\n# Convert XML files to CSV format\nutils.xml_to_csv('training_labels\u002F', 'train_labels.csv')\nutils.xml_to_csv('validation_labels\u002F', 'val_labels.csv')\n\n# Define custom transforms to apply to your dataset\ncustom_transforms = transforms.Compose([\n    transforms.ToPILImage(),\n    transforms.Resize(800),\n    transforms.ColorJitter(saturation=0.3),\n    transforms.ToTensor(),\n    utils.normalize_transform(),\n])\n\n# Pass in a CSV file instead of XML files for faster Dataset initialization speeds\ndataset = core.Dataset('train_labels.csv', 'images\u002F', transform=custom_transforms)\nval_dataset = core.Dataset('val_labels.csv', 'val_images')  # Validation dataset for training\n\n# Create your own DataLoader with custom options\nloader = core.DataLoader(dataset, batch_size=2, shuffle=True) \n\n# Use MobileNet instead of the default ResNet\nmodel = core.Model(['car', 'truck', 'boat', 'plane'], model_name='fasterrcnn_mobilenet_v3_large_fpn')\nlosses = model.fit(loader, val_dataset, epochs=15, learning_rate=0.001, verbose=True)\n\nplt.plot(losses)  # Visualize loss throughout training\nplt.show()\n\nmodel.save('model_weights.pth')  # Save model to a file\n\n# Directly access underlying torchvision model for even more control\ntorch_model = model.get_internal_model()\nprint(type(torch_model))\n```\n\n更多示例请访问 [文档](https:\u002F\u002Fdetecto.readthedocs.io\u002F)，其中包含 [快速入门](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fusage\u002Fquickstart.html) 教程。\n\n或者，查看 [Colab 上的演示](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ISaTV5F-7b4i2QqtjTa7ToDPQ2k8qEe0)。  \n\n# API 文档\n\n完整的 API 文档可以在 [detecto.readthedocs.io](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Findex.html) 找到。\n文档分为三个部分，分别对应 Detecto 的三个模块：\n\n### Core\n\n[detecto.core](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fcore.html) 模块包含该包的核心类：Dataset、DataLoader 和 Model。它们用于读取带标签的数据集并训练功能完备的目标检测模型。\n\n### Utils\n\n[detecto.utils](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Futils.html) 模块包含各种有用的辅助函数。使用它，您可以读取图像、将 XML 文件转换为 CSV 文件、对图像应用标准变换等。\n\n### Visualize\n\n[detecto.visualize](https:\u002F\u002Fdetecto.readthedocs.io\u002Fen\u002Flatest\u002Fapi\u002Fvisualize.html) 模块用于显示带标签的图像、绘制预测结果以及对视频运行目标检测。\n\n\n\n# 贡献\n\n欢迎所有的 issue 和 pull request！要在本地运行代码，请先 fork 该仓库，然后在您的计算机上运行以下命令： \n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002F\u003Cyour-username>\u002Fdetecto.git\ncd detecto\n\n# 建议在下一步之前创建一个 virtual environment（虚拟环境）\npip3 install -r requirements.txt\n```\n\n在添加代码时，请务必在必要时编写 unit tests（单元测试）和 docstrings（文档字符串）。\n\n测试位于 `detecto\u002Ftests` 目录下，可以使用 pytest 运行：\n\n`python3 -m pytest`\n\n请注意，某些测试可能会失败，因为它们需要一个 pretrained model file（预训练模型文件）。\n该文件可以在[此处](https:\u002F\u002Fwww.dropbox.com\u002Fs\u002Fkjalrfs3la97du8\u002Fmodel.pth?dl=1)下载，\n并应放置在 `detecto\u002Ftests\u002Fstatic\u002Fmodel.pth`。\n\n要在本地生成文档，请运行以下命令：\n\n```bash\ncd docs\nmake html\n```\n\n随后可以在 `docs\u002F_build\u002Fhtml\u002Findex.html` 查看文档。\n\n# 联系方式\n\nDetecto 由 [Alan Bi](https:\u002F\u002Fwww.alanbi.com\u002F) 创建。欢迎通过 [Twitter](https:\u002F\u002Ftwitter.com\u002Falankbi) 或 [电子邮件](mailto:alan.bi326@gmail.com) 联系！","# Detecto 快速上手指南\n\n### 环境准备\n\nDetecto 是一个基于 PyTorch 构建的 Python 计算机视觉库。在使用前，请确保您的系统满足以下条件：\n\n*   **Python 环境**：需安装 Python 3.x。\n*   **依赖库**：核心依赖为 PyTorch。虽然 pip 安装会自动处理依赖，但为了确保 GPU 加速等功能正常运作，建议提前配置好 PyTorch 环境。\n\n### 安装步骤\n\n推荐使用 pip 进行安装，该命令会自动下载 Detecto 及其相关依赖：\n\n```bash\npip3 install detecto\n```\n\n> **注意**：如果安装过程中出现依赖问题，请参考项目源码中的 `requirements.txt` 文件手动安装。\n\n### 基本使用\n\nDetecto 的设计初衷是极简主义，以下展示了三种最核心的使用场景。\n\n#### 1. 使用预训练模型进行视频推理\n\n只需 4 行代码，即可加载预训练模型（Faster R-CNN ResNet-50 FPN）并对视频进行目标检测：\n\n```python\nfrom detecto.core import Model\nfrom detecto.visualize import detect_video\n\nmodel = Model()  # 初始化预训练模型\ndetect_video(model, 'input_video.mp4', 'output.avi')  # 对视频运行推理\n```\n\n#### 2. 自定义数据集训练\n\n针对自定义物体进行检测，仅需 5 行代码即可完成迁移学习：\n\n```python\nfrom detecto.core import Model, Dataset\n\ndataset = Dataset('custom_dataset\u002F')  # 从文件夹加载图像和标签数据\nmodel = Model(['dog', 'cat', 'rabbit'])  # 指定需要识别的类别\nmodel.fit(dataset)  # 在自定义数据集上训练\n\nmodel.predict(...)  # 使用训练好的模型进行预测\n```\n\n#### 3. 图像推理与可视化\n\n对单张图片进行预测，并可视化检测结果：\n\n```python\nfrom detecto.core import Model\nfrom detecto import utils, visualize\n\nmodel = Model()\nimage = utils.read_image('image.jpg')  # 读取图像\n\nlabels, boxes, scores = model.predict(image)  # 获取预测结果\nvisualize.show_labeled_image(image, boxes, labels)  # 在图像上绘制预测框并显示\n```","小李是一名初创公司的全栈工程师，急需为一家工厂开发一个“传送带零件分拣”的原型演示，要求识别特定的红色齿轮零件。\n\n### 没有 detecto 时\n- 面对原生 PyTorch 复杂的 API，小李需要编写大量样板代码来定义 DataLoader、构建模型架构并编写训练循环，开发周期被拉长。\n- 处理标注数据时，必须手动编写脚本将 XML 格式的标注文件转换为模型所需的张量格式，数据预处理过程繁琐且极易出错。\n- 为了向客户展示效果，还得专门研究 OpenCV 代码来绘制边界框和处理视频流，分散了他在核心业务逻辑上的精力。\n\n### 使用 detecto 后\n- 利用 Detecto 封装好的高级接口，仅需 5 行代码就能完成自定义数据集的加载和模型迁移学习，半天内即可完成模型训练。\n- 直接通过简单的 `Dataset` 类读取文件夹中的图像和标注，无需关心底层繁琐的数据格式转换细节。\n- 调用内置的 `detect_video` 函数，一行代码即可在视频流中实时渲染检测结果，快速交付了高质量的演示 Demo。\n\nDetecto 将复杂的计算机视觉流程简化为极简的 Python 代码，让开发者能以最低的时间成本验证想法并快速落地应用。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falankbi_detecto_6a46b902.png","alankbi","Alan Bi","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Falankbi_08471f87.jpg","Duke '23",null,"Seattle, Washington","alan.bi326@gmail.com","alanbi.com","https:\u002F\u002Fgithub.com\u002Falankbi",[85],{"name":86,"color":87,"percentage":88},"Python","#3572A5",100,625,102,"2026-03-31T13:08:20","MIT",1,"未说明",{"notes":96,"python":97,"dependencies":98},"该工具是一个 Python 包，基于 PyTorch 构建；安装命令为 `pip3 install detecto`；支持使用预训练的 Faster R-CNN 模型；提供了 Google Colab 演示环境。","Python 3",[99,100,101],"PyTorch","torchvision","matplotlib",[13,14],[104,105,106,107,108,109],"object-detection","machine-learning","computer-vision","python","pytorch","faster-rcnn","2026-03-27T02:49:30.150509","2026-04-06T06:46:11.876095",[113,118,123,128],{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},1724,"调用 model.predict() 时出现 RuntimeError: cannot reshape tensor... 错误怎么办？","这通常是 PyTorch 版本兼容性问题。如果在使用较新版本（如 torch 1.5+）时遇到此错误，建议尝试降级环境，将 PyTorch 和 Torchvision 版本分别切换为 torch 1.4 和 torchvision 0.5.0，通常可以解决此问题。","https:\u002F\u002Fgithub.com\u002Falankbi\u002Fdetecto\u002Fissues\u002F33",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},1725,"训练时出现 !_src.empty() in function 'cv::cvtColor' 错误是什么原因？","该错误通常是因为标注文件（XML）引用了不存在或路径错误的图像文件。当 Dataset 尝试读取 XML 中指定路径的图像但找不到文件时，OpenCV 会返回空对象从而导致此错误。请检查您的 XML 文件内容，确保其中指向的图像路径正确且文件存在，删除或修正那些引用了缺失图像的 XML 文件即可。","https:\u002F\u002Fgithub.com\u002Falankbi\u002Fdetecto\u002Fissues\u002F54",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},1726,"保存模型时报错 AttributeError: 'Model' object has no attribute 'state_dict' 如何解决？","Detecto 的 Model 对象是对底层 PyTorch 模型的封装，不能直接调用 `state_dict` 属性。在加载模型时，不应直接使用 `torch.load`，而应使用 Detecto 提供的接口，例如 `core.Model.load('model.pth', class_list)`。请确保使用库提供的专用方法进行模型的保存与加载操作。","https:\u002F\u002Fgithub.com\u002Falankbi\u002Fdetecto\u002Fissues\u002F72",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},1727,"Detecto 模型可以部署到 Android 平台吗？","目前 Detecto 官方不支持直接将模型导出到 Android 平台。建议参考 PyTorch 官方文档，了解如何将 PyTorch 模型转换为移动端可用的格式。","https:\u002F\u002Fgithub.com\u002Falankbi\u002Fdetecto\u002Fissues\u002F35",[134,139,144,149,154,159,164,169,174,179,184,189],{"id":135,"version":136,"summary_zh":137,"released_at":138},101204,"v1.2.2","List of changes:\r\n\r\n* Add a new `model_name` parameter to `core.Model` (#94)\r\n  * The default model remains the same (`\"fasterrcnn_resnet50_fpn\"`, or `Model.DEFAULT`)\r\n  * New options include the following:\r\n    * `\"fasterrcnn_mobilenet_v3_large_fpn\"` (`Model.MOBILENET`)\r\n    * `\"fasterrcnn_mobilenet_v3_large_320_fpn\"` (`Model.MOBILENET_320`)\r\n* Fix occasional bug with drawing bounding boxes for the `detect_live` function (#101)","2022-02-02T00:22:07",{"id":140,"version":141,"summary_zh":142,"released_at":143},101205,"v1.2.1","List of changes:\r\n\r\n* Allow support for bounding box edge values to be provided in any order (#66)\r\n  * Before, only `xmin`, `ymin`, `xmax`, `ymax` was supported in the XML files\r\n* Add `pretrained` flag to `core.Model` to specify whether to use PyTorch's pretrained weights (#71)","2021-03-08T06:53:53",{"id":145,"version":146,"summary_zh":147,"released_at":148},101206,"v1.2.0","A few features and bug fixes are included in this release that update the behavior of the package. Most users should remain unaffected and not experience any noticeable performance differences or bugs; however, please take a look at the following change list to note everything that has been changed: \r\n\r\n* Change `Dataset` to group objects by image when indexing (#40, #60, #62)\r\n  * Previously, if an image had multiple labeled objects in it, the `Dataset` would treat each object as a separate row\u002Findex\r\n  * The dimensions of `boxes` and `labels` in the `targets` dict are now `(N, 4)` and `N`, respectively, where `N` is the number of labeled objects in each image (`labels` has changed from a string to a list of strings)\r\n  * The `xml_to_csv` function now has an additional column named `image_id`\r\n* Add more detailed verbose messages on calls to `model.fit` (#53)\r\n  * Now, the `verbose` flag is set to `True`\r\n  * A warning is given if the user is trying to fit the model on a CPU\r\n  * Training and validation progress is shown for each epoch\r\n* Pin `torch` and `torchvision` dependency versions to `1.6.0` and `0.7.0`, respectively (#52)\r\n\r\nTo prevent these changes from affecting existing codebases, users can lock their Detecto version to anything below `1.2.0` to ensure no breaking changes. ","2020-10-24T02:53:03",{"id":150,"version":151,"summary_zh":152,"released_at":153},101207,"v1.1.6","Fix bug with float values in XML files (#47, #49)","2020-08-20T23:44:05",{"id":155,"version":156,"summary_zh":157,"released_at":158},101208,"v1.1.5","Fix bug with float values in XML files (#47)","2020-08-15T23:14:17",{"id":160,"version":161,"summary_zh":162,"released_at":163},101209,"v1.1.4","Fixes a bug where validation loss uses the training dataset instead of the validation dataset (#38)","2020-05-29T22:12:01",{"id":165,"version":166,"summary_zh":167,"released_at":168},101210,"v1.1.3","Adds support for live webcam detection (#14) with the `visualize.detect_live` function. ","2020-03-26T05:00:18",{"id":170,"version":171,"summary_zh":172,"released_at":173},101211,"v1.1.2","Given that custom-trained Detecto models often output predictions with scores of 0.6 or 0.7, the default score_filter parameter for visualize_detect_video and visualize.plot_prediction_grid has been lowered to 0.6. \r\n\r\nTo prevent this change in behavior, you can explicitly set score_filter=0.8 as follows: \r\n\r\n```python\r\nfrom detecto import visualize\r\n\r\nvisualize.detect_video(model, 'input_vid.mp4', 'output_vid.avi', score_filter=0.8)\r\nvisualize.plot_prediction_grid(model, images, score_filter=0.8)\r\n```","2020-02-14T16:47:49",{"id":175,"version":176,"summary_zh":177,"released_at":178},101212,"v1.1.1","Summary of changes (coming from pull request #19):\r\n\r\n* Changes behavior of detect_video and plot_prediction_grid to show all predictions above a certain threshold (optional parameter) rather than the top prediction per class\r\n* Allows show_labeled_image to accept labels to display along with boxes\r\n* Fixes bug when running detect_video on a default model\r\n\r\nAll changes are non-breaking. ","2020-01-29T21:59:48",{"id":180,"version":181,"summary_zh":182,"released_at":183},101213,"v1.1.0","Major updates to the core module make it even easier to use Detecto. In addition, a new utils.split_video function helps users generate image data from video footage. \r\n\r\n* Split video function #12 \r\n* Increased flexibility of classes in core module #15 \r\n* Support for default pre-trained model #18 \r\n\r\nNote: for using the default model, it's recommended to wait until v1.0.1 is released, which will fix a few minor bugs and improve existing visualization methods to better support the default model's predictions. ","2020-01-29T18:36:38",{"id":185,"version":186,"summary_zh":187,"released_at":188},101214,"v1.0.2","* Removes Pillow version dependency #8 \r\n* Adds automatic reverse normalization to visualize.show_labeled_image #7 \r\n* Fixes excessive memory usage build error for Read the Docs","2020-01-20T16:37:23",{"id":190,"version":191,"summary_zh":79,"released_at":192},101215,"v1.0.1","2020-01-11T18:48:01"]