目标检测中的后处理方式 nms和nmm

切片辅助超推理-sahi库-get_sliced_prediction源码简析 1、get_sliced_prediction中的postprocess,默认为combine.py中的GreedyNMMPostprocess这个是核心函数,其中nmm即Non-Max Merging算法是最重要部分,它其实和nms比较类似。get_sliced_prediction源码中重要是理解nms或nmm。需要注意的是sahi的score融合只是取其最大值,没有用博客中的计算公式。sahi库中get_sliced_prediction函数如下。2、batched_greedy_nmm函数。 阅读详情

目标检测中的后处理方式 nms和nmm

今天在一个遥感的任务上需要使用到目标检测的后处理方式,并且目标的堆叠非常严重,为了搞定这种情况,需要使用到nms去除一些比较冗余的边界框,sahi这个框架中提供了三种不同的方式进行去除,这里我将他们的去除过程记录一下,方便自己后面使用。

了解每种后处理算法的具体计算步骤,能帮助我们更好地理解它们是如何工作的,以及为何会表现出不同的特性。下面我们依次深入探讨NMS、GREEDYNMM和NMM的计算流程。

🔵 NMS (非极大值抑制)

NMS的核心思想是“胜者为王”,其计算流程旨在保留每个物体最可信的检测框,并果断抑制其周围高度重叠的冗余框。

  1. 按置信度排序:首先,将所有候选边界框(Bounding Box)按照模型预测的置信度(Confidence Score)从高到低进行排序。
  2. 选取并保留最高分框:从排序后的列表中取出当前置信度最高的边界框,将其移出候选列表,并添加到最终的输出结果列表中。
  3. 计算交并比(IoU):计算这个被选中的最高分框与候选列表中所有剩余边界框的交并比(Intersection over Union, IoU)。IoU衡量了两个矩形框的重叠程度。
  4. 抑制冗余框:将IoU值超过预设阈值(例如0.5)的边界框从候选列表中移除(抑制)。这些被抑制的框被认为是与当前最高分框检测到了同一个物体。
  5. 循环迭代:重复步骤2至步骤4,直到候选列表为空。此时,输出结果列表中的边界框就是NMS处理后的最终检测结果。

🟢 NMM (非极大值合并)

NMM的核心思想是“合作共赢”,它并不直接删除重叠的框,而是将它们的信息合并,以期获得更精确的结果。其计算流程侧重于分组与合并。

  1. 按置信度排序:与NMS一样,首先将所有检测框按置信度降序排列。
  2. 构建重叠组:
    • 将置信度最高的、尚未被分组的检测框(记为D1)作为一个新组的起始。
    • 遍历所有未分组的框,如果某个框与D1的重叠度(IoU或IOS,即Intersection over Smaller area)超过阈值,则将其加入到D1所在的组中。
    • 重复此过程,直到没有更多的框可以加入该组。这样就形成了一个由高度重叠的检测框组成的“簇”。
  3. 合并组内检测框:对于每个组内的多个检测框,并非简单保留一个,而是进行合并。合并策略通常是加权平均,例如,新的边界框坐标由组内所有框的坐标根据其置信度或面积进行加权平均计算得出。新的置信度也可能是组内所有框置信度的平均值或加权平均值。
  4. 循环迭代:对剩余未分组的检测框重复步骤2和3,直到所有框都被处理完毕。最终输出的是合并后产生的、代表每个物体的一个新边界框。

🟡 GREEDYNMM (贪婪非极大合并)

