IOU发展历程学习记录

news2024/9/25 3:20:47

概述

IOU的出现主要最先运用在预测bbox框和target bbox框之间的重叠问题,为NMS提供相应的数值支撑。另外在bbox框的回归问题上,由于L1 Loss存在如下问题:当损失函数对x的导数为常数,在训练后期,x很小时,若学习率不变,损失函数会在稳定值附近波动,很难收敛到更高的精度。而L2 Loss存在如下问题:当损失函数对x的导数在x值很大时,其导数也非常大,在训练初期不稳定。L1/L2 Loss的坐标回归不具有尺度不变性,且没有将四个坐标之间的相关性考虑进去。因此,基于L1/L2 Loss的坐标回归实际上很难描述两框之间的相对位置关系。

而IOU天然是衡量两个bbox框之间的重叠程度,以自身四个点作为回归对象,具备尺度不变性。实际计算中通常以1-IOU作为loss,主要是当框的重合度特别高的时候,需要的惩罚相对较少,而当两个框重合度较低时,需要的惩罚就相对比较大。IOU的取值范围为【0,1】,当两者完全重合时,loss为0,当两者完全不重合时,取值为0。

从上面概述也能够了解,IOU作为loss在优化过程中必然会存在一些问题,比如两者不相交,无法产生梯度,再比如两者相互包含,但是位置不同如何继续快速优化等等的问题,这些问题都会归于:重叠比例、长宽比例、中心点比例等等,因此IOU发展史必然就是一个发现问题,解决问题,然后再发现再解决的过程。下面不妨随我一道走马观花,看看IOU的发展。

1、IOU

论文地址:https://arxiv.org/abs/1608.01471

IOU时用于衡量两个bbox框的重叠程度,那么具体是如何衡量的了?直观上来讲就是【交并比】,实际情况就如下图所示,A和B的交集是两个bbox框的蓝色交叠部分,A和B的并集是两个bbox框的所有合并部分,A和B交集和并集的比值就是我们所谓的IOU。
在这里插入图片描述
IOU作为坐标回归的loss函数,具有如下三个优点

  • 尺度不变性
  • 非负性
  • 对称性
    在这里插入图片描述

但是它存在一定的问题

  • 两个框没有相交时,无法比较框的距离远近,不相交的两个框也不会产生梯度,无法优化;
  • IoU无法区分两个框之间不同的对齐方式。更确切地讲,不同方向上有相同交叉级别的两个重叠对象的IoU会完全相等。
    在这里插入图片描述

IOU的实现方式比较简单,具体实现代码如下:

def iou(bbox1, bbox2, eps=1e-8):
    """
    :param bbox1:  [x1y1x2y2]
    :param bbox2:  [x1y1x2y2]
    :return:
    """
    # insertion
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    area_1 = (bbox1[2] - bbox1[0]) * (bbox1[3] - bbox1[1])
    area_2 = (bbox2[2] - bbox2[0]) * (bbox2[3] - bbox2[1])
    area_union = area_1 + area_2 - w_insert * h_insert + eps
    iou_val = float(w_insert * h_insert) / area_union
    return iou_val

论文中关于IOU LOSS的实现算法如下图所示,实际上就是-ln(IOU),实际运用中都是使用1-IOU来代替IOU loss。
在这里插入图片描述

2、GIOU

论文地址:https://arxiv.org/abs/1902.09630

IOU loss出现两个框没有交集无法进行梯度回传的情况,GIOU的出现主要就是解决这个问题。
那GIOU是怎么定义的了?
在这里插入图片描述
其中C是bbox框A和B的最小外接矩形的面积
从公式来看,考虑了两个bbox框最小外接矩形除去交集以外的部分,使得GIOU的取值范围为【-1,1】,当A和B没有交集且相距无限远的时候,GIOU为-1,而当两者完全重合的时候,GIOU和IOU一样都为1。

论文中实现的方法如下:
在这里插入图片描述
在这里插入图片描述

GIOU相对于IOU的改进

  • 相对于IOU来说只关注重叠区域,GIOU不仅关注重叠区域还关注非重叠区域,这样的好处是可以解决两个bbox框没有交集时仍然有梯度回传,可以继续进行优化。
  • 完善了两个bbox框的重叠区域优化

