Python将原始数据集和标注文件进行数据增强(随机仿射变换),并生成随机仿射变换的数据集和标注文件

Python将原始数据集和标注文件进行数据增强(随机仿射变换),并生成随机仿射变换的数据集和标注文件

  • 前言
  • 前提条件
  • 相关介绍
  • 实验环境
  • 生成随机仿射变换的数据集和标注文件
    • 代码实现
    • 输出结果

在这里插入图片描述

前言

  • 由于本人水平有限,难免出现错漏,敬请批评改正。
  • 更多精彩内容,可点击进入Python日常小操作专栏、OpenCV-Python小应用专栏、YOLO系列专栏、自然语言处理专栏或我的个人主页查看
  • YOLOv8 Ultralytics:使用Ultralytics框架训练RT-DETR实时目标检测模型
  • 基于DETR的人脸伪装检测
  • YOLOv7训练自己的数据集(口罩检测)
  • YOLOv8训练自己的数据集(足球检测)
  • YOLOv5:TensorRT加速YOLOv5模型推理
  • YOLOv5:IoU、GIoU、DIoU、CIoU、EIoU
  • 玩转Jetson Nano(五):TensorRT加速YOLOv5目标检测
  • YOLOv5:添加SE、CBAM、CoordAtt、ECA注意力机制
  • YOLOv5:yolov5s.yaml配置文件解读、增加小目标检测层
  • Python将COCO格式实例分割数据集转换为YOLO格式实例分割数据集
  • YOLOv5:使用7.0版本训练自己的实例分割模型(车辆、行人、路标、车道线等实例分割)
  • 使用Kaggle GPU资源免费体验Stable Diffusion开源项目

前提条件

  • 熟悉Python

相关介绍

  • Python是一种跨平台的计算机程序设计语言。是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越多被用于独立的、大型项目的开发。
  • PyTorch 是一个深度学习框架,封装好了很多网络和深度学习相关的工具方便我们调用,而不用我们一个个去单独写了。它分为 CPU 和 GPU 版本,其他框架还有 TensorFlow、Caffe 等。PyTorch 是由 Facebook 人工智能研究院(FAIR)基于 Torch 推出的,它是一个基于 Python 的可续计算包,提供两个高级功能:1、具有强大的 GPU 加速的张量计算(如 NumPy);2、构建深度神经网络时的自动微分机制。
  • YOLOv5是一种单阶段目标检测算法,该算法在YOLOv4的基础上添加了一些新的改进思路,使其速度与精度都得到了极大的性能提升。它是一个在COCO数据集上预训练的物体检测架构和模型系列,代表了Ultralytics对未来视觉AI方法的开源研究,其中包含了经过数千小时的研究和开发而形成的经验教训和最佳实践。
  • Labelme是一款图像标注工具,由麻省理工(MIT)的计算机科学和人工智能实验室(CSAIL)研发。它是用Python和PyQT编写的,开源且免费。Labelme支持Windows、Linux和Mac等操作系统。
  • 这款工具提供了直观的图形界面,允许用户在图像上标注多种类型的目标,例如矩形框、多边形、线条等,甚至包括更复杂的形状。标注结果以JSON格式保存,便于后续处理和分析。这些标注信息可以用于目标检测、图像分割、图像分类等任务。
  • 总的来说,Labelme是一款强大且易用的图像标注工具,可以满足不同的图像处理需求。
  • Labelme标注json文件是一种用于存储标注信息的文件格式,它包含了以下几个主要的字段:
    • version: Labelme的版本号,例如"4.5.6"。
    • flags: 一些全局的标志,例如是否是分割任务,是否有多边形,等等。
    • shapes: 一个列表,每个元素是一个字典,表示一个标注对象。每个字典包含了以下几个字段:
      • label: 标注对象的类别名称,例如"dog"。
      • points: 一个列表,每个元素是一个坐标对,表示标注对象的边界点,例如[[10, 20], [30, 40]]。
      • group_id: 标注对象的分组编号,用于表示属于同一组的对象,例如1。
      • shape_type: 标注对象的形状类型,例如"polygon",“rectangle”,“circle”,等等。
      • flags: 一些针对该标注对象的标志,例如是否是难例,是否被遮挡,等等。
    • lineColor: 标注对象的边界线颜色,例如[0, 255, 0, 128]。
    • fillColor: 标注对象的填充颜色,例如[255, 0, 0, 128]。
    • imagePath: 图像文件的相对路径,例如"img_001.jpg"。
    • imageData: 图像文件的二进制数据,经过base64编码后的字符串,例如"iVBORw0KGgoAAAANSUhEUgAA…"。
    • imageHeight: 图像的高度,例如600。
    • imageWidth: 图像的宽度,例如800。