GREEDYNMM可以看作是NMS和NMM的一种折中方案,它采用一种贪婪的、逐对合并的策略。

  1. 按置信度排序:同样始于按置信度降序排列所有检测框。
  2. 贪婪选择与合并:
    • 选取当前置信度最高的框作为基准框。
    • 计算它与剩余每个框的重叠度。
    • 对于重叠度超过阈值的框,并不是直接删除,而是将这个基准框与其逐对合并(通常是加权平均),生成一个新的、更精确的边界框。这个新框的置信度可能会是合并前两个框置信度的加权和(例如,按面积加权平均:New Conf = (Conf1 * Area1 + Conf2 * Area2) / (Area1 + Area2))。
  3. 更新与迭代:用合并后产生的新边界框替换原来的基准框,并将其放回候选列表中(通常需要根据新的置信度重新调整排序位置),然后继续寻找与这个新框重叠度高的框进行下一轮合并。这个过程是递归的,即合并后的新框会继续参与后续的合并。
  4. 终止条件:当某个基准框找不到重叠度超过阈值的其他框时,它将被移入最终输出列表。算法重复此过程,直到所有框都被处理完毕。

核心差异对比

为了让你更直观地把握三者的核心操作差异,可以参考下表:

算法核心操作处理重叠框的方式迭代特点
NMS选择最高分框,抑制(删除)冗余框直接删除IoU超过阈值的框线性处理,被抑制的框不再参与后续计算
NMM分组合并将高度重叠的框归为一组,然后合并组内所有框先全部完成分组,再对每个组独立进行合并
GREEDYNMM贪婪地逐对合并将重叠框与当前最高分框两两合并递归合并,合并产生的新框会继续参与后续合并

所以,结论就是直接使用GREEDYNMM是最好的办法,因为他的策略不是删除,而是合并。

目标检测中的NMS 1. NMS 非极大值抑制(Non-Maximum suppression,NMS)是目标检测算法中一个必要的后处理过程,目的是消除同一个物体上的冗余预测框。 NMS算法的主要思想是:先对网络预测出的所有边界框按照分数由高到低排序,然后选取分数最高的预测框作为target,分别计算target与其他剩下的预测框的重叠程度(用IOU来衡量),若重叠程度大于某一预先设定的阈值,则认为该预测框与target是同时负责预测同一个物体的,所以将该边界框删除,否则予以保留。接着在未被删除的预测框中选择分数最高的预测框 阅读详情

相关推荐

YOLOv10【第七章:小目标、密集目标与复杂场景优化篇·第4节】SAHI 切片辅助推理在 YOLOv10 中的应用

🏆 本文收录于 《YOLOv10实战:从入门到深度优化》 专栏。该专栏系统复现并深度梳理全网主流 YOLOv10 改进方法与工程实战案例,覆盖分类、目标检测、实例分割、多目标追踪、关键点检测、旋转目标检测等多个方向,坚持 持续更新 + 深度解析 + 工程验证。

**My Coding Family** 457

SAHI后处理算法详解:GreedyNMM、NMS、LSNMS核心原理

在目标检测任务中,当使用切片推理(Sliced Inference)技术处理大尺寸图像时,会产生大量重叠的预测框。SAHI(Slicing Aided Hyper Inference)框架提供了强大的后处理算法来优化这些检测结果,确保最终输出的准确性和完整性。🚀 SAHI后处理算法的核心目标是在保持检测精度的同时,消除冗余的预测框,提高模型性能。这些算法对于处理遥感图像、医学影像等大尺寸图像尤

gitblog_00942的博客 924

np难问题近似算法(绝版好书)