仍然存在的问题

  • GIOU没有考虑长宽比、中心距离等信息,会导致两个bbox框相互包含时,虽然IOU或者GIOU相同,但是却位置上却不尽相同,无法找到更好的优化方向

按照上面的GIOU的公式,使用python复现,具体实现代码如下:

def Giou(bbox1, bbox2, eps=1e-8):
 ## 解决的问题是预测框和目标狂不重合,梯度为0, 无法进行优化的问题
   """
    :param bbox1:  [x1y1x2y2]
    :param bbox2:  [x1y1x2y2]
    :return:
    """
    # insertion
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    area_1 = (bbox1[2] - bbox1[0]) * (bbox1[3] - bbox1[1])
    area_2 = (bbox2[2] - bbox2[0]) * (bbox2[3] - bbox2[1])
    area_union = area_1 + area_2 - w_insert * h_insert + eps

    # enclosing area
    enclose_left = min(bbox1[0], bbox2[0])
    enclose_top = min(bbox1[1], bbox2[1])
    enclose_right = max(bbox1[2], bbox2[2])
    enclose_bottom = max(bbox1[3], bbox2[3])

    enclose = max(0, enclose_right - enclose_left) * max(0, enclose_bottom - enclose_top) + eps
    iou_val = float(w_insert * h_insert) / area_union
    giou_val = iou_val - (enclose - area_union) / enclose
    return giou_val

3、DIOU

论文地址:https://arxiv.org/abs/1911.08287

IOU作为边框回归的Loss函数主要考虑的三点因素为:重叠面积、中心点距离、长宽比等,重叠面积实际上在IOU和GIOU中予以充分考虑了。但仅考虑重叠面积会存在问题:当预测框和真是框之间存在包含关系的时,不同位置的IOU和GIOU都是相同的(此时GIOU已经退化为IOU了),因此仅仅考虑重叠面积已经无法继续优化,具体的情况去下所示:
在这里插入图片描述
DIOU Loss的计算公式如下所,相对于IOU本身来说,主要考虑了预测框和真实框中心点之间的距离和最小包围框之间的距离。
在这里插入图片描述
在这里插入图片描述
DIoU的特点如下

  • DIOU与IOU、GIOU一样具有尺度不变性
  • DIOU与GIOU一样在与目标框不重叠时,仍然可以为边界框提供移动方向
  • DIOU可以直接最小化两个目标框的距离,因此比GIOU Loss收敛快得多
  • DIOU在包含两个框水平/垂直方向上的情况回归很快,而GIOU几乎退化为IOU
  • 当预测框和真实框完全重叠,DIOU Loss为0

DIOU的具体实现代码如下所示:

def Diou(bbox1, bbox2, eps=1e-8):
    # 主要解决预测框和真实框具有包含关系时候,Giou失效问题,考虑了重叠面积和中心点距离
     """
    :param bbox1:  [x1y1x2y2]
    :param bbox2:  [x1y1x2y2]
    :return:
    """
    # insertion
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    area_1 = (bbox1[2] - bbox1[0]) * (bbox1[3] - bbox1[1])
    area_2 = (bbox2[2] - bbox2[0]) * (bbox2[3] - bbox2[1])
    area_union = area_1 + area_2 - w_insert * h_insert + eps

    # enclosing coord
    enclose_left = min(bbox1[0], bbox2[0])
    enclose_top = min(bbox1[1], bbox2[1])
    enclose_right = max(bbox1[2], bbox2[2])
    enclose_bottom = max(bbox1[3], bbox2[3])
    enclose_distance = math.pow((enclose_right - enclose_left), 2) + math.pow((enclose_bottom - enclose_top), 2) + eps
    # bbox center
    cx1 = (bbox1[0] + bbox1[2]) / 2.0
    cy1 = (bbox1[1] + bbox1[3]) / 2.0
    cx2 = (bbox2[0] + bbox2[2]) / 2.0
    cy2 = (bbox2[1] + bbox2[3]) / 2.0
    center_distance = math.pow((cx2 - cx1), 2) + math.pow((cy2 - cy1), 2)
    iou_val = float(w_insert * h_insert) / area_union
    doiu_val = iou_val - float(center_distance) / enclose_distance
    return doiu_val