以下是一个Labelme标注json文件的示例:

{
  "version": "4.5.6",
  "flags": {},
  "shapes": [
    {
      "label": "dog",
      "points": [
        [
          121.0,
          233.0
        ],
        [
          223.0,
          232.0
        ],
        [
          246.0,
          334.0
        ],
        [
          121.0,
          337.0
        ]
      ],
      "group_id": null,
      "shape_type": "polygon",
      "flags": {}
    }
  ],
  "lineColor": [
    0,
    255,
    0,
    128
  ],
  "fillColor": [
    255,
    0,
    0,
    128
  ],
  "imagePath": "img_001.jpg",
  "imageData": "iVBORw0KGgoAAAANSUhEUgAA...",
  "imageHeight": 600,
  "imageWidth": 800
}

实验环境

  • Python 3.x (面向对象的高级语言)

生成随机仿射变换的数据集和标注文件

  • 背景:将标注好的数据集,随机仿射变换,以达到数据增强的目的。
  • 目录结构示例
    在这里插入图片描述

在这里插入图片描述

  • images:原始图片数据集所在的文件夹。
  • jsons:原始Labelme标注文件所在的文件夹。

在这里插入图片描述

{
  "version": "5.2.0.post4",
  "flags": {},
  "shapes": [
    {
      "label": "cat",
      "points": [
        [
          161.0612244897959,
          152.265306122449
        ],
        [
          610.0408163265306,
          399.7142857142857
        ]
      ],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {}
    }
  ],
  "imagePath": "cat.png",
  "imageData": null,
  "imageHeight": 478,
  "imageWidth": 766
}

在这里插入图片描述

{
  "version": "5.2.0.post4",
  "flags": {},
  "shapes": [
    {
      "label": "flower",
      "points": [
        [
          301.9230769230769,
          19.52747252747254
        ],
        [
          452.4725274725275,
          168.42857142857144
        ]
      ],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {}
    },
    {
      "label": "flower",
      "points": [
        [
          378.2967032967033,
          183.81318681318683
        ],
        [
          529.3956043956044,
          364.032967032967
        ]
      ],
      "group_id": null,
      "description": null,
      "shape_type": "rectangle",
      "flags": {}
    }
  ],
  "imagePath": "flower.png",
  "imageData": null,
  "imageHeight": 394,
  "imageWidth": 850
}

在这里插入图片描述

{
  "version": "5.2.0.post4",
  "flags": {},
  "shapes": [
    {
      "label": "swan",
      "points": [
        [
          147.76178010471205,
          212.01570680628274
        ],
        [
          294.88219895287955,
          476.93717277486905
        ]
      ],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {}
    },
    {
      "label": "swan",
      "points": [
        [
          271.8455497382199,
          243.42931937172776
        ],
        [
          342.0026178010471,
          322.4869109947644
        ]
      ],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {}
    },
    {
      "label": "swan",
      "points": [
        [
          305.35340314136124,
          215.6806282722513
        ],
        [
          394.3586387434555,
          421.4397905759162
        ]
      ],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {}
    },
    {
      "label": "swan",
      "points": [
        [
          549.8560209424083,
          202.59162303664922
        ],
        [
          655.0916230366491,
          345.52356020942403
        ]
      ],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {}
    }
  ],
  "imagePath": "swan.png",
  "imageData": null,
  "imageHeight": 490,
  "imageWidth": 795
}

代码实现

import os
import cv2
import math
import json
import random
import numpy as np