这本书在国内已经绝版。目录如下 Introduction Dorit S. Hochbaum 0.1 What can approximation algorithms do for you: an illustrative example 0.2 Fundamentals and concepts 0.3 Objectives and organization of this book 0.4 Acknowledgments I Approximation Algorithms for Scheduling Leslie A. Hall 1.1 Introduction 1.2 Sequencing with Release Dates to Minimize Lateness 1.2.1 Jacksons rule 1.2.2 A simple 3/2-approximation algorithm 1.2.3 A polynomial approximation scheme 1.2.4 Precedence constraints and preprocessing 1.3 Identical parallel machines: beyond list scheduling 1.3.1 P|rj,prec|Lmax:: list scheduling revisited 1.3.2 The LPT rule for P‖Cmax 1.3.3 The LPT rule for P|rj|Cmax 1.3.4 Other results for identical parallel machines 1.4 Unrelated parallel machines 1.4.1 A 2-approximation algorithm based on linear programming 1.4.2 An approximation algorithm for minimizing cost and makespan 1.4.3 A related result from network scheduling 1.5 Shop scheduling 1.5.1 A greedy 2-approximation algorithm for open shops 1.5.2 An algorithm with an absolute error bound 1.5.3 A 2 E -approximation algorithm for fixed job and flow shops 1.5.4 The general job shop: unit-time operations 1.6 Lower bounds on approximation for makespan scheduling 1.6.1 Identical parallel machines and precedence constraints 1.6.2 Unrelated parallel machines 1.6.3 Shop scheduling 1.7 Min-sum Objectives 1.7.1 Sequencing with release dates to minimize sum of completion times 1.7.2 Sequencing with precedence constraints 1.7.3 Unrelated parallel machines 1.8 Final remarks 2 Approximation Algorithms for Bin Packing: A Survey E. G. Coffman, Jr., M. R. Garey, and D. S. Johnson 2.1 Introduction 2.2 Worst-case analysis 2.2.1 Next fit 2.2.2 First fit 2.2.3 Best fit, worst fit, and almost any fit algorithms 2.2.4 Bounded-space online algorithms 2.2.5 Arbitrary online algorithms 2.2.6 Semi-online algorithms 2.2.7 First fit decreasing and best fit decreasing 2.2.8 Other simple offline algorithms 2.2.9 Special-case optimality, approximation schemes, and asymptotically optimal algorithms 2.2.10 Other worst-case questions 2.3 Average-case analysis 2.3.1 Bounded-space online algorithms 2.3.2 Arbitrary online algorithms 2.3.3 Offiine algorithms 2.3.4 Other average-case questions 2.4 Conclusion Approximating Covering and Packing Problems: Set Cover, Vertex Cover, Independent Set, and Related Problems Dorit S. Hachbaum 3.1 Introduction 3.1.1 Definitions, formulations and applications 3.1.2 Lower bounds on approximations 3.1.3 Overview of chapter 3.2 The greedy algorithm for the set cover problem 3.3 The LP-algorithm for set cover 3.4 The feasible dual approach 3.5 Using other relaxations to derive dual feasible solutions 3.6 Approximating the multicoverproblem 3.7 The optimal dual approach for the vertex cover and independent set problems: preprocessing 3.7.1 The complexity of the LP-relaxation of vertex cover and independent set 3.7.2 Easily colorable graphs 3.7.3 A greedy algorithm for independent set in unweighted graphs 3.7.4 A local-ratio theorem and subgraph removal 3.7.5 Additional algorithms without preprocessing 3.7.6 Summary of approximations for vertex cover and independent set 3.8 Integer programming with two variables per inequality 3.8.1 The half integrality and the linear programming relaxation 3.8.2 Computing all approximate solution 3.8.3 The equivalence of IP2 to 2-SAT and 2-SAT to vertex cover 3.8.4 Properties of binary integer programs 3.8.5 Dual feasible solutions for IP2 3.9 The maximum coverage problem and the greedy 3.9.1 Tile greedy approach 3.9.2 Applications of the maxinmum coverage problem 4 The Primal-Dual Methud for Approximation Algorithms and Its Applicatiun to Network Design Problems Michel X. Goemans and David P. Williamson 4.1 Introduction 4.2 The classical primal-dual method 4.3 Thc primal-dual method Im approximation algorithms 4.4 A model of network design problems 4.4.1 0-I functions 4.5 Downwards monotone functions 4.5.1 The edge-covering problem 4.5.2 Lower capacitated partitioning problems 4.5.3 Location-design and location-routing problems 4.5.4 Proof of Theorems 4.5 and 4.6 4.6 0-1 proper functions 4.6.1 The generalized Sterner tree problem 4.6.2 The T-join problem 4.6.3 The minimum-weight perfect matching problem 4.6.4 Point-to-point connection problems 4.6.5 Exact partitioning problems 4.7 General proper functions 4.8 Extensions 4.8.1 Mininmm multicut in trees 4.8.2 The prize-collecting problems 4.8.3 Vertex connectivity problems 4.9 Conclusions 5 Cut Problems and Their Application to Divide-and-Conquer David B. Shmoys 5.1 Introduction 5.2 Minimum multicuts and maximum multicommodity flow 5.2.1 Multicuts, maximum multicommodity flow, and a weak duality theorem 5.2.2 Fractional multicuts, pipe systems, and a strong duality theorem 5.2.3 Solving the linear programs 5.2.4 Finding a good multicut 5.3 Sparsest cuts and maximum concurrent flow 5.3.1 The sparsest cut problem 5.3.2 Reducing the sparsest cut problem to the minimum multicut problem 5.3.3 Embeddings and the sparsest cut problem 5.3.4 Finding a good embedding 5.3.5 The maximum concurrent flow problem 5.4 Minimum feedback arc sets and related problems 5.4.1 An LP-based approximation algorithm 5.4.2 Analyzing the algorithm Feedback 5.4.3 Finding a good partition 5.5 Finding balanced cuts and other applications 5.5.1 Finding balanced cuts 5.5.2 Applications of balanced cut theorems 5.6 Conclusions Approximation Algorithms for Finding Highly Connected Suhgraphs Samir KhulJer 6.1 Introduction 6.1.1 Outline of chapter and techniques 6.2 Edge-connectivity problems 6.2.1 Weighted edge-connectivity 6.2.2 Unweighted edge-connectivity 6.3 Vertex-connectivity problems 6.3.1 Weighted vertex-connectivity 6.3.2 Unweighted vertex-connectivity 6.4 Strong-connectivity problems 6.4.1 Polynomial time approximation algorithms 6.4.2 Nearly linear-time implementation 6.5 Connectivity augmentation 6.5.1 increasing edge connectivity from I to 2 6.5.2 Increasing vertex connectivity from I to 2 6.5.3 Increasing edge-connectivity to 3. Algorithms for Finding Low Degree Structures Balaji Raghavachari 7.1 Introduction 7.2 Toughness and degree 7.3 Matchings and MDST 7.4 MDST within one of optimal 7.4.1 Witness sets 7.4.2 The △* 1 algorithm 7.4.3 Performance analysis 7.5 Local search techniques 7.5.1 MDST problem 7.5.2 Constrained forest problems 7.5.3 Two-connected subgraphs 7.6 Problems with edge weights - points in Euclidean spaces 7.7 Open problems 8 Approximation Algorithms for Geometric Problems Marshall Bern and David Eppstein 8.1 Introduction 8.1.1 Overview of topics 8.1.2 Special nature of geometric problems 8.2 Traveling salesman problem 8.2.1 Christofides algorithm 8.2.2 Heuristics 8.2.3 TSP with neighborhoods 8.3 Steiner tree problem 8.3.1 Steiner ratios 8.3.2 Better approximations 8.4 Minimum weight triangulation 8.4.1 Triangulation without Steiner points 8.4.2 Steiner triangulation 8.5 Clustering 8.5.1 Minmax k-clustering 8.5.2 k-minimum spanning tree 8.6 Separation problems 8.6.1 Polygon separation 8.6.2 Polyhedron separation 8.6.3 Point set separation 8.7 Odds and ends 8.7.1 Covering orthogonal polygons by rectangles 8.7.2 Packing squares with fixed comers 8.7.3 Largest congruent subsets 8.7.4 Polygon bisection 8.7.5 Graph embedding 8.7.6 Low-degree spanning trees 8.7.7 Shortest paths in space 8.7.8 Longest subgraph problems 8.8 Conclusions 9 Various Notions of Approximations: Good, Better, Best, and More Dorit S. Hochbaum 9.1 Introduction 9.1.1 Overview of chapter 9.2 Good: fixed constant approximations 9.2.1 The weighted undirected vertex feedback set problem 9.2.2 The shortest superstring problem 9.2.3 How maximization versus minimization affects approximations 9.3 Better: approximation schemes 9.3.1 A fully polynomial approximation scheme for the knapsack problem 9.3.2 The minimum makespan and the technique of dual approximations 9.3.3 Geometric packing and covering--the shifting technique 9.4 Best: unless NP = P 9.4.1 The k-center problem 9.4.2 A powerful approximation technique for bottleneck problems 9.4.3 Best possible parallel approximation algorithms 9.5 Better than best 9.5.1 A FPAS for bin packing 9.5.2 A 9/8-approximation algorithm for ~dge coloring of multigraphs and beyond 9.6 Wonderful: within one unit of optimum 10 Hardness of Approximations San jeer Arora and Carsten Lund 10.1 Introduction 10.2 How to prove inapproximability results 10.2.1 The canonical problems 10.2.2 Inapproximability results for the canonical problems 10.2.3 Gap preserving reductions 10.3 Inapproximability results for problems in class I 10.3.1 Max-SNP 10.4 Inapproximability results for problems in class II 10.4.1 SETCOVER 10.5 Inapproximability results lor problems in class 111 10.5.1 LABELCOVER maximization version ,. 10.5.2 LABELCOVER mtn version 10.5.3 Nearest lattice vector problem 10.6 Inapproximability results for problems in class IV 10.6.1 CLIQUE 10.6.2 COLORING 10.7 Inapproximability results at a glance 10.7.1 How to prove other hardness results: a case study 10.8 prohabilistically checkable proofs and inapproximability 10.8.1 The PCP theorem 10.8.2 Connection to inapproximability of MAX-3SAT 10.8.3 Where the gap comes from 10.9 Open problems 10.10 Chapter notes 11 Randomized Approximation Algorithms in Combinatorial Optimization Rajeev Motwani, Joseph Seffi Naor, and Prabhakar Raghavan 11.1 Introduction 11.2 Rounding linear programs 11.2.1 The integer multicommodity flow problem 11.2.2 Covering and packing problems 11.2.3 The maximum satisfiability problem 11.2.4 Related work 11.3 Semidefinite programming 11.3.1 The maximum cut problem 11.3.2 The graph coloring problem 11.4 Concluding remarks 11.4.1 Derandomizafion and parallelization 11.4.2 Computational experience 11.4.3 Open problems 12 The Markov Chain Monte Carlo Method: An Approach to Approximate Counting and Integration Mark Jerrum and Alistair Sinclair 12.1 Introduction 12.2 An illustrative example 12.3 Two techniques for bounding the mixing time 12.3.1 Canonical paths 12.3.2 Conductance 12.4 A more complex example: monomer-dimer systems 12.5 More applications 12.5.1 The permanent 12.5.2 Volume of convex bodies 12.5.3 Statistical physics 12.5.4 Matroid bases: an open problem 12.6 The Metropolis algorithm and simulated annealing Appendix 13 Online Computation Sandy Irani and Anna R. Karlin 13.1 Introduction 13.2 Three examples of competitive analysis 13.2.1 Paging 13.2.2 The k-server problem 13.2.3 Metrical task systems 13.3 Theoretical underpinnings: deterministic algorithms 13.3.1 Lower bounds 13.3.2 Design principles 13.3.3 Bounding competitiveness 13.4 Theoretical underpinnings: randomized algorithms 13.4.1 Example: paging 13.4.2 Lower bounds 13.4.3 The relationships between the adversaries 13.5 The k-server problem revisited 13.5.1 History. 13.5.2 Notation and properties of work functions. 13.5.3 The work function algorithm WFA 13.5.4 Proof of 2k - 1 -competitiveness 13.5.5 The duality lemma 13.5.6 The potential function 13.5.7 Quasi-convexity and the duality lemma 13.6 Online load balancing and virtual circuit routing 13.6.1 Load balancing on unrelated machines 13.6.2 Online virtual circuit routing 13.6.3 Recent results 13.7 Variants of competitive analysis 13.8 Conclusions and directions for future research Glossary of Problems Index