存在问题:
虽然DIOU能够直接最小化预测框和真实框的中心点距离加速收敛,但是Bounding box的回归还有一个重要的因素纵横比暂未考虑

4、CIoU

论文地址:https://arxiv.org/abs/2103.11696

CIOU Loss 和 DIOU Loss出自同一篇文章,CIOU在DIOU的基础上将Bounding box的纵横比考虑进损失函数中,进一步提升了回归精度。

CIoU Loss的计算公式如下所示:
在这里插入图片描述
相对于DIoU来说,只是对增加了一项alpha和V,其具体计算方式如下:
在这里插入图片描述

CIou的具体实现代码如下:

def Ciou(bbox1, bbox2, eps=1e-8):
    # 在DIOU上面做优化,考虑了中心距离、重叠面积、长宽比
    # insertion
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    w1 = bbox1[2] - bbox1[0]
    h1 = bbox1[3] - bbox1[1]
    w2 = bbox2[2] - bbox2[0]
    h2 = bbox2[3] - bbox2[1]
    area_1 = w1 * h1
    area_2 = w2 * h2
    area_union = area_1 + area_2 - w_insert * h_insert + eps

    # enclosing coord
    enclose_left = min(bbox1[0], bbox2[0])
    enclose_top = min(bbox1[1], bbox2[1])
    enclose_right = max(bbox1[2], bbox2[2])
    enclose_bottom = max(bbox1[3], bbox2[3])
    enclose_distance = math.pow((enclose_right - enclose_left), 2) + math.pow((enclose_bottom - enclose_top), 2) + eps
    # bbox center
    cx1 = (bbox1[0] + bbox1[2]) / 2.0
    cy1 = (bbox1[1] + bbox1[3]) / 2.0
    cx2 = (bbox2[0] + bbox2[2]) / 2.0
    cy2 = (bbox2[1] + bbox2[3]) / 2.0
    center_distance = math.pow((cx2 - cx1), 2) + math.pow((cy2 - cy1), 2)

    iou_val = float(w_insert * h_insert) / area_union

    # av
    v = 4 / math.pi * math.pow((math.atan(w1 / (h1 + eps)) - math.atan(w2 / (h2 + eps))), 2)
    alfa = v / ((1 - iou_val) + v + eps)

    coiu_val = iou_val - float(center_distance) / enclose_distance - alfa * v
    return coiu_val

存在的问题:
纵横比权重的设计还需要继续优化,以获取更好的方案。

5、EIoU

论文地址:https://arxiv.org/abs/2101.08158

CIOU Loss虽然考虑了边界框回归的重叠面积、中心点距离、纵横比。但是通过其公式中的v反映的是纵横比的差异,而非宽高分别与其置信度的真实差异。因此作者在原始CIoU的基础上改进纵横比的情况得到了EIoU,并考虑到框的样本不均衡性,使用了类Focal Loss的设计方式,得到了Focal-EIoU。

EIoU Loss的具体计算公式如下:
在这里插入图片描述

EIOU具体实现代码如下:

def Eiou(bbox1, bbox2, eps=1e-8):
    # insertion
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    w1 = bbox1[2] - bbox1[0]
    h1 = bbox1[3] - bbox1[1]
    w2 = bbox2[2] - bbox2[0]
    h2 = bbox2[3] - bbox2[1]
    area_1 = w1 * h1
    area_2 = w2 * h2
    area_union = area_1 + area_2 - w_insert * h_insert + eps

    # enclosing coord
    enclose_left = min(bbox1[0], bbox2[0])
    enclose_top = min(bbox1[1], bbox2[1])
    enclose_right = max(bbox1[2], bbox2[2])
    enclose_bottom = max(bbox1[3], bbox2[3])
    enclose_distance = math.pow((enclose_right - enclose_left), 2) + math.pow((enclose_bottom - enclose_top), 2) + eps
    # bbox center
    cx1 = (bbox1[0] + bbox1[2]) / 2.0
    cy1 = (bbox1[1] + bbox1[3]) / 2.0
    cx2 = (bbox2[0] + bbox2[2]) / 2.0
    cy2 = (bbox2[1] + bbox2[3]) / 2.0
    center_distance = math.pow((cx2 - cx1), 2) + math.pow((cy2 - cy1), 2)

    iou_val = float(w_insert * h_insert) / area_union

    # cw ch w-wgt h-hgt
    cw = enclose_right - enclose_left
    ch = enclose_bottom - enclose_top
    w_distance = math.pow((w1 - w2), 2)
    h_distance = math.pow((h1 - h2), 2)

    eiou_val = iou_val - float(center_distance) / enclose_distance - w_distance / (
            math.pow(cw, 2) + eps) - h_distance / (math.pow(ch, 2) + eps)
    return eiou_val