def random_perspective(im, targets=(), segments=(), degrees=10, translate=.1, scale=.1, shear=10, perspective=0.0,
                       border=(0, 0)):
    # torchvision.transforms.RandomAffine(degrees=(-10, 10), translate=(0.1, 0.1), scale=(0.9, 1.1), shear=(-10, 10))
    # targets = [cls, xyxy]

    height = im.shape[0] + border[0] * 2  # shape(h,w,c)
    width = im.shape[1] + border[1] * 2

    # Center
    C = np.eye(3)
    C[0, 2] = -im.shape[1] / 2  # x translation (pixels)
    C[1, 2] = -im.shape[0] / 2  # y translation (pixels)

    # Perspective
    P = np.eye(3)
    P[2, 0] = random.uniform(-perspective, perspective)  # x perspective (about y)
    P[2, 1] = random.uniform(-perspective, perspective)  # y perspective (about x)

    # Rotation and Scale
    R = np.eye(3)
    a = random.uniform(-degrees, degrees)
    # a += random.choice([-180, -90, 0, 90])  # add 90deg rotations to small rotations
    s = random.uniform(1 - scale, 1 + scale)
    # s = 2 ** random.uniform(-scale, scale)
    R[:2] = cv2.getRotationMatrix2D(angle=a, center=(0, 0), scale=s)

    # Shear
    S = np.eye(3)
    S[0, 1] = math.tan(random.uniform(-shear, shear) * math.pi / 180)  # x shear (deg)
    S[1, 0] = math.tan(random.uniform(-shear, shear) * math.pi / 180)  # y shear (deg)

    # Translation
    T = np.eye(3)
    T[0, 2] = random.uniform(0.5 - translate, 0.5 + translate) * width  # x translation (pixels)
    T[1, 2] = random.uniform(0.5 - translate, 0.5 + translate) * height  # y translation (pixels)

    # Combined rotation matrix
    M = T @ S @ R @ P @ C  # order of operations (right to left) is IMPORTANT
    if (border[0] != 0) or (border[1] != 0) or (M != np.eye(3)).any():  # image changed
        if perspective:
            im = cv2.warpPerspective(im, M, dsize=(width, height), borderValue=(114, 114, 114))
        else:  # affine
            im = cv2.warpAffine(im, M[:2], dsize=(width, height), borderValue=(114, 114, 114))

    # Visualize
    # import matplotlib.pyplot as plt
    # ax = plt.subplots(1, 2, figsize=(12, 6))[1].ravel()
    # ax[0].imshow(im[:, :, ::-1])  # base
    # ax[1].imshow(im2[:, :, ::-1])  # warped

    # Transform label coordinates
    n = len(targets)
    if n:
        use_segments = any(x.any() for x in segments)
        new = np.zeros((n, 4))

        # warp boxes
        xy = np.ones((n * 4, 3))
        xy[:, :2] = targets[:, [1, 2, 3, 4, 1, 4, 3, 2]].reshape(n * 4, 2)  # x1y1, x2y2, x1y2, x2y1
        xy = xy @ M.T  # transform
        xy = (xy[:, :2] / xy[:, 2:3] if perspective else xy[:, :2]).reshape(n, 8)  # perspective rescale or affine

        # create new boxes
        x = xy[:, [0, 2, 4, 6]]
        y = xy[:, [1, 3, 5, 7]]
        new = np.concatenate((x.min(1), y.min(1), x.max(1), y.max(1))).reshape(4, n).T

        # clip
        new[:, [0, 2]] = new[:, [0, 2]].clip(0, width)
        new[:, [1, 3]] = new[:, [1, 3]].clip(0, height)

        # filter candidates
        i = box_candidates(box1=targets[:, 1:5].T * s, box2=new.T, area_thr=0.01 if use_segments else 0.10)
        targets = targets[i]
        targets[:, 1:5] = new[i]

    return im, targets