目标检测系列(一)- RCNN

目标检测系列(一)- RCNN 分享在某乎上看到的一段话: 不以结婚为目的的谈恋爱,都是耍流氓; 不以盈利为目的的做生意,就是瞎扯淡; 不以输出为目的的知识输入,都是在自嗨。 瞎扯淡~回归正题~ 最近为了写论文,先后撸了rcnn,fast-rcnn,faster-rcnn,yolo,ssd,r-fcn,yolo9000等目标检测相关的论文,现在准备一篇一篇小小总...

qq_24375467的博客 919

顺序功能图基本结构

顺序功能图(Sequential Function Chart,SFC)是一种用于描述工业控制系统中顺序控制流程的图形化编程语言,广泛应用于PLC(可编程逻辑控制器)编程。其核心思想是将复杂的控制流程分解为多个有序的步骤,通过逻辑条件实现步骤间的切换。顺序功能图通过图形化的方式简化了复杂控制逻辑的设计,尤其适用于需要严格顺序控制的工业自动化场景。[初始步] → 转换条件1 → [步1] → 转换条件2 → [步2] → ...[步X] → → [步B] → 转换条件B → → [合并步]

ayingqin1的博客 1226

Visual Studio 2022 社区版安装指南:从下载到配置的完整流程

本文详细介绍了Visual Studio 2022社区版的完整安装与配置流程,包括系统要求检查、官方下载步骤、工作负载选择、安装位置配置等关键环节。作为微软推出的免费集成开发环境,VS2022社区版支持多种编程语言,适合个人开发者和小型团队使用。文章还提供了常见问题解决和性能优化技巧,帮助用户高效完成开发环境搭建。