6、αIoU

论文地址:https://arxiv.org/abs/2110.13675

作者将现有的基于IoU Loss推广到一个新的Power IoU系列 Loss,该系列具有一个Power IoU项和一个附加的Power正则项,具有单个Power参数α,称这种新的损失系列为α-IoU Loss。

该文章主要的贡献如下:

  • 提出了一种新的power IoU损失函数,称为α-IoU,用于精确的bbox回归和目标检测。α-IoU是基于IoU的现有损失的统一幂化;
  • 分析了α-IoU的一系列性质,包括顺序保留和损失/梯度重加权,表明适当选择α(即α > 1)有助于提高High IoU目标的损失和梯度自适应加权的bbox回归精度;
  • 经验表明,在多个目标检测数据集和模型上,α-IoU损失优于现有的基于IoU的损失,并为小数据集和噪声Box提供更强的鲁棒性。

αIoU设计如下所示:
在这里插入图片描述

αIoU具体实现代码如下:

def alfa_iou(bbox1, bbox2, eps=1e-8, alfa=1, iou_type='iou'):
    assert iou_type in ['iou', 'giou', 'diou', 'ciou', 'eiou'], 'iou_type is not in the vanlid range type'
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    w1 = bbox1[2] - bbox1[0]
    h1 = bbox1[3] - bbox1[1]
    w2 = bbox2[2] - bbox2[0]
    h2 = bbox2[3] - bbox2[1]
    area_1 = w1 * h1
    area_2 = w2 * h2
    area_union = area_1 + area_2 - w_insert * h_insert + eps
    if iou_type in ['iou']:
        iou_val_alfa = math.pow(float(w_insert * h_insert) / area_union, alfa)
        return iou_val_alfa

    # enclosing coord
    enclose_left = min(bbox1[0], bbox2[0])
    enclose_top = min(bbox1[1], bbox2[1])
    enclose_right = max(bbox1[2], bbox2[2])
    enclose_bottom = max(bbox1[3], bbox2[3])
    if iou_type in ['giou']:
        enclose = max(0, enclose_right - enclose_left) * max(0, enclose_bottom - enclose_top) + eps
        iou_val = float(w_insert * h_insert) / area_union
        iou_val_alfa = math.pow(iou_val, alfa) - math.pow((enclose - area_union) / enclose, alfa)

    if iou_type in ['diou', 'ciou', 'eiou']:
        # bbox center
        cx1 = (bbox1[0] + bbox1[2]) / 2.0
        cy1 = (bbox1[1] + bbox1[3]) / 2.0
        cx2 = (bbox2[0] + bbox2[2]) / 2.0
        cy2 = (bbox2[1] + bbox2[3]) / 2.0
        center_distance = math.pow((cx2 - cx1), 2 * alfa) + math.pow((cy2 - cy1), 2 * alfa)
        enclose_distance = math.pow((enclose_right - enclose_left), 2 * alfa) + math.pow((enclose_bottom - enclose_top),
                                                                                         2 * alfa) + eps
        iou_val = float(w_insert * h_insert) / area_union
        if iou_type in ['diou']:
            iou_val_alfa = math.pow(iou_val, alfa) - float(center_distance) / enclose_distance

        elif iou_type in ['ciou']:
            # av
            v = 4 / math.pi * math.pow((math.atan(w1 / (h1 + eps)) - math.atan(w2 / (h2 + eps))), 2)
            alfa2 = v / ((1 - iou_val) + v + eps)
            iou_val_alfa = math.pow(iou_val, alfa) - float(center_distance) / enclose_distance - math.pow(alfa2 * v,
                                                                                                          alfa)
        else:  ## eiou
            # cw ch w-wgt h-hgt
            cw = enclose_right - enclose_left
            ch = enclose_bottom - enclose_top
            w_distance = math.pow((w1 - w2), 2 * alfa)
            h_distance = math.pow((h1 - h2), 2 * alfa)
            iou_val_alfa = math.pow(iou_val, alfa) - float(center_distance) / enclose_distance - w_distance / (
                    math.pow(cw, 2 * alfa) + eps) - h_distance / (math.pow(ch, 2 * alfa) + eps)
    return iou_val_alfa

