[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-endernewton--tf-faster-rcnn":3,"tool-endernewton--tf-faster-rcnn":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":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":79,"owner_email":79,"owner_twitter":76,"owner_website":81,"owner_url":82,"languages":83,"stars":114,"forks":115,"last_commit_at":116,"license":117,"difficulty_score":118,"env_os":119,"env_gpu":120,"env_ram":121,"env_deps":122,"category_tags":131,"github_topics":132,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":141,"updated_at":142,"faqs":143,"releases":174},2774,"endernewton\u002Ftf-faster-rcnn","tf-faster-rcnn","Tensorflow Faster RCNN for Object Detection","tf-faster-rcnn 是一个基于 TensorFlow 框架实现的 Faster R-CNN 目标检测工具，由卡内基梅隆大学的 Xinlei Chen 开发。它旨在帮助开发者在深度学习环境中高效地识别和定位图像中的物体，解决了从传统 Caffe 框架迁移至 TensorFlow 生态时的代码复现难题。\n\n该项目主要面向人工智能研究人员和算法工程师，特别适合那些希望深入理解区域提议网络（RPN）架构、进行模型对比实验或需要在单 GPU 环境下验证基础性能的用户。值得注意的是，官方已标记此仓库为“弃用”状态，建议需要多显卡支持或最新特性的用户转向 TensorPack 等更现代的实现方案，但 tf-faster-rcnn 仍具有重要的学术参考价值。\n\n其技术亮点在于对原始 Faster R-CNN 框架进行了多项微调改进，并在技术报告中详细分析了这些修改带来的性能提升。工具支持 VGG16、ResNet 系列及 Mobilenet V1 等多种主流骨干网络。尤其在处理小尺寸物体检测时，由于保留了较小的候选区域提案，其表现尤为出色。尽管不再作为生产环境的首选推荐，它依然是学习经典目标","tf-faster-rcnn 是一个基于 TensorFlow 框架实现的 Faster R-CNN 目标检测工具，由卡内基梅隆大学的 Xinlei Chen 开发。它旨在帮助开发者在深度学习环境中高效地识别和定位图像中的物体，解决了从传统 Caffe 框架迁移至 TensorFlow 生态时的代码复现难题。\n\n该项目主要面向人工智能研究人员和算法工程师，特别适合那些希望深入理解区域提议网络（RPN）架构、进行模型对比实验或需要在单 GPU 环境下验证基础性能的用户。值得注意的是，官方已标记此仓库为“弃用”状态，建议需要多显卡支持或最新特性的用户转向 TensorPack 等更现代的实现方案，但 tf-faster-rcnn 仍具有重要的学术参考价值。\n\n其技术亮点在于对原始 Faster R-CNN 框架进行了多项微调改进，并在技术报告中详细分析了这些修改带来的性能提升。工具支持 VGG16、ResNet 系列及 Mobilenet V1 等多种主流骨干网络。尤其在处理小尺寸物体检测时，由于保留了较小的候选区域提案，其表现尤为出色。尽管不再作为生产环境的首选推荐，它依然是学习经典目标检测算法原理和复现基准结果的优质开源资源。","# tf-faster-rcnn is deprecated:\nFor a good and more up-to-date implementation for faster\u002Fmask RCNN with multi-gpu support, please see the example in TensorPack [here](https:\u002F\u002Fgithub.com\u002Ftensorpack\u002Ftensorpack\u002Ftree\u002Fmaster\u002Fexamples\u002FFasterRCNN).\n\n# tf-faster-rcnn\nA Tensorflow implementation of faster RCNN detection framework by Xinlei Chen (xinleic@cs.cmu.edu). This repository is based on the python Caffe implementation of faster RCNN available [here](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn).\n\n**Note**: Several minor modifications are made when reimplementing the framework, which give potential improvements. For details about the modifications and ablative analysis, please refer to the technical report [An Implementation of Faster RCNN with Study for Region Sampling](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf). If you are seeking to reproduce the results in the original paper, please use the [official code](https:\u002F\u002Fgithub.com\u002FShaoqingRen\u002Ffaster_rcnn) or maybe the [semi-official code](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn). For details about the faster RCNN architecture please refer to the paper [Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks](http:\u002F\u002Farxiv.org\u002Fpdf\u002F1506.01497.pdf).\n\n### Detection Performance\nThe current code supports **VGG16**, **Resnet V1** and **Mobilenet V1** models. We mainly tested it on plain VGG16 and Resnet101 (thank you @philokey!) architecture. As the baseline, we report numbers using a single model on a single convolution layer, so no multi-scale, no multi-stage bounding box regression, no skip-connection, no extra input is used. The only data augmentation technique is left-right flipping during training following the original Faster RCNN. All models are released.\n\nWith VGG16 (``conv5_3``):\n  - Train on VOC 2007 trainval and test on VOC 2007 test, **70.8**.\n  - Train on VOC 2007+2012 trainval and test on VOC 2007 test ([R-FCN](https:\u002F\u002Fgithub.com\u002Fdaijifeng001\u002FR-FCN) schedule), **75.7**.\n  - Train on COCO 2014 [trainval35k](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn\u002Ftree\u002Fmaster\u002Fmodels) and test on [minival](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn\u002Ftree\u002Fmaster\u002Fmodels) (*Iterations*: 900k\u002F1190k), **30.2**.\n\nWith Resnet101 (last ``conv4``):\n  - Train on VOC 2007 trainval and test on VOC 2007 test, **75.7**.\n  - Train on VOC 2007+2012 trainval and test on VOC 2007 test (R-FCN schedule), **79.8**.\n  - Train on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **35.4**.\n\nMore Results:\n  - Train Mobilenet (1.0, 224) on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **21.8**.\n  - Train Resnet50 on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **32.4**.\n  - Train Resnet152 on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **36.1**.\n\nApproximate *baseline* [setup](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fblob\u002Fmaster\u002Fexperiments\u002Fcfgs\u002Fres101-lg.yml) from [FPN](https:\u002F\u002Farxiv.org\u002Fabs\u002F1612.03144) (this repository does not contain training code for FPN yet):\n  - Train Resnet50 on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **34.2**.\n  - Train Resnet101 on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **37.4**.\n  - Train Resnet152 on COCO 2014 trainval35k and test on minival (900k\u002F1190k), **38.2**.\n\n**Note**:\n  - Due to the randomness in GPU training with Tensorflow especially for VOC, the best numbers are reported (with 2-3 attempts) here. According to my experience, for COCO you can almost always get a very close number (within ~0.2%) despite the randomness.\n  - The numbers are obtained with the **default** testing scheme which selects region proposals using non-maximal suppression (TEST.MODE nms), the alternative testing scheme (TEST.MODE top) will likely result in slightly better performance (see [report](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf), for COCO it boosts 0.X AP).\n  - Since we keep the small proposals (\\\u003C 16 pixels width\u002Fheight), our performance is especially good for small objects.\n  - We do not set a threshold (instead of 0.05) for a detection to be included in the final result, which increases recall.\n  - Weight decay is set to 1e-4.\n  - For other minor modifications, please check the [report](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf). Notable ones include using ``crop_and_resize``, and excluding ground truth boxes in RoIs during training.\n  - For COCO, we find the performance improving with more iterations, and potentially better performance can be achieved with even more iterations.\n  - For Resnets, we fix the first block (total 4) when fine-tuning the network, and only use ``crop_and_resize`` to resize the RoIs (7x7) without max-pool (which I find useless especially for COCO). The final feature maps are average-pooled for classification and regression. All batch normalization parameters are fixed. Learning rate for biases is not doubled.\n  - For Mobilenets, we fix the first five layers when fine-tuning the network. All batch normalization parameters are fixed. Weight decay for Mobilenet layers is set to 4e-5.\n  - For approximate [FPN](https:\u002F\u002Farxiv.org\u002Fabs\u002F1612.03144) baseline setup we simply resize the image with 800 pixels, add 32^2 anchors, and take 1000 proposals during testing.\n  - Check out [here](http:\u002F\u002Fladoga.graphics.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002F)\u002F[here](http:\u002F\u002Fxinlei.sp.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002F)\u002F[here](https:\u002F\u002Fdrive.google.com\u002Fopen?id=0B1_fAEgxdnvJSmF3YUlZcHFqWTQ) for the latest models, including longer COCO VGG16 models and Resnet ones.\n  \n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fendernewton_tf-faster-rcnn_readme_ce0673762446.png)      |  ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fendernewton_tf-faster-rcnn_readme_29c8a8fa4d7a.png)\n:-------------------------:|:-------------------------:\nDisplayed Ground Truth on Tensorboard |  Displayed Predictions on Tensorboard\n\n### Additional features\nAdditional features not mentioned in the [report](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf) are added to make research life easier:\n  - **Support for train-and-validation**. During training, the validation data will also be tested from time to time to monitor the process and check potential overfitting. Ideally training and validation should be separate, where the model is loaded every time to test on validation. However I have implemented it in a joint way to save time and GPU memory. Though in the default setup the testing data is used for validation, no special attempts is made to overfit on testing set.\n  - **Support for resuming training**. I tried to store as much information as possible when snapshoting, with the purpose to resume training from the latest snapshot properly. The meta information includes current image index, permutation of images, and random state of numpy. However, when you resume training the random seed for tensorflow will be reset (not sure how to save the random state of tensorflow now), so it will result in a difference. **Note** that, the current implementation still cannot force the model to behave deterministically even with the random seeds set. Suggestion\u002Fsolution is welcome and much appreciated.\n  - **Support for visualization**. The current implementation will summarize ground truth boxes, statistics of losses, activations and variables during training, and dump it to a separate folder for tensorboard visualization. The computing graph is also saved for debugging.\n\n### Prerequisites\n  - A basic Tensorflow installation. The code follows **r1.2** format. If you are using r1.0, please check out the r1.0 branch to fix the slim Resnet block issue. If you are using an older version (r0.1-r0.12), please check out the r0.12 branch. While it is not required, for experimenting the original RoI pooling (which requires modification of the C++ code in tensorflow), you can check out my tensorflow [fork](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftensorflow) and look for ``tf.image.roi_pooling``.\n  - Python packages you might not have: `cython`, `opencv-python`, `easydict` (similar to [py-faster-rcnn](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn)). For `easydict` make sure you have the right version. I use 1.6.\n  - Docker users: Since the recent upgrade, the docker image on docker hub (https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmbuckler\u002Ftf-faster-rcnn-deps\u002F) is no longer valid. However, you can still build your own image by using dockerfile located at `docker` folder (cuda 8 version, as it is required by Tensorflow r1.0.) And make sure following Tensorflow installation to install and use nvidia-docker[https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fnvidia-docker]. Last, after launching the container, you have to build the Cython modules within the running container. \n\n### Installation\n1. Clone the repository\n  ```Shell\n  git clone https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn.git\n  ```\n\n2. Update your -arch in setup script to match your GPU\n  ```Shell\n  cd tf-faster-rcnn\u002Flib\n  # Change the GPU architecture (-arch) if necessary\n  vim setup.py\n  ```\n\n  | GPU model  | Architecture |\n  | ------------- | ------------- |\n  | TitanX (Maxwell\u002FPascal) | sm_52 |\n  | GTX 960M | sm_50 |\n  | GTX 1080 (Ti) | sm_61 |\n  | Grid K520 (AWS g2.2xlarge) | sm_30 |\n  | Tesla K80 (AWS p2.xlarge) | sm_37 |\n\n  **Note**: You are welcome to contribute the settings on your end if you have made the code work properly on other GPUs. Also even if you are only using CPU tensorflow, GPU based code (for NMS) will be used by default, so please set **USE_GPU_NMS False** to get the correct output.\n\n\n3. Build the Cython modules\n  ```Shell\n  make clean\n  make\n  cd ..\n  ```\n\n4. Install the [Python COCO API](https:\u002F\u002Fgithub.com\u002Fpdollar\u002Fcoco). The code requires the API to access COCO dataset.\n  ```Shell\n  cd data\n  git clone https:\u002F\u002Fgithub.com\u002Fpdollar\u002Fcoco.git\n  cd coco\u002FPythonAPI\n  make\n  cd ..\u002F..\u002F..\n  ```\n\n### Setup data\nPlease follow the instructions of py-faster-rcnn [here](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn#beyond-the-demo-installation-for-training-and-testing-models) to setup VOC and COCO datasets (Part of COCO is done). The steps involve downloading data and optionally creating soft links in the ``data`` folder. Since faster RCNN does not rely on pre-computed proposals, it is safe to ignore the steps that setup proposals.\n\nIf you find it useful, the ``data\u002Fcache`` folder created on my side is also shared [here](http:\u002F\u002Fladoga.graphics.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002Fcache.tgz).\n\n### Demo and Test with pre-trained models\n1. Download pre-trained model\n  ```Shell\n  # Resnet101 for voc pre-trained on 07+12 set\n  .\u002Fdata\u002Fscripts\u002Ffetch_faster_rcnn_models.sh\n  ```\n  **Note**: if you cannot download the models through the link, or you want to try more models, you can check out the following solutions and optionally update the downloading script:\n  - Another server [here](http:\u002Fxinleic.xyz\u002Fdata\u002Ftf-faster-rcnn\u002F).\n  - Google drive [here](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B1_fAEgxdnvJSmF3YUlZcHFqWTQ?resourcekey=0-3IJ2gZLaeRUOBsa26PigQg&usp=sharing).\n\n2. Create a folder and a soft link to use the pre-trained model\n  ```Shell\n  NET=res101\n  TRAIN_IMDB=voc_2007_trainval+voc_2012_trainval\n  mkdir -p output\u002F${NET}\u002F${TRAIN_IMDB}\n  cd output\u002F${NET}\u002F${TRAIN_IMDB}\n  ln -s ..\u002F..\u002F..\u002Fdata\u002Fvoc_2007_trainval+voc_2012_trainval .\u002Fdefault\n  cd ..\u002F..\u002F..\n  ```\n\n3. Demo for testing on custom images\n  ```Shell\n  # at repository root\n  GPU_ID=0\n  CUDA_VISIBLE_DEVICES=${GPU_ID} .\u002Ftools\u002Fdemo.py\n  ```\n  **Note**: Resnet101 testing probably requires several gigabytes of memory, so if you encounter memory capacity issues, please install it with CPU support only. Refer to [Issue 25](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F25).\n\n4. Test with pre-trained Resnet101 models\n  ```Shell\n  GPU_ID=0\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh $GPU_ID pascal_voc_0712 res101\n  ```\n  **Note**: If you cannot get the reported numbers (79.8 on my side), then probably the NMS function is compiled improperly, refer to [Issue 5](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F5).\n\n### Train your own model\n1. Download pre-trained models and weights. The current code support VGG16 and Resnet V1 models. Pre-trained models are provided by slim, you can get the pre-trained models [here](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fmodels\u002Ftree\u002Fmaster\u002Fresearch\u002Fslim#pre-trained-models) and set them in the ``data\u002Fimagenet_weights`` folder. For example for VGG16 model, you can set up like:\n   ```Shell\n   mkdir -p data\u002Fimagenet_weights\n   cd data\u002Fimagenet_weights\n   wget -v http:\u002F\u002Fdownload.tensorflow.org\u002Fmodels\u002Fvgg_16_2016_08_28.tar.gz\n   tar -xzvf vgg_16_2016_08_28.tar.gz\n   mv vgg_16.ckpt vgg16.ckpt\n   cd ..\u002F..\n   ```\n   For Resnet101, you can set up like:\n   ```Shell\n   mkdir -p data\u002Fimagenet_weights\n   cd data\u002Fimagenet_weights\n   wget -v http:\u002F\u002Fdownload.tensorflow.org\u002Fmodels\u002Fresnet_v1_101_2016_08_28.tar.gz\n   tar -xzvf resnet_v1_101_2016_08_28.tar.gz\n   mv resnet_v1_101.ckpt res101.ckpt\n   cd ..\u002F..\n   ```\n\n2. Train (and test, evaluation)\n  ```Shell\n  .\u002Fexperiments\u002Fscripts\u002Ftrain_faster_rcnn.sh [GPU_ID] [DATASET] [NET]\n  # GPU_ID is the GPU you want to test on\n  # NET in {vgg16, res50, res101, res152} is the network arch to use\n  # DATASET {pascal_voc, pascal_voc_0712, coco} is defined in train_faster_rcnn.sh\n  # Examples:\n  .\u002Fexperiments\u002Fscripts\u002Ftrain_faster_rcnn.sh 0 pascal_voc vgg16\n  .\u002Fexperiments\u002Fscripts\u002Ftrain_faster_rcnn.sh 1 coco res101\n  ```\n  **Note**: Please double check you have deleted soft link to the pre-trained models before training. If you find NaNs during training, please refer to [Issue 86](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F86). Also if you want to have multi-gpu support, check out [Issue 121](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F121).\n\n3. Visualization with Tensorboard\n  ```Shell\n  tensorboard --logdir=tensorboard\u002Fvgg16\u002Fvoc_2007_trainval\u002F --port=7001 &\n  tensorboard --logdir=tensorboard\u002Fvgg16\u002Fcoco_2014_train+coco_2014_valminusminival\u002F --port=7002 &\n  ```\n\n4. Test and evaluate\n  ```Shell\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh [GPU_ID] [DATASET] [NET]\n  # GPU_ID is the GPU you want to test on\n  # NET in {vgg16, res50, res101, res152} is the network arch to use\n  # DATASET {pascal_voc, pascal_voc_0712, coco} is defined in test_faster_rcnn.sh\n  # Examples:\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh 0 pascal_voc vgg16\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh 1 coco res101\n  ```\n\n5. You can use ``tools\u002Freval.sh`` for re-evaluation\n\n\nBy default, trained networks are saved under:\n\n```\noutput\u002F[NET]\u002F[DATASET]\u002Fdefault\u002F\n```\n\nTest outputs are saved under:\n\n```\noutput\u002F[NET]\u002F[DATASET]\u002Fdefault\u002F[SNAPSHOT]\u002F\n```\n\nTensorboard information for train and validation is saved under:\n\n```\ntensorboard\u002F[NET]\u002F[DATASET]\u002Fdefault\u002F\ntensorboard\u002F[NET]\u002F[DATASET]\u002Fdefault_val\u002F\n```\n\nThe default number of training iterations is kept the same to the original faster RCNN for VOC 2007, however I find it is beneficial to train longer (see [report](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf) for COCO), probably due to the fact that the image batch size is one. For VOC 07+12 we switch to a 80k\u002F110k schedule following [R-FCN](https:\u002F\u002Fgithub.com\u002Fdaijifeng001\u002FR-FCN). Also note that due to the nondeterministic nature of the current implementation, the performance can vary a bit, but in general it should be within ~1% of the reported numbers for VOC, and ~0.2% of the reported numbers for COCO. Suggestions\u002FContributions are welcome.\n\n### Citation\nIf you find this implementation or the analysis conducted in our report helpful, please consider citing:\n\n    @article{chen17implementation,\n        Author = {Xinlei Chen and Abhinav Gupta},\n        Title = {An Implementation of Faster RCNN with Study for Region Sampling},\n        Journal = {arXiv preprint arXiv:1702.02138},\n        Year = {2017}\n    }\n    \nOr for a formal paper, [Spatial Memory Network](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.04224):\n\n    @article{chen2017spatial,\n      title={Spatial Memory for Context Reasoning in Object Detection},\n      author={Chen, Xinlei and Gupta, Abhinav},\n      journal={arXiv preprint arXiv:1704.04224},\n      year={2017}\n    }\n\nFor convenience, here is the faster RCNN citation:\n\n    @inproceedings{renNIPS15fasterrcnn,\n        Author = {Shaoqing Ren and Kaiming He and Ross Girshick and Jian Sun},\n        Title = {Faster {R-CNN}: Towards Real-Time Object Detection\n                 with Region Proposal Networks},\n        Booktitle = {Advances in Neural Information Processing Systems ({NIPS})},\n        Year = {2015}\n    }\n","# tf-faster-rcnn 已弃用：\n对于具有多 GPU 支持的 Faster\u002FMask RCNN 的良好且更现代的实现，请参阅 TensorPack 中的示例 [这里](https:\u002F\u002Fgithub.com\u002Ftensorpack\u002Ftensorpack\u002Ftree\u002Fmaster\u002Fexamples\u002FFasterRCNN)。\n\n# tf-faster-rcnn\n由 Xinlei Chen (xinleic@cs.cmu.edu) 实现的基于 TensorFlow 的 Faster RCNN 检测框架。该仓库基于可用的 Python Caffe 版本的 Faster RCNN 实现 [这里](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn)。\n\n**注意**：在重新实现该框架时，进行了一些小的修改，这些修改可能带来性能提升。有关这些修改及消融分析的详细信息，请参阅技术报告 [带有区域采样研究的 Faster RCNN 实现](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf)。如果您希望复现原始论文中的结果，请使用 [官方代码](https:\u002F\u002Fgithub.com\u002FShaoqingRen\u002Ffaster_rcnn) 或者可能是 [半官方代码](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn)。有关 Faster RCNN 架构的详细信息，请参阅论文 [Faster R-CNN：通过区域提议网络实现实时目标检测](http:\u002F\u002Farxiv.org\u002Fpdf\u002F1506.01497.pdf)。\n\n### 检测性能\n当前代码支持 **VGG16**、**Resnet V1** 和 **Mobilenet V1** 模型。我们主要在普通的 VGG16 和 Resnet101（感谢 @philokey！）架构上进行了测试。作为基准，我们报告的是在单个卷积层上使用单个模型的结果，因此未采用多尺度、多阶段边界框回归、跳跃连接或额外输入。唯一的数据增强技术是在训练过程中按照原始 Faster RCNN 的方式使用左右翻转。所有模型均已发布。\n\n使用 VGG16（``conv5_3``）：\n  - 在 VOC 2007 trainval 上训练并在 VOC 2007 test 上测试，**70.8**。\n  - 在 VOC 2007+2012 trainval 上训练并在 VOC 2007 test 上测试（[R-FCN](https:\u002F\u002Fgithub.com\u002Fdaijifeng001\u002FR-FCN) 时间表），**75.7**。\n  - 在 COCO 2014 [trainval35k](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn\u002Ftree\u002Fmaster\u002Fmodels) 上训练并在 [minival](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn\u002Ftree\u002Fmaster\u002Fmodels) 上测试（*迭代次数*：90万\u002F119万），**30.2**。\n\n使用 Resnet101（最后一个 ``conv4``）：\n  - 在 VOC 2007 trainval 上训练并在 VOC 2007 test 上测试，**75.7**。\n  - 在 VOC 2007+2012 trainval 上训练并在 VOC 2007 test 上测试（R-FCN 时间表），**79.8**。\n  - 在 COCO 2014 trainval35k 上训练并在 minival 上测试（90万\u002F119万），**35.4**。\n\n更多结果：\n  - 在 COCO 2014 trainval35k 上训练 Mobilenet（1.0，224）并在 minival 上测试（90万\u002F119万），**21.8**。\n  - 在 COCO 2014 trainval35k 上训练 Resnet50 并在 minival 上测试（90万\u002F119万），**32.4**。\n  - 在 COCO 2014 trainval35k 上训练 Resnet152 并在 minival 上测试（90万\u002F119万），**36.1**。\n\n近似的 *基准* [设置](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fblob\u002Fmaster\u002Fexperiments\u002Fcfgs\u002Fres101-lg.yml) 来自 [FPN](https:\u002F\u002Farxiv.org\u002Fabs\u002F1612.03144)（该仓库目前尚不包含 FPN 的训练代码）：\n  - 在 COCO 2014 trainval35k 上训练 Resnet50 并在 minival 上测试（90万\u002F119万），**34.2**。\n  - 在 COCO 2014 trainval35k 上训练 Resnet101 并在 minival 上测试（90万\u002F119万），**37.4**。\n  - 在 COCO 2014 trainval35k 上训练 Resnet152 并在 minival 上测试（90万\u002F119万），**38.2**。\n\n**注意**：\n  - 由于在使用 TensorFlow 进行 GPU 训练时存在随机性，尤其是在 VOC 数据集上，此处报告的是经过 2-3 次尝试后得到的最佳数值。根据我的经验，对于 COCO 数据集，尽管存在随机性，但几乎总是可以得到非常接近的结果（误差在 ~0.2% 以内）。\n  - 这些数值是使用 **默认** 测试方案获得的，该方案使用非极大值抑制（TEST.MODE nms）来选择区域建议；而另一种测试方案（TEST.MODE top）可能会带来略好的性能（参见 [报告](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf)，对于 COCO 数据集，它可以将 AP 提升 0.X）。\n  - 由于我们保留了较小的建议区域（宽度\u002F高度小于 16 像素），因此我们在小目标检测方面的表现尤为出色。\n  - 我们没有为检测结果设定阈值（而是使用 0.05），这提高了召回率。\n  - 权重衰减设置为 1e-4。\n  - 其他一些小的修改，请参阅 [报告](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf)。值得注意的是，我们使用了 ``crop_and_resize``，并且在训练过程中将真实框排除在 RoI 之外。\n  - 对于 COCO 数据集，我们发现随着迭代次数的增加，性能会有所提升，如果进一步增加迭代次数，性能还有可能更好。\n  - 对于 Resnets，在微调网络时，我们固定了第一个模块（共 4 个），并仅使用 ``crop_and_resize`` 来调整 RoI 大小（7x7），而不进行最大池化操作（我认为这对于 COCO 数据集尤其没有必要）。最终的特征图会进行平均池化以用于分类和回归。所有批归一化参数均被固定。偏置的学习率并未加倍。\n  - 对于 Mobilenets，在微调网络时，我们固定了前五层。所有批归一化参数均被固定。Mobilenet 层的权重衰减设置为 4e-5。\n  - 对于近似的 [FPN](https:\u002F\u002Farxiv.org\u002Fabs\u002F1612.03144) 基准设置，我们只需将图像大小调整为 800 像素，添加 32^2 个锚点，并在测试时选取 1000 个建议区域。\n  - 请访问 [这里](http:\u002F\u002Fladoga.graphics.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002F) \u002F [这里](http:\u002F\u002Fxinlei.sp.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002F) \u002F [这里](https:\u002F\u002Fdrive.google.com\u002Fopen?id=0B1_fAEgxdnvJSmF3YUlZcHFqWTQ) 查看最新的模型，包括更长时间训练的 COCO VGG16 模型和 Resnet 模型。\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fendernewton_tf-faster-rcnn_readme_ce0673762446.png)      |  ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fendernewton_tf-faster-rcnn_readme_29c8a8fa4d7a.png)\n:-------------------------:|:-------------------------:\nTensorBoard 上显示的真实标签 |  TensorBoard 上显示的预测结果\n\n### 附加功能\n为了使研究工作更加便捷，我们添加了[报告](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf)中未提及的额外功能：\n  - **训练与验证支持**。在训练过程中，会定期对验证数据进行测试，以监控训练进程并检查是否存在过拟合现象。理想情况下，训练和验证应分开进行，每次加载模型后在验证集上进行测试。然而，为了节省时间和显存，我采用了联合的方式实现这一功能。尽管在默认设置中使用测试数据作为验证集，但并未刻意针对测试集进行过拟合。\n  - **断点续训支持**。我在保存快照时尽可能多地存储信息，以便能够从最近的快照正确恢复训练。元信息包括当前图像索引、图像排列顺序以及 numpy 的随机状态。不过，当您恢复训练时，TensorFlow 的随机种子会被重置（目前尚不清楚如何保存 TensorFlow 的随机状态），因此可能会导致结果差异。**请注意**，即使设置了随机种子，当前实现仍无法完全保证模型的行为具有确定性。欢迎提出建议或解决方案，我们将不胜感激。\n  - **可视化支持**。当前实现会在训练过程中汇总真实框、损失统计、激活值和变量等信息，并将其转储到一个单独的文件夹中，供 TensorBoard 可视化使用。同时还会保存计算图以方便调试。\n\n### 前置条件\n  - 需要安装基础的 TensorFlow。代码遵循 **r1.2** 格式。如果您使用的是 r1.0，请切换到 r1.0 分支以修复 slim Resnet 模块的问题。如果使用更早的版本（r0.1–r0.12），请切换到 r0.12 分支。虽然不是必需的，但若要尝试原始的 RoI pooling（需要修改 TensorFlow 的 C++ 代码），可以查看我的 TensorFlow [fork](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftensorflow)，寻找 ``tf.image.roi_pooling``。\n  - 您可能尚未安装的 Python 包：`cython`、`opencv-python`、`easydict`（类似于 [py-faster-rcnn](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn)）。对于 `easydict`，请确保使用正确的版本，我使用的是 1.6。\n  - 对于 Docker 用户：自最近更新以来，Docker Hub 上的镜像（https:\u002F\u002Fhub.docker.com\u002Fr\u002Fmbuckler\u002Ftf-faster-rcnn-deps\u002F）已不再有效。不过，您仍然可以通过 `docker` 文件夹中的 Dockerfile 构建自己的镜像（CUDA 8 版本，因为 TensorFlow r1.0 需要此版本）。同时，请按照 TensorFlow 官方文档安装并使用 nvidia-docker[https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fnvidia-docker]。最后，在启动容器后，您还需要在运行中的容器内构建 Cython 模块。\n\n### 安装\n1. 克隆仓库\n  ```Shell\n  git clone https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn.git\n  ```\n\n2. 更新 setup 脚本中的 -arch 参数以匹配您的 GPU\n  ```Shell\n  cd tf-faster-rcnn\u002Flib\n  # 如有必要，更改 GPU 架构 (-arch)\n  vim setup.py\n  ```\n\n  | GPU 型号  | 架构 |\n  | ------------- | ------------- |\n  | TitanX (Maxwell\u002FPascal) | sm_52 |\n  | GTX 960M | sm_50 |\n  | GTX 1080 (Ti) | sm_61 |\n  | Grid K520 (AWS g2.2xlarge) | sm_30 |\n  | Tesla K80 (AWS p2.xlarge) | sm_37 |\n\n  **注意**：如果您已在其他 GPU 上成功运行代码，欢迎贡献相应的配置信息。另外，即使您仅使用 CPU 版本的 TensorFlow，代码中默认也会调用基于 GPU 的 NMS 实现，因此请将 **USE_GPU_NMS 设置为 False**，以获得正确的输出结果。\n\n3. 构建 Cython 模块\n  ```Shell\n  make clean\n  make\n  cd ..\n  ```\n\n4. 安装 [Python COCO API](https:\u002F\u002Fgithub.com\u002Fpdollar\u002Fcoco)。代码需要该 API 来访问 COCO 数据集。\n  ```Shell\n  cd data\n  git clone https:\u002F\u002Fgithub.com\u002Fpdollar\u002Fcoco.git\n  cd coco\u002FPythonAPI\n  make\n  cd ..\u002F..\u002F..\n  ```\n\n### 数据准备\n请参照 py-faster-rcnn 的说明[此处](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn#beyond-the-demo-installation-for-training-and-testing-models)来设置 VOC 和 COCO 数据集（COCO 数据的部分已经完成）。步骤包括下载数据以及可选地在 `data` 文件夹中创建软链接。由于 Faster R-CNN 不依赖于预计算的候选框，因此可以忽略那些用于设置候选框的步骤。\n\n如果您觉得有用，我这边生成的 `data\u002Fcache` 文件夹也在此共享[这里](http:\u002F\u002Fladoga.graphics.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002Fcache.tgz)。\n\n### 使用预训练模型进行演示与测试\n1. 下载预训练模型\n  ```Shell\n  # Resnet101 for voc 在 07+12 数据集上预训练\n  .\u002Fdata\u002Fscripts\u002Ffetch_faster_rcnn_models.sh\n  ```\n  **注意**：如果您无法通过链接下载模型，或者想尝试更多模型，可以参考以下方案，并可选择更新下载脚本：\n  - 另一台服务器[这里](http:\u002Fxinleic.xyz\u002Fdata\u002Ftf-faster-rcnn\u002F)。\n  - Google Drive[这里](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B1_fAEgxdnvJSmF3YUlZcHFqWTQ?resourcekey=0-3IJ2gZLaeRUOBsa26PigQg&usp=sharing)。\n\n2. 创建文件夹并建立软链接以使用预训练模型\n  ```Shell\n  NET=res101\n  TRAIN_IMDB=voc_2007_trainval+voc_2012_trainval\n  mkdir -p output\u002F${NET}\u002F${TRAIN_IMDB}\n  cd output\u002F${NET}\u002F${TRAIN_IMDB}\n  ln -s ..\u002F..\u002F..\u002Fdata\u002Fvoc_2007_trainval+voc_2012_trainval .\u002Fdefault\n  cd ..\u002F..\u002F..\n  ```\n\n3. 自定义图片测试演示\n  ```Shell\n  # 在仓库根目录下\n  GPU_ID=0\n  CUDA_VISIBLE_DEVICES=${GPU_ID} .\u002Ftools\u002Fdemo.py\n  ```\n  **注意**：Resnet101 的测试可能需要数 GB 的显存，因此如果遇到显存不足的问题，请仅使用 CPU 支持的版本运行。详情请参阅 [Issue 25](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F25)。\n\n4. 使用预训练的 Resnet101 模型进行测试\n  ```Shell\n  GPU_ID=0\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh $GPU_ID pascal_voc_0712 res101\n  ```\n  **注意**：如果您未能得到报告中的指标（我这边是 79.8），则可能是 NMS 函数编译不当所致，请参阅 [Issue 5](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F5)。\n\n### 训练你自己的模型\n1. 下载预训练模型和权重。当前代码支持 VGG16 和 Resnet V1 模型。预训练模型由 slim 提供，你可以从 [这里](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fmodels\u002Ftree\u002Fmaster\u002Fresearch\u002Fslim#pre-trained-models) 获取，并将其放置在 ``data\u002Fimagenet_weights`` 文件夹中。例如，对于 VGG16 模型，可以按如下步骤设置：\n   ```Shell\n   mkdir -p data\u002Fimagenet_weights\n   cd data\u002Fimagenet_weights\n   wget -v http:\u002F\u002Fdownload.tensorflow.org\u002Fmodels\u002Fvgg_16_2016_08_28.tar.gz\n   tar -xzvf vgg_16_2016_08_28.tar.gz\n   mv vgg_16.ckpt vgg16.ckpt\n   cd ..\u002F..\n   ```\n   对于 Resnet101，可以按如下步骤设置：\n   ```Shell\n   mkdir -p data\u002Fimagenet_weights\n   cd data\u002Fimagenet_weights\n   wget -v http:\u002F\u002Fdownload.tensorflow.org\u002Fmodels\u002Fresnet_v1_101_2016_08_28.tar.gz\n   tar -xzvf resnet_v1_101_2016_08_28.tar.gz\n   mv resnet_v1_101.ckpt res101.ckpt\n   cd ..\u002F..\n   ```\n\n2. 训练（以及测试、评估）\n  ```Shell\n  .\u002Fexperiments\u002Fscripts\u002Ftrain_faster_rcnn.sh [GPU_ID] [DATASET] [NET]\n  # GPU_ID 是你要使用的 GPU 编号\n  # NET 可取 {vgg16, res50, res101, res152}，表示要使用的网络架构\n  # DATASET 可取 {pascal_voc, pascal_voc_0712, coco}，定义在 train_faster_rcnn.sh 中\n  # 示例：\n  .\u002Fexperiments\u002Fscripts\u002Ftrain_faster_rcnn.sh 0 pascal_voc vgg16\n  .\u002Fexperiments\u002Fscripts\u002Ftrain_faster_rcnn.sh 1 coco res101\n  ```\n  **注意**：请务必在训练前删除指向预训练模型的软链接。如果在训练过程中遇到 NaN 值，请参考 [Issue 86](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F86)。此外，若需多 GPU 支持，请查看 [Issue 121](https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F121)。\n\n3. 使用 TensorBoard 进行可视化\n  ```Shell\n  tensorboard --logdir=tensorboard\u002Fvgg16\u002Fvoc_2007_trainval\u002F --port=7001 &\n  tensorboard --logdir=tensorboard\u002Fvgg16\u002Fcoco_2014_train+coco_2014_valminusminival\u002F --port=7002 &\n  ```\n\n4. 测试与评估\n  ```Shell\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh [GPU_ID] [DATASET] [NET]\n  # GPU_ID 是你要使用的 GPU 编号\n  # NET 可取 {vgg16, res50, res101, res152}，表示要使用的网络架构\n  # DATASET 可取 {pascal_voc, pascal_voc_0712, coco}，定义在 test_faster_rcnn.sh 中\n  # 示例：\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh 0 pascal_voc vgg16\n  .\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh 1 coco res101\n  ```\n\n5. 你可以使用 ``tools\u002Freval.sh`` 进行重新评估。\n\n\n默认情况下，训练好的模型会保存在以下路径：\n\n```\noutput\u002F[NET]\u002F[DATASET]\u002Fdefault\u002F\n```\n\n测试输出会保存在以下路径：\n\n```\noutput\u002F[NET]\u002F[DATASET]\u002Fdefault\u002F[SNAPSHOT]\u002F\n```\n\nTensorBoard 的训练和验证信息会保存在以下路径：\n\n```\ntensorboard\u002F[NET]\u002F[DATASET]\u002Fdefault\u002F\ntensorboard\u002F[NET]\u002F[DATASET]\u002Fdefault_val\u002F\n```\n\n默认的训练迭代次数与原始 Faster R-CNN 在 VOC 2007 上的设置相同，但我发现延长训练时间更有益处（参见 COCO 数据集的相关报告 [arXiv:1702.02138](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1702.02138.pdf)），这可能是因为图像批处理大小为 1。对于 VOC 07+12 数据集，我们采用了 8 万\u002F11 万次迭代的调度策略，遵循 R-FCN 的做法。另外请注意，由于当前实现的非确定性，性能可能会略有波动，但通常应在 VOC 数据集报告数值的 ±1% 范围内，COCO 数据集则在 ±0.2% 范围内。欢迎提出建议或贡献。\n\n### 引用\n如果你觉得本实现或我们在报告中的分析有所帮助，请考虑引用以下内容：\n\n    @article{chen17implementation,\n        Author = {Xinlei Chen and Abhinav Gupta},\n        Title = {一种基于区域采样的 Faster R-CNN 实现},\n        Journal = {arXiv 预印本 arXiv:1702.02138},\n        Year = {2017}\n    }\n    \n或者针对正式论文《空间记忆网络》[arXiv:1704.04224](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.04224)：\n\n    @article{chen2017spatial,\n      title={用于目标检测上下文推理的空间记忆},\n      author={Chen, Xinlei and Gupta, Abhinav},\n      journal={arXiv 预印本 arXiv:1704.04224},\n      year={2017}\n    }\n\n为了方便起见，以下是 Faster R-CNN 的引用：\n\n    @inproceedings{renNIPS15fasterrcnn,\n        Author = {Shaoqing Ren and Kaiming He and Ross Girshick and Jian Sun},\n        Title = {Faster {R-CNN}: 基于区域提议网络实现实时目标检测},\n        Booktitle = {神经信息处理系统进展会议 ({NIPS})},\n        Year = {2015}\n    }","# tf-faster-rcnn 快速上手指南\n\n> **重要提示**：本项目（tf-faster-rcnn）已停止维护（Deprecated）。如需使用支持多 GPU 且更新版本的 Faster\u002FMask RCNN 实现，推荐参考 [TensorPack 示例](https:\u002F\u002Fgithub.com\u002Ftensorpack\u002Ftensorpack\u002Ftree\u002Fmaster\u002Fexamples\u002FFasterRCNN)。以下指南仅适用于需要复现特定历史结果或研究旧版实现的场景。\n\n## 环境准备\n\n### 系统要求\n- **TensorFlow**: 代码基于 **r1.2** 版本编写。\n  - 若使用 r1.0，请切换至 `r1.0` 分支。\n  - 若使用 r0.1-r0.12，请切换至 `r0.12` 分支。\n- **GPU**: 默认使用 GPU 进行 NMS 计算。若仅使用 CPU TensorFlow，需在配置中设置 `USE_GPU_NMS False`。\n- **Python 依赖**:\n  - `cython`\n  - `opencv-python`\n  - `easydict` (建议使用版本 1.6)\n\n### Docker 用户注意\nDocker Hub 上的旧镜像已失效。如需使用 Docker，请利用项目 `docker` 文件夹下的 Dockerfile 自行构建（基于 CUDA 8），并确保安装了 `nvidia-docker`。容器启动后需重新编译 Cython 模块。\n\n## 安装步骤\n\n### 1. 克隆仓库\n```Shell\ngit clone https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn.git\ncd tf-faster-rcnn\n```\n\n### 2. 配置 GPU 架构\n编辑 `lib\u002Fsetup.py`，根据显卡型号修改 `-arch` 参数：\n\n| GPU 型号 | Architecture 参数 |\n| :--- | :--- |\n| TitanX (Maxwell\u002FPascal) | sm_52 |\n| GTX 960M | sm_50 |\n| GTX 1080 (Ti) | sm_61 |\n| Tesla K80 (AWS p2.xlarge) | sm_37 |\n\n```Shell\ncd lib\nvim setup.py\n# 修改对应的 -arch 值\n```\n\n### 3. 编译 Cython 模块\n```Shell\nmake clean\nmake\ncd ..\n```\n\n### 4. 安装 COCO API\n项目依赖 Python COCO API 来访问数据集：\n```Shell\ncd data\ngit clone https:\u002F\u002Fgithub.com\u002Fpdollar\u002Fcoco.git\ncd coco\u002FPythonAPI\nmake\ncd ..\u002F..\u002F..\n```\n\n### 5. 数据集准备\n参考 [py-faster-rcnn 官方说明](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn#beyond-the-demo-installation-for-training-and-testing-models) 下载并配置 VOC 或 COCO 数据集。\n- 将数据放置在 `data` 目录下。\n- 无需配置预计算的 proposals（Faster RCNN 不依赖此项）。\n- *可选*：如需加速，可下载作者分享的缓存文件 [cache.tgz](http:\u002F\u002Fladoga.graphics.cs.cmu.edu\u002Fxinleic\u002Ftf-faster-rcnn\u002Fcache.tgz)。\n\n## 基本使用\n\n### 1. 下载预训练模型\n运行脚本下载 ResNet101 在 VOC 07+12 上预训练的模型：\n```Shell\n.\u002Fdata\u002Fscripts\u002Ffetch_faster_rcnn_models.sh\n```\n*注：若下载失败，可尝试从 [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F0B1_fAEgxdnvJSmF3YUlZcHFqWTQ) 手动下载并放置到对应目录。*\n\n### 2. 创建模型链接\n设置环境变量并建立软链接以指向预训练模型：\n```Shell\nNET=res101\nTRAIN_IMDB=voc_2007_trainval+voc_2012_trainval\nmkdir -p output\u002F${NET}\u002F${TRAIN_IMDB}\ncd output\u002F${NET}\u002F${TRAIN_IMDB}\nln -s ..\u002F..\u002F..\u002Fdata\u002Fvoc_2007_trainval+voc_2012_trainval .\u002Fdefault\ncd ..\u002F..\u002F..\n```\n\n### 3. 运行演示 (Demo)\n对自定义图片进行检测测试：\n```Shell\nGPU_ID=0\nCUDA_VISIBLE_DEVICES=${GPU_ID} .\u002Ftools\u002Fdemo.py\n```\n*注意：ResNet101 测试可能占用数 GB 显存。若遇到显存不足，请尝试仅安装 CPU 版本 TensorFlow 运行。*\n\n### 4. 运行测试脚本\n使用预训练的 ResNet101 模型在 VOC 数据集上进行评估：\n```Shell\nGPU_ID=0\n.\u002Fexperiments\u002Fscripts\u002Ftest_faster_rcnn.sh $GPU_ID pascal_voc_0712 res101\n```\n\n### 5. 训练自己的模型\n确保已下载 Slim 提供的 VGG16 或 ResNet V1 主干网络预训练权重，然后运行训练脚本（具体命令参考 `experiments\u002Fscripts\u002Ftrain_faster_rcnn.sh`）。","某安防团队正在构建一套基于监控视频的智能入侵检测系统，需要精准识别画面中不同尺度的人员和车辆。\n\n### 没有 tf-faster-rcnn 时\n- **小目标漏检严重**：传统检测算法难以捕捉远处或像素占比极小的入侵者，导致安全盲区频发。\n- **模型迁移成本高**：团队熟悉 TensorFlow 生态，但缺乏高质量的 Faster RCNN 实现，从 Caffe 移植代码耗时且易出错。\n- **推理速度不达标**：现有方案无法满足准实时监测需求，报警延迟高，难以支撑现场快速响应。\n- **精度调优无参考**：缺乏在 VOC 和 COCO 数据集上经过验证的基准模型，难以评估和优化当前算法性能。\n\n### 使用 tf-faster-rcnn 后\n- **小目标识别率显著提升**：得益于保留小于 16 像素提案的机制，tf-faster-rcnn 有效捕捉远距离微小目标，大幅降低漏检率。\n- **原生 TensorFlow 集成**：直接复用基于 TensorFlow 的成熟代码（支持 VGG16\u002FResNet\u002FMobileNet），无缝对接现有训练流水线，开发周期缩短 50%。\n- **实时性满足部署标准**：配合 ResNet101 等骨干网络，在单卡环境下即可实现高效推理，确保监控画面分析的低延迟。\n- **性能基线清晰可靠**：依托官方提供的详细消融实验数据（如 COCO 数据集上 ResNet101 达到 35.4 mAP），团队能快速定位优化方向并复现高水平结果。\n\ntf-faster-rcnn 通过提供高精度、原生兼容且对小目标友好的检测基线，帮助团队以最低成本构建了可靠的实时安防预警系统。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fendernewton_tf-faster-rcnn_ce067376.png","endernewton","Xinlei Chen","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fendernewton_f5fa61bc.jpg",null,"xAI","xinleic.xyz","https:\u002F\u002Fgithub.com\u002Fendernewton",[84,88,91,95,98,102,106,110],{"name":85,"color":86,"percentage":87},"Python","#3572A5",90.7,{"name":89,"color":90,"percentage":10},"Shell","#89e051",{"name":92,"color":93,"percentage":94},"Cython","#fedf5b",2.4,{"name":96,"color":97,"percentage":94},"Cuda","#3A4E3A",{"name":99,"color":100,"percentage":101},"MATLAB","#e16737",0.8,{"name":103,"color":104,"percentage":105},"Roff","#ecdebe",0.6,{"name":107,"color":108,"percentage":109},"C++","#f34b7d",0.1,{"name":111,"color":112,"percentage":113},"Makefile","#427819",0,3662,1547,"2026-04-02T08:34:53","MIT",4,"Linux","需要 NVIDIA GPU (用于编译 NMS 模块及训练\u002F测试)，支持 TitanX, GTX 960M, GTX 1080\u002FTi, Tesla K80 等架构 (sm_30 至 sm_61)。显存需求较高，Resnet101 测试可能需要数 GB 显存，内存不足时建议使用 CPU 模式。CUDA 版本需与 TensorFlow r1.2 匹配 (README 提及 Docker 镜像基于 CUDA 8)。","未说明 (但提示 Resnet101 测试可能需要数 GB 显存，若显存不足需切换至 CPU 模式)",{"notes":123,"python":124,"dependencies":125},"该项目已弃用，建议转向 TensorPack 的实现。必须手动编译 Cython 模块并配置 GPU 架构 (-arch)。若仅使用 CPU 版 TensorFlow，需在设置中禁用 GPU NMS (USE_GPU_NMS=False)。支持 VGG16, Resnet V1, Mobilenet V1 主干网络。数据预处理需遵循 py-faster-rcnn 的步骤下载 VOC 和 COCO 数据集。","未说明 (需兼容 TensorFlow r1.2 的 Python 环境)",[126,127,128,129,130],"tensorflow>=1.2","cython","opencv-python","easydict==1.6","numpy",[13,14],[133,134,135,136,137,138,139,140],"tensorflow","object-detection","faster-rcnn","coco","voc","resnet","mobilenet","tensorboard","2026-03-27T02:49:30.150509","2026-04-06T07:16:13.379872",[144,149,154,159,164,169],{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},12829,"训练过程中出现 NaN loss（损失值为非数字）怎么办？","这通常由数据标注错误引起。请检查您的 XML 标注文件：1. 确保没有空的标注文件；2. 确保边界框（bbox）坐标没有负值；3. 确保 xmax\u002Fymax 没有超过图像的宽度\u002F高度。修复这些错误的标注后，问题通常会消失。此外，如果是新数据集，尝试降低学习率（例如从 0.002 降至 0.001）也可能解决该问题。","https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F86",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},12830,"如何在没有 GPU（仅 CPU）的机器上运行此模型？","默认情况下，运行 `make` 命令会尝试查找 CUDA。如果要在纯 CPU 环境下运行，需要修改构建脚本以避免调用 `nvcc` 编译器。对于 PyTorch 版本，通常使用 `bash make.sh`，若无 GPU 需手动编辑该脚本移除 CUDA 相关的编译步骤或条件判断。注意，仅 CPU 运行速度会非常慢。","https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F25",{"id":155,"question_zh":156,"answer_zh":157,"source_url":158},12831,"在新数据集上训练时出现 'invalid value encountered in log' 警告并导致 loss 变为 NaN，原因是什么？","这通常是因为标注中的边界框坐标错误导致的。具体原因包括：1. 坐标值小于 0 (x \u003C 0)；2. 坐标值大于图像尺寸 (x > img_width 或 y > img_height)。当计算宽高比的 log 时，非法的宽高比会导致此错误。请仔细检查并修正数据集中的标注坐标。另外，适当减小学习率（如从 0.002 调至 0.001）也有助于稳定训练。","https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F135",{"id":160,"question_zh":161,"answer_zh":162,"source_url":163},12832,"使用 ResNet V2 作为基础网络时报错 'Variable ... already exists' 如何解决？","这是因为批量归一化（Batch Normalization, BN）层的位置或变量复用设置不当。解决方案是将 BN 层移动到 pool5 层之后。具体操作是在网络定义文件中，调整代码顺序，确保在 pool5 之后再应用 BN 层，这样可以避免变量重复初始化的错误。","https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F377",{"id":165,"question_zh":166,"answer_zh":167,"source_url":168},12833,"训练时遇到 'ZeroDivisionError' 零除法错误是什么原因？","该错误通常发生在 `lib\u002Froi_data_layer\u002Fminibatch.py` 文件中，断言失败 `assert(cfg.TRAIN.BATCH_SIZE % num_images == 0)`。这意味着配置的批次大小（BATCH_SIZE）不能被当前批次的图像数量整除。请检查配置文件中的 `TRAIN.BATCH_SIZE` 设置，确保它是图像数量的倍数，或者调整每次迭代输入的图像数量以匹配批次大小。","https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F160",{"id":170,"question_zh":171,"answer_zh":172,"source_url":173},12834,"项目是否支持或计划支持 ResNeXt 和 FPN（特征金字塔网络）架构？","社区用户已经尝试实现了基于 ResNet-50 的 FPN 架构。如果您需要使用 FPN，可以参考社区实现的分支（如 zacwellmer 的 repo），主要修改集中在 `lib\u002Fnets\u002Fpyramid.py` 文件中。不过，官方仓库可能未直接集成 ResNeXt，使用时可能需要自行迁移权重或参考第三方实现进行初始化。","https:\u002F\u002Fgithub.com\u002Fendernewton\u002Ftf-faster-rcnn\u002Fissues\u002F27",[175],{"id":176,"version":177,"summary_zh":178,"released_at":179},71499,"v0.12","- 支持 TensorFlow 0.1 及以上版本，直至 0.12\n- 支持 VGG16\n","2017-03-02T06:58:12"]