weixin_28829339的博客 880

SAHI 切片推理结果合并(Combine)指南:NMS、NMM 与 Greedy NMM 后处理全解析

切片(Sliced/Tiled)推理是 SAHI 处理高分辨率图像的核心策略:将大图切分为多个带重叠区域的小切片分别推理,再把各切片上的预测结果拼回原图。由于切片之间存在重叠,同一目标往往被多次检出,直接拼接会得到大量重复框。本文围绕 SAHI 的 [Combine 后处理模块](https://link.gitcode.com/i/75c86971b0f74c67a4c3b2109395ee19

gitblog_00017的博客 1044

Excel数字变成了小数点+E+17?这些方法帮你解决!

本文介绍了三种解决Excel中数字变成小数点+E+17问题的方法:通过下拉箭头或右键菜单设置单元格格式为文本、使用TEXT函数将科学计数法转换为文本。这些方法各有优缺点,适用于不同的场景和需求。在实际应用中,我们可以根据具体情况选择合适的方法来解决问题。通过以上方法,我们可以轻松地从繁琐的小数点+E+17问题中解脱出来,更便捷地处理Excel中的数字。希望本文能够帮助到您,让您在使用Excel时更加得心应手!

nntxthml的博客 1246

SAHI预测结果后处理:如何避免重复检测和假阳性

SAHI(Slicing Aided Hyper Inference)是一个框架无关的切片推理工具,专门用于处理大尺寸图像的目标检测任务。在切片推理过程中,由于图像被分割成多个重叠区域进行独立检测,经常会出现重复检测和假阳性问题。本文将为您详细介绍SAHI的后处理机制,帮助您有效避免这些常见问题,提升检测结果的准确性和可靠性。😊 ## 为什么需要后处理? 在切片推理中,同一个目标可能会出现在

gitblog_00955的博客 883

一文解读DeepSeek训练数据集

本文重点以DeepSeek为例,详细介绍预训练数据集相关内容。大语言模型LLM(如DeepSeek、ChatGPT、文心一言等)的“智慧”源于它们学习的海量数据集。简单来说,数据集就是模型的“知识库”,通常由互联网公开的文本、图片、视频等。这些数据需满足两个特点:规模大和多样性。规模大是指数据量可达千亿级词汇,让模型学习复杂规律;多样性则涵盖多领域(如科技、文学)、多语言、多形式(对话、新闻),帮助模型适应不同场景。例如,训练数据中既有百科知识,也有日常对话,模型才能既解答专业问题,又能闲聊。

u013891230的博客 7089

Autosar诊断实战系列05-Dcm之0x27加解密服务配置开发详解

UDS 0x27服务实战开发介绍,对解锁尝试次数及delay时间进一步解释。

initiallizer的博客 1993

supervision IoU 与 NMS 工具详解:从重叠度量到抑制、合并的完整实现指南

本文围绕 supervision 仓库中 `docs/detection/utils/iou_and_nms.md` 所对应的 API 文档展开,系统讲解 `supervision.detection.utils.iou_and_nms` 模块中全部公开符号:重叠度量枚举(`OverlapFilter`、`OverlapMetric`)、各类 IoU 批量计算函数(轴对齐框、COCO 约定框、掩码

gitblog_01102的博客 607

Python 爬虫实战:医学临床指南爬取(含 PDF 解析与结构化存储)

在当今数字化时代,医学临床指南作为医生进行科学诊疗的重要参考资料,包含大量经过临床验证的诊疗路径和建议。这些指南通常发布在权威医学网站上,数量庞大且更新频繁。如何自动化地抓取并存储这些指南,成为医疗数据分析、医学研究以及医疗 AI 模型训练等工作的关键第一步。本文将系统讲解如何利用 Python 爬虫技术从权威医学网站爬取临床指南内容,并实现 PDF 解析与结构化存储。

u014481728的博客 449

SAHI 后处理工具模块(sahi.postprocess.utils)解析:ObjectPredictionList 与 IoU/IoS 匹配合并原理

本文是 SAHI(Framework agnostic sliced/tiled inference 工具库)后处理子系统的工具模块实战指南,核心主题是 `sahi.postprocess.utils` 中面向预测后处理的全部工具:批量预测包装器 `ObjectPredictionList`、重叠度量(IoU/IoS)、预测合并原语与 Shapely 几何修复函数。读完本文,你将掌握这些工具在切片

gitblog_00317的博客 198

Python + Playwright:集成 Applitools 进行视觉回归测试(快速入门)

Applitools是一款基于人工智能的视觉验证测试工具,专门用于自动化和验证应用程序的用户界面(UI);Applitools使用视觉回归测试来检测应用程序界面的变化,确保 UI 在不同版本之间的一致性;Applitools的核心功能是通过视觉比较,检测 UI 元素的差异,而无需手动编写复杂的界面检查代码;通过集成Applitools,测试人员可以轻松捕捉和验证界面中的视觉差异,无论是在Web移动端或桌面应用的测试环境;

blues_C的博客 2921

基于STM32L4XX、HAL库的MCP4561数字电位器驱动程序设计

/ HAL库需要左移一位。* @param address: 设备地址(0x2C-0x2F)* @param hmcp: MCP4561句柄。* @param hmcp: MCP4561句柄。* @param hmcp: MCP4561句柄。* @param hmcp: MCP4561句柄。* @param hmcp: MCP4561句柄。* @param hmcp: MCP4561句柄。* @param hmcp: MCP4561句柄。* @param hi2c: I2C句柄。

zhusl6688的博客 340

IOPaint:三步免费搞定AI图像修复,本地擦除水印与多余物体

IOPaint 是一款免费开源的 AI 图像修复工具(inpainting,即涂抹遮罩后由 AI 自动补全被遮盖的区域)。它在你的电脑上本地运行,不产生订阅费,图片也不离开你的机器:涂抹区域、选择模型、点击生成,三步就能擦掉图片里的水印、路人和多余物体,还能把画面"画"出去做扩图。 ## 修图时最头疼的两件事 先看你大概率遇到过的两个场景: - 供应商给的商品图上有半透明水印,逐像素修补一张

gitblog_00978的博客 221

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SAHI 切片辅助推理(Slicing Aided Hyper Inference)完整实战指南:面向大图像小目标检测的轻量级视觉库

SAHI(Slicing Aided Hyper Inference)是一个面向大尺寸图像中**小目标检测**与实例分割场景的轻量级视觉库,它通过"切片-检测-合并"(Slice-Detect-Merge)三段式流程,让任何主流检测框架的模型在不重新训练的情况下,也能在大图(如 4K 航拍照片、卫星影像、高分辨率巡检图)上稳定检出小目标。阅读本文后,你将掌握 SAHI 的安装方式、`AutoDet

gitblog_00812的博客 1127

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

SAHI中的切片策略

SAHI库的get_sliced_prediction函数通过智能图像切片提升大图像和小目标检测效果。核心参数包括:切片尺寸控制(slice_height/width)、重叠比例(overlap_ratio)、后处理算法选择(NMS/NMM/GREEDYNMM)以及是否执行标准预测(perform_standard_pred)。该函数通过自动切片分辨率、交小比度量标准等特性优化小目标检测,同时支持结果合并与内存控制,在精度和效率间取得平衡。参数配置需根据目标大小、图像分辨率等场景特点调整,如小目标检测建议使

dejahu的博客 685

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Tensor版nms

xx1 = torch.max(x1[i], x1[order[1:]]) # 交叉区域的左上角的横坐标。yy1 = torch.max(y1[i], y1[order[1:]]) # 交叉区域的左上角的纵坐标。xx2 = torch.min(x2[i], x2[order[1:]]) # 交叉区域右下角的横坐标。yy2 = torch.min(y2[i], y2[order[1:]]) # 交叉区域右下角的纵坐标。i = order[0] # 置信度最高的 bounding box 的索引。

qq_39322426的博客 103

SAHI 切片推理(Sliced Inference)完全指南:大图中检测小目标的切块-检测-合并原理与实战调优

SAHI 切片推理是框架无关(framework agnostic)的大图小目标检测方案:它把大幅图像切成与检测器输入分辨率匹配的相互重叠图块,在每个图块上独立推理,再把预测结果映射回原图并去重合并,全程无需重新训练模型。读完本文,你将掌握 `get_sliced_prediction` 的完整调用方式、全部关键参数(切片尺寸、重叠比例、后处理策略、批大小、后端加速)的取值依据,以及结合源码层面的

gitblog_00502的博客 191

SAHI 切片推理(Sliced Inference)原理与实战:破解大图小目标检测难题

本文系统讲解 SAHI 框架中「切片推理」(Sliced / Tiled Inference)的完整原理:当输入图像远大于检测模型输入分辨率时,如何通过"切块 → 逐块推理 → 合并回原图"三步流程,让被缩放抹掉的小目标重新获得足够的像素细节,从而被稳定检出。读完本文,你将掌握 `slice_height/slice_width`、`overlap_*_ratio`、`auto_slice_res

gitblog_00787的博客 436

SAHI(Slicing Aided Hyper Inference)技术指南:面向大图小目标检测的分片推理实战

SAHI 是一个框架无关的轻量级计算机视觉库,通过 **Sliced Inference(分片推理)** 技术解决大尺寸图像中微小目标检测这一现实难题:把大图切成带重叠的切片、逐片送入任意检测模型、再把结果合并回原图,全程无需对模型重新训练。阅读本篇后,你将掌握 SAHI 的安装与框架搭配方式、全部 CLI 命令的用法与参数含义、Python 侧 `AutoDetectionModel` + `g

gitblog_01173的博客 89

reverse-engineer-anything 实战指南:让 AI 助手逆向没有源码的二进制与 JS 应用,证据可回溯

周五下午,QA 把一个装好的 Electron 客户端丢给我:里面有第三方组件在发网络请求,要不要上线前处理,没人说得清。没有源码,只有打包产物。我让接入了 **reverse-engineer-anything**(下称 REA)的 AI 助手去分析这个客户端,它做的是**逆向工程**:从成品里还原功能怎么跑、数据经过哪些模块,并且每个结论都带回地址、源码行号或字符串这类可回溯的证据。它面向的就

gitblog_00379的博客 772
上一篇: GMT的安装和使用
下一篇: SAHI中的切片策略
肆十二
肆十二 优质创作者: 人工智能技术领域 优质创作者: 人工智能技术领域
博客等级 码龄9年 2万+粉丝 241原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

肆十二

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值