7、SIoU

论文地址:https://arxiv.org/abs/2205.12740

传统的目标检测损失函数依赖于边界框回归的度量集合,如距离、重叠面积和纵横比预测和真实框的比率,迄今为止提出和使用的方法都没有考虑到真实框与预测框之间不匹配的方向。这种不足导致更慢和更少有效的收敛,因为预测框可能在训练过程中“徘徊”,并且最终会产生更差的模型,SIou的提出正好是解决这个问题。
在这里插入图片描述
SIoU损失函数要考虑4方面的损失:

  • Angle cost
    在这里插入图片描述

  • Distance cost
    在这里插入图片描述

  • Shape cost
    在这里插入图片描述

  • IoU cost
    在这里插入图片描述
    最终Siou Loss的定义如下:
    在这里插入图片描述

SIoU具体实现代码如下:

def Siou(bbox1, bbox2, eps=1e-8, threta=4):
    ## 参考美团实现
    # insertion
    left = max(bbox1[0], bbox2[0])
    top = max(bbox1[1], bbox2[1])
    right = min(bbox1[2], bbox2[2])
    bottom = min(bbox1[3], bbox2[3])
    w_insert = max(0, right - left)
    h_insert = max(0, bottom - top)
    # union
    w1 = bbox1[2] - bbox1[0]
    h1 = bbox1[3] - bbox1[1]
    w2 = bbox2[2] - bbox2[0]
    h2 = bbox2[3] - bbox2[1]
    area_1 = w1 * h1
    area_2 = w2 * h2
    area_union = area_1 + area_2 - w_insert * h_insert + eps
    iou_val = float(w_insert * h_insert) / area_union

    # enclosing coord
    enclose_left = min(bbox1[0], bbox2[0])
    enclose_top = min(bbox1[1], bbox2[1])
    enclose_right = max(bbox1[2], bbox2[2])
    enclose_bottom = max(bbox1[3], bbox2[3])
    cw = enclose_right - enclose_left
    ch = enclose_bottom - enclose_top

    # bbox center
    cx1 = (bbox1[0] + bbox1[2]) / 2.0
    cy1 = (bbox1[1] + bbox1[3]) / 2.0
    cx2 = (bbox2[0] + bbox2[2]) / 2.0
    cy2 = (bbox2[1] + bbox2[3]) / 2.0
    sigma = math.pow((cx2 - cx1), 2) + math.pow((cy2 - cy1), 0.5)

    sin_alpha_1 = math.fabs(cx2 - cx1) / sigma
    sin_alpha_2 = math.fabs(cy2 - cy1) / sigma

    threshold = math.pow(2, 0.5) / 2
    sin_alpha = sin_alpha_2 if sin_alpha_1 > threshold else sin_alpha_1
    angle_cost = math.cos(math.asin(sin_alpha) * 2 - math.pi / 2)  ### 1-sin(x)^2 = cos(2x)
    rho_x = math.pow((cx2 - cx1) / cw, 2)
    rho_y = math.pow((cy2 - cy1) / ch, 2)
    gamma = angle_cost - 2
    distance_cost = 2 - math.exp(gamma * rho_x) - math.exp(gamma * rho_y)
    omiga_w = math.fabs(w1 - w2) / max(w1, w2)
    omiga_h = math.fabs(h1 - h2) / max(h1, h2)
    shape_cost = math.pow(1 - math.exp(-omiga_w), threta) + math.pow(1 - math.exp(-omiga_h), threta)
    siou = iou_val - 0.5 * (distance_cost + shape_cost)
    return siou