def box_candidates(box1, box2, wh_thr=2, ar_thr=100, area_thr=0.1, eps=1e-16):  # box1(4,n), box2(4,n)
    # Compute candidate boxes: box1 before augment, box2 after augment, wh_thr (pixels), aspect_ratio_thr, area_ratio
    w1, h1 = box1[2] - box1[0], box1[3] - box1[1]
    w2, h2 = box2[2] - box2[0], box2[3] - box2[1]
    ar = np.maximum(w2 / (h2 + eps), h2 / (w2 + eps))  # aspect ratio
    return (w2 > wh_thr) & (h2 > wh_thr) & (w2 * h2 / (w1 * h1 + eps) > area_thr) & (ar < ar_thr)  # candidates


# 图像显示函数
def show(name, img):
    cv2.namedWindow(name, 0)  # 用来创建指定名称的窗口,0表示CV_WINDOW_NORMAL
    # cv2.resizeWindow(name, img.shape[1], img.shape[0]); # 设置宽高大小为640*480
    cv2.imshow(name, img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

def xyxy2xminyminxmaxymax(rect):
    '''
    (x1,y1,x2,y2)  -> (xmin,ymin,xmax,ymax)
    '''
    xmin = min(rect[0],rect[2])
    ymin = min(rect[1],rect[3])
    xmax = max(rect[0],rect[2])
    ymax = max(rect[1],rect[3])
    return xmin,ymin,xmax,ymax

def read_img_json(in_img_path,in_json_path):

    label_map = {'cat':0,'flower':1,'swan':2}

    img = cv2.imread(in_img_path)

    with open(in_json_path, "r", encoding='utf-8') as f:
        # json.load数据到变量json_data
        json_data = json.load(f)
    labels = []
    # print(json_data['shapes'])
    # 读取原始jsons的 [[x1,y1],[x2,y2]]
    for i in json_data['shapes']:
        label = label_map[i['label']]
        rect = int(i['points'][0][0]),int(i['points'][0][1]),int(i['points'][1][0]),int(i['points'][1][1]) # x1,y1,x2,y2
        xmin,ymin,xmax,ymax = xyxy2xminyminxmaxymax(rect)
        labels.append([label,xmin,ymin,xmax,ymax])
    return img, np.array(labels)

def write_img_json(img_array,img_targets,out_img_name,out_img_path,out_json_path):

    json_dict = {
                    "version": "4.5.6",
                    "flags": {},
                    "shapes": [],
                }


    label_map = {0:'cat',1:'flower',2:'swan'}

    cv2.imwrite(out_img_path,img_array)
    new_img_height,new_img_width = img_array.shape[0],img_array.shape[1]

    for i in img_targets:
        label = label_map[i[0]]
        box = i[1:]
        shapes_dict = {'label': '', 
                'points': [], # [[x1,y1],[x2,y2]]
                'group_id': None, 
                'shape_type': 'rectangle', 
                'flags': {}}
        shapes_dict['label'] = label
        '''
        将 numpy int32 对象传递给 json.dumps() 方法,但该方法默认不处理 numpy integers。
        要解决该错误,请在序列化之前使用内置的 int()或 float()函数将 numpy int32 对象转换为Python intege
        x1,y1,x2,y2 = box
        '''
        x1,y1,x2,y2 = int(box[0]),int(box[1]),int(box[2]),int(box[3])
        shapes_dict['points'] = [[x1,y1],[x2,y2]]
        json_dict['shapes'].append(shapes_dict)
    
    '''
    写新的json文件
    '''
    json_dict["imagePath"] = out_img_name
    json_dict["imageData"] = None
    json_dict["imageHeight"] = new_img_height
    json_dict["imageWidth"] = new_img_width
    
    # 创建一个写文件
    with open(out_json_path, "w", encoding='utf-8') as f:
        # 将修改后的数据写入文件
        f.write(json.dumps(json_dict))



if __name__=="__main__":
    # 输出图片所在文件夹
    out_imgs_dir  = 'out_images/'
    # 输出jsons所在文件夹
    out_jsons_dir = 'out_jsons/'
    if not os.path.exists(out_imgs_dir):
        os.mkdir(out_imgs_dir)
    if not os.path.exists(out_jsons_dir):
        os.mkdir(out_jsons_dir)

    # 输入图片所在文件夹
    in_imgs_dir  = 'images/'
    # 输入jsons所在文件夹
    in_jsons_dir = 'jsons/'
    # 输入图片名列表
    file_name_list = os.listdir(in_imgs_dir)
    img_name_list = [i for i in file_name_list if i.endswith('.png')]
    # 输入jsons文件名列表
    file_name_list = os.listdir(in_jsons_dir)
    json_name_list = [i for i in file_name_list if i.endswith('.json')]
    # print(img_name_list,json_name_list)

    # 定义剪裁图片的左右填充数
    pad = 0

    for img_name,json_name in zip(img_name_list,json_name_list):
        in_img_path = os.path.join(in_imgs_dir,img_name)
        out_img_path = os.path.join(out_imgs_dir,img_name)
        in_json_path = os.path.join(in_jsons_dir,json_name)
        out_json_path = os.path.join(out_jsons_dir,json_name)
        # 原始图片和标注信息labels = [[label,xmin,ymin,xmax,ymax]]
        img,labels = read_img_json(in_img_path,in_json_path)
        # print(img,labels)

        # 随机仿射后的图片和标注信息targets = [[label,xmin,ymin,xmax,ymax]]
        img_res,targets = random_perspective(img,labels)
        # print(img_res,targets)

        write_img_json(img_res,targets,img_name,out_img_path,out_json_path)

输出结果

在这里插入图片描述

  • out_images:随机仿射变换后的图片所在的文件夹。
  • out_jsons:随机仿射变换后的Labelme标注文件所在的文件夹。

在这里插入图片描述

{
    "version": "4.5.6",
    "flags": {},
    "shapes": [
        {
            "label": "cat",
            "points": [
                [
                    211,
                    94
                ],
                [
                    700,
                    374
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        }
    ],
    "imagePath": "cat.png",
    "imageData": null,
    "imageHeight": 478,
    "imageWidth": 766
}

在这里插入图片描述

{
    "version": "4.5.6",
    "flags": {},
    "shapes": [
        {
            "label": "flower",
            "points": [
                [
                    266,
                    49
                ],
                [
                    421,
                    193
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        },
        {
            "label": "flower",
            "points": [
                [
                    355,
                    205
                ],
                [
                    515,
                    379
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        }
    ],
    "imagePath": "flower.png",
    "imageData": null,
    "imageHeight": 394,
    "imageWidth": 850
}

在这里插入图片描述

{
    "version": "4.5.6",
    "flags": {},
    "shapes": [
        {
            "label": "swan",
            "points": [
                [
                    202,
                    135
                ],
                [
                    363,
                    417
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        },
        {
            "label": "swan",
            "points": [
                [
                    329,
                    182
                ],
                [
                    404,
                    269
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        },
        {
            "label": "swan",
            "points": [
                [
                    362,
                    158
                ],
                [
                    461,
                    374
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        },
        {
            "label": "swan",
            "points": [
                [
                    607,
                    175
                ],
                [
                    721,
                    331
                ]
            ],
            "group_id": null,
            "shape_type": "rectangle",
            "flags": {}
        }
    ],
    "imagePath": "swan.png",
    "imageData": null,
    "imageHeight": 490,
    "imageWidth": 795
}
  • 由于本人水平有限,难免出现错漏,敬请批评改正。
  • 更多精彩内容,可点击进入Python日常小操作专栏、OpenCV-Python小应用专栏、YOLO系列专栏、自然语言处理专栏或我的个人主页查看
  • YOLOv8 Ultralytics:使用Ultralytics框架训练RT-DETR实时目标检测模型
  • 基于DETR的人脸伪装检测
  • YOLOv7训练自己的数据集(口罩检测)
  • YOLOv8训练自己的数据集(足球检测)
  • YOLOv5:TensorRT加速YOLOv5模型推理
  • YOLOv5:IoU、GIoU、DIoU、CIoU、EIoU
  • 玩转Jetson Nano(五):TensorRT加速YOLOv5目标检测
  • YOLOv5:添加SE、CBAM、CoordAtt、ECA注意力机制
  • YOLOv5:yolov5s.yaml配置文件解读、增加小目标检测层
  • Python将COCO格式实例分割数据集转换为YOLO格式实例分割数据集
  • YOLOv5:使用7.0版本训练自己的实例分割模型(车辆、行人、路标、车道线等实例分割)
  • 使用Kaggle GPU资源免费体验Stable Diffusion开源项目

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

buildadmin+tp8表格操作(5)自定义组装搜索的查询

有时候我们会自定义组装一些数据&#xff0c;发送给后端&#xff0c;让后端来进行筛选&#xff0c;这里有一个示例 const onComSearchIdEq () > {// 展开公共搜索baTable.table.showComSearch true/*** 公共搜索表单赋值* 范围搜索有两个输入框&#xff0c;输入框绑定变量…

PLC梯形图实操——风扇正反转

文章目录 1.项目内创建函数块&#xff08;FB&#xff09;2.项目内创建数据块&#xff08;DB&#xff09;2.1去除优化块访问2.2去除优化块的访问后对数据块进行编译 3.在函数块&#xff08;FB&#xff09;内实现正转反转的自锁与互锁3.1在函数块内实现电机正反转的梯形图 4.主函…

【机器学习】037_暂退法

一、实现原理 具有输入噪音的训练&#xff0c;等价于Tikhonov正则化 核心方法&#xff1a;在前向传播的过程中&#xff0c;计算每一内部层的同时注入噪声 从作用上来看&#xff0c;表面上来说是在训练过程中丢弃一些神经元 假设x是某一层神经网络层的输出&#xff0c;是下一…

Linux进程通信——IPC、管道、FIFO的引入

进程间的通信——IPC 进程间通信 (IPC&#xff0c;InterProcess Communication) 是指在不同进程之间传播或交换信息。 IPC的方式通常有管道 (包括无名管道和命名管道) 、消息队列、信号量、共享存储、Socket、Streams等。其中 Socket和Streams支持不同主机上的两个进程IPC。 …

1230天,百度再见!!!

从2020年7月8日至2023年11月20日&#xff0c;在百度的工作到达了终点&#xff0c;完成了从学生向职场人的蜕变&#xff0c;是时候说再见了&#xff01; 一、成长收获 在这1230天里收获颇丰&#xff0c;下面与各位分享一下。 从技术至上到业务赋能的思想转变 相信很多人都存在“…

初始环境配置

目录 一、JDK1、简介2、配置步骤 二、Redis1、简介2、配置步骤 三、MySQL1、简介2、配置步骤 四、Git1、简介2、配置步骤 五、NodeJS1、简介2、配置步骤 六、Maven1、简介2、配置步骤 七、Tomcat1、简介2、配置步骤 一、JDK 1、简介 JDK 是 Oracle 提供的 Java 开发工具包&…

发币成功,记录一下~

N年前就听说了这样一种说法——“一个熟练的区块链工程师&#xff0c;10分钟就可以发出一个新的币” 以前仅仅是有这么一个认识&#xff0c;但当时并不特别关注这个领域。 最近系统性学习中&#xff0c;今天尝试发币成功啦&#xff0c;记录一下&#xff5e; 发在 Sepolia Tes…

EI论文程序:Adaboost-BP神经网络的回归预测算法,可作为深度学习对比预测模型,丰富实验内容,自带数据集,直接运行!

适用平台&#xff1a;Matlab 2021及以上 本程序参考中文EI期刊《基于Adaboost的BP神经网络改进算法在短期风速预测中的应用》&#xff0c;程序注释清晰&#xff0c;干货满满&#xff0c;下面对文章和程序做简要介绍。 为了提高短期风速预测的准确性&#xff0c;论文提出了使用…

【前端学java】java 中的数组(9)

往期回顾&#xff1a; 【前端学java】JAVA开发的依赖安装与环境配置 &#xff08;0&#xff09;【前端学 java】java的基础语法&#xff08;1&#xff09;【前端学java】JAVA中的packge与import&#xff08;2&#xff09;【前端学java】面向对象编程基础-类的使用 &#xff08…

猫12分类:使用多线程爬取图片的Python程序

本文目标 对于猫12目标检测部分的数据集&#xff0c;采用网络爬虫来制作数据集。 在网络爬虫中&#xff0c;经常需要下载大量的图片。为了提高下载效率&#xff0c;可以使用多线程来并发地下载图片。本文将介绍如何使用Python编写一个多线程爬虫程序&#xff0c;用于爬取图片…

代码随想录 Day50 单调栈 LeetCodeT503 下一个最大元素II T42接雨水

前言 前面我们说到了单调栈的第一题,下一个最大元素I,其实今天的两道题都是对他的变种,知道第一个单调栈的思想能够想清楚,其实这道题是很简单的 考虑好三个状态,大于等于小于,其实对于前面这些题目只要细心的小伙伴就会发现其实小于和等于的处理是一样的都是直接入栈,只有大于…

记录一次较为完整的Jenkins发布流程

文章目录 1. Jenkins安装1.1 Jenkins Docker安装1.2 Jenkins apt-get install安装 2. 关联github/gitee服务与webhook2.1 配置ssh2.2 Jenkins关联2.3 WebHook 3. 前后端关联发布 1. Jenkins安装 1.1 Jenkins Docker安装 Docker很好&#xff0c;但是我没有玩明白如何使用Docke…

【并发编程】Synchronized原理详解

&#x1f4eb;作者简介&#xff1a;小明java问道之路&#xff0c;2022年度博客之星全国TOP3&#xff0c;专注于后端、中间件、计算机底层、架构设计演进与稳定性建设优化&#xff0c;文章内容兼具广度、深度、大厂技术方案&#xff0c;对待技术喜欢推理加验证&#xff0c;就职于…

广州华锐互动VRAR | VR课件内容编辑器解决院校实践教学难题

VR课件内容编辑器由VR制作公司广州华锐互动开发&#xff0c;是一款专为虚拟现实教育领域设计的应用&#xff0c;它能够将传统的教学内容转化为沉浸式的三维体验。通过这款软件&#xff0c;教师可以轻松创建和编辑各种虚拟场景、模型和动画&#xff0c;以更生动、直观的方式展示…

.NET6使用MiniExcel根据数据源横向导出头部标题及数据

.NET6MiniExcel根据数据源横向导出头部标题 MiniExcel简单、高效避免OOM的.NET处理Excel查、写、填充数据工具。 特点: 低内存耗用&#xff0c;避免OOM、频繁 Full GC 情况 支持即时操作每行数据 兼具搭配 LINQ 延迟查询特性&#xff0c;能办到低消耗、快速分页等复杂查询 轻量…

CommonModule.dll动态链接库(DLL)文件丢失的处理方法

方法一、手动下载修复 (1)从网站下载commonmodule.dll文件到您的电脑上。 (2)将commonmodule.dll文件复制到" X:\Windows\system32 " (X代表您系统所在目录盘符&#xff0c;如&#xff1a;C:\Windows\system32)目录下。 (3)在开始菜单中找到"运行(R)" 或…

数据结构--字符串的模式匹配

案例导入概念 朴素&#xff08;暴力&#xff09;模式匹配算法 定位操作&#xff1a; 计算时间复杂度 总结

解决 Python requests 库中 SSL 错误转换为 Timeouts 问题

解决 Python requests 库中 SSL 错误转换为 Timeouts 问题&#xff1a;理解和处理 SSL 错误的关键 在使用Python的requests库进行HTTPS请求时&#xff0c;可能会遇到SSL错误&#xff0c;这些错误包括但不限于证书不匹配、SSL层出现问题等。如果在requests库中设置verifyFalse&…

ES6有何新特性?(下篇)

目录 函数参数的默认值设置 rest参数 扩展运算符 Symbol 迭代器 生成器 Promise Class 数值扩展 对象方法扩展 模块化 大家好呀&#xff01;今天这篇文章继续为大家介绍ES6的新特性&#xff0c;上上上篇文章介绍了一部分&#xff0c;这篇文章会将剩下的部分新增的特…

ElasticSearch在Windows上的下载与安装

Elasticsearch是一个开源的分布式搜索和分析引擎&#xff0c;它可以帮助我们快速地搜索、分析和处理大量数据。Elasticsearch能够快速地处理结构化和非结构化数据&#xff0c;支持全文检索、地理位置搜索、自动补全、聚合分析等功能&#xff0c;能够承载各种类型的应用&#xf…
最新文章