8、Wise-IOU

论文地址:https://arxiv.org/abs/2301.10051
作者导读:Wise-IoU 作者导读:基于动态非单调聚焦机制的边界框损失

参考
https://zhuanlan.zhihu.com/p/452207890
https://zhuanlan.zhihu.com/p/270663039
https://blog.csdn.net/amusi1994/article/details/125176515

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/731804.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

GEE:基于MODIS土地覆盖类型“混交林”的净初级生产力(NPP)的区域统计

作者:CSDN @ _养乐多_ 本文将介绍如何使用Google Earth Engine(GEE)平台提取特定地区的净初级生产力(NPP)的统计信息,并在地图上可视化。通过加载MODIS数据集,并使用GEE提供的函数和方法,能够高效地计算特定地区的净初级生产力的平均值。 文章目录 一、代码详解二、代…

大模型的数据供血系统-向量数据库常识科普

1. 数据库行业有了新动向 对于传统数据库研发运维来说,数据库行业上次有概念创新,还是十几年前的NoSQL…… 在AI大行业发展的推进下,向量数据库成为了最新兴的数据库技术趋势,业内多家开源向量数据库都拿到了高额融资,…

《网络是怎样连接的》-户根勤

第一章:浏览器生成消息-探索浏览器内部 主要讲HTTP消息、DNS和委托协议栈发送消息。 第二章:用电信号传输TCP/IP数据-探索协议栈和网卡 主要讲套接字的创建、连接、通信、断开和删除四个阶段;IP与以太网的包收发阶段;UDP协议的收…

使用LocalThread获取当前线程的用户ID错误

说明:LocalThread是线程变量,可以往该线程变量中填充我们项目用户的ID,可以在其他的业务代码中直接获取,十分方便,详细参考:http://t.csdn.cn/k75rs LocalThread使用 第一步:创建类 创建一个…

北京市自动驾驶出行服务商业化试点启动,无人驾驶会是未来吗?

北京市高级级别自动驾驶示范区工作办公室公告称,智能网联乘用车“车内无人”商业化试点正式启动。根据最新修订的《北京市智能网联汽车政策先行区自动驾驶出行服务商业化试点管理细则(试行)》,企业在满足相关要求后,可…

如何用https协议支持小程序

步骤一:下载SSL证书 登录数字证书管理服务控制台。在左侧导航栏,单击SSL 证书。在SSL证书页面,定位到目标证书,在操作列,单击下载。 在服务器类型为Nginx的操作列,单击下载。 解压缩已下载的SSL证书压缩…

English Learning - L3 作业打卡 Lesson8 Day58 2023.7.3 周一

English Learning - L3 作业打卡 Lesson8 Day58 2023.7.3 周一 引言🍉句1: And this is when I learned that our borders and our obstacles can only do two things: one, stop us in our tracks or two, force us to get creative.成分划分弱读连读爆破语调 &…

无线基站与无线频谱资源

文章目录 基站的主要组成天线馈线(电缆线)RRU(射频拉远单元,Remote Radio Unit)BBU(室内基带处理单元,Building Base band Unit)AAU(有源天线单元,Active Ant…

Summer test

目录 第一个只出现一次的字符判定字符是否唯一 第一个只出现一次的字符 原题链接&#xff1a;第一个只出现一次的字符 int FirstNotRepeatingChar(char* str ) {int arr[200] {0};int len strlen(str);int i0;for(i0;i<len;i){arr[str[i]];}for(i0;i<len;i){if(arr[s…

[ABC218G] Game on Tree 2 树上游戏

[ABC218G] Game on Tree 2 树上游戏 文章目录 [ABC218G] Game on Tree 2 树上游戏题面翻译输入格式输出格式样例 #1样例输入 #1样例输出 #1 样例 #2样例输入 #2样例输出 #2 样例 #3样例输入 #3样例输出 #3 题目大意分析水法code 正解code 题面翻译 给定一棵树&#xff0c;以及…

leetcode 106. 从中序与后序遍历序列构造二叉树

2023.7.8 让我很难受的一道题&#xff0c;个人感觉难度不止中等。 首先要知道的是知道了前序/后序 中序 之后&#xff0c;是可以构造出相应且唯一的二叉树的。 本道题的思路通过递归的方式根据中序遍历数组和后序遍历数组构建二叉树&#xff0c;并返回根节点。递归的结束条…

【通览一百个大模型】Anthropic LLM(Anthropic)

【通览一百个大模型】Anthropic LLM&#xff08;Anthropic&#xff09; 作者&#xff1a;王嘉宁&#xff0c;本文章内容为原创&#xff0c;仓库链接&#xff1a;https://github.com/wjn1996/LLMs-NLP-Algo 订阅专栏【大模型&NLP&算法】可获得博主多年积累的全部NLP、大…

Ubuntu安装VMtools实现与主机之间复制粘贴

目录 一、安装 VMware Tools 二、Ubuntu命令 一、安装 VMware Tools 右键点击你创建的系统&#xff0c;然后出现菜单下滑找到安装 VMware Tools&#xff08;T&#xff09; 这个点击安装&#xff1b; 右键点击你创建的系统&#xff0c;然后出现菜单下滑找到设置; 然后弹出虚…

USB转串口那些事儿—电源与防倒灌设计

USB转串口芯片和串口负载&#xff08;MCU、CPU、其他串口外设等&#xff09;的供电方式可以分为2个大类&#xff1a;统一供电和独立供电。 一、供电说明 统一供电是指USB芯片和串口负载使用同一电源&#xff0c;上下电同步&#xff0c;此时不会存在彼此之间电流倒灌的问题。 …

【异常错误】Unexpected option: --local_rank=0(pycharm可以run但是不可以debug)

今天在使用用run运行shell文件转为的cmd命令后&#xff0c;run可以正常运行&#xff0c;但是debug却出现问题&#xff0c;错误信息&#xff1a; Usage:pydevd.py --port N [(--client hostname) | --server] --file executable [file_options] Traceback (most recent call la…

复习C中文件操作

文章目录 Ⅰ. 重新谈论文件Ⅱ. C语言中的文件接口1、打开文件2、关闭文件3、读写函数4、文件的随机读写① fseek函数&#xff08;指定文件指针的位置&#xff09;② ftell函数&#xff08;求文件指针与起始位置的偏移量&#xff09;③ rewind&#xff08;让文件指针回到起始位置…

pdf转为ppt的超简单方法,就用这几个!

在我们的工作和生活中&#xff0c;PDF文件是不可或缺的文件格式之一。它以高准确性、整齐的页面排版和流畅的翻页而闻名&#xff0c;为我们处理文档提供了很大的帮助。然而&#xff0c;PDF文件的一个缺点是无法进行修改。当我们不小心输入错误数据或需要进行编辑时&#xff0c;…

python 常用数据结构-集合

Set集合 Set 集合集合定义集合使用&#xff1a;创建集合使用&#xff1a;成员检测集合方法集合方法 add()集合方法 update()集合方法 remove()集合方法 discard()集合方法 pop()集合方法 clear() 集合运算集合运算&#xff1a;交集集合运算&#xff1a;并集集合运算&#xff1a…

JAVA结课作品——超市管理系统

项目描述&#xff1a;一个简单的超市管理系统&#xff0c;能够实现用户登入和注册功能&#xff0c;共分为前台和后台两个主要界面&#xff0c;普通用户界面操作权限收到限制&#xff0c;只能对商品和销售记录进行简单查询操作&#xff0c;后台中可以进行商品的删除、修改、查询…

Java 设计模式——单例模式

目录 1.结构2.实现2.1.饿汉式2.1.1.静态变量2.1.2.静态代码块2.1.3.枚举方式 2.2.懒汉式2.2.1.synchronized 线程安全2.2.2.双重检查锁2.2.3.静态内部类方式 3.破坏单例模式3.1.序列化反序列化3.2.反射 4.问题解决5.JDK 源码解析——Runtime 类 1.结构 &#xff08;1&#xff…