YOLOv8目标检测部署RK3588全过程,附代码pt->onnx->rknn,附【详细代码】

news2024/9/21 4:24:31

目录

一、训练yolov8模型,得到最佳权重文件best.pt

二、pt转onnx,即best.pt->best11.onnx

1、对下载的YOLOv8代码修改

2、加入模型导出功能,

3、导出指令采用如下代码

三、ONNX转RKNN

四、RK3588部署

1、拷贝rknn文件到rk3588板子内

2、执行代码段rknnlite_inference.py


一、训练yolov8模型,得到最佳权重文件best.pt

训练过程省略。。。。

二、pt转onnx,即best.pt->best11.onnx

1、对下载的YOLOv8代码修改,

位置:ultralytics_yolov8_main/ultralytics/nn/modules/head.py

在Detect类添加如下代码段:

y = []
for i in range(self.nl):
    y.append(self.cv2[i](x[i])) 
    cls = torch.sigmoid(self.cv3[i](x[i]))
    cls_sum = torch.clamp(cls.sum(1, keepdim=True), 0, 1)
    y.append(cls)
    y.append(cls_sum)
return y

如下图所示: 

2、加入模型导出功能,

对model.py中的 _load函数添加如下代码段,位置:ultralytics_yolov8-main\ultralytics\engine\model.py

print("===========  onnx =========== ")
        import torch
        self.model.fuse()
        self.model.eval()
        self.model.load_state_dict(torch.load('./model/best11.pt', map_location='cpu'), strict=False)

        dummy_input = torch.randn(1, 3, 640, 640)
        input_names = ["data"]
        output_names = ["reg1", "cls1", "reg2", "cls2", "reg3", "cls3"]
        torch.onnx.export(self.model, dummy_input, "./best111.onnx", verbose=False, input_names=input_names,
                          output_names=output_names, opset_version=12)
        print("======================== convert onnx Finished! .... ")
3、导出指令采用如下代码:
from ultralytics import YOLO

model = YOLO('./model/best11.pt')
results = model(task='detect', mode='predict', source='C:/Users\lzy06\Desktop\zxq/relaticdata',
                line_thickness=3, show=False, save=True, device='cpu')

确认导出成功,即可忽略所报错误 。

使用网页链接https://netron.app打开onnx文件,查看输出是否一致,如下所示:

三、ONNX转RKNN

配置该环境需要在linux系统下,先安装rknn_toolkit2,安装过程可网上查阅。。。

验证安装完毕:终端输入python 后再输入from rknn.api import RKNN,是否报错。 

 转换代码onnx2rknn.py如下:

import os
import urllib
import traceback
import time
import sys
import numpy as np
import cv2
from rknn.api import RKNN
from math import exp

ONNX_MODEL = './best111.onnx'
RKNN_MODEL = './best111.rknn'
DATASET = './dataset.txt'

QUANTIZE = False

CLASSES = ['broke', 'good', 'lose']

meshgrid = []

class_num = len(CLASSES)
headNum = 3
strides = [8, 16, 32]
mapSize = [[80, 80], [40, 40], [20, 20]]
nmsThresh = 0.5
objectThresh = 0.5

input_imgH = 640
input_imgW = 640


class DetectBox:
    def __init__(self, classId, score, xmin, ymin, xmax, ymax):
        self.classId = classId
        self.score = score
        self.xmin = xmin
        self.ymin = ymin
        self.xmax = xmax
        self.ymax = ymax

def GenerateMeshgrid():
    for index in range(headNum):
        for i in range(mapSize[index][0]):
            for j in range(mapSize[index][1]):
                meshgrid.append(j + 0.5)
                meshgrid.append(i + 0.5)


def IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2):
    xmin = max(xmin1, xmin2)
    ymin = max(ymin1, ymin2)
    xmax = min(xmax1, xmax2)
    ymax = min(ymax1, ymax2)

    innerWidth = xmax - xmin
    innerHeight = ymax - ymin

    innerWidth = innerWidth if innerWidth > 0 else 0
    innerHeight = innerHeight if innerHeight > 0 else 0

    innerArea = innerWidth * innerHeight

    area1 = (xmax1 - xmin1) * (ymax1 - ymin1)
    area2 = (xmax2 - xmin2) * (ymax2 - ymin2)

    total = area1 + area2 - innerArea

    return innerArea / total


def NMS(detectResult):
    predBoxs = []

    sort_detectboxs = sorted(detectResult, key=lambda x: x.score, reverse=True)

    for i in range(len(sort_detectboxs)):
        xmin1 = sort_detectboxs[i].xmin
        ymin1 = sort_detectboxs[i].ymin
        xmax1 = sort_detectboxs[i].xmax
        ymax1 = sort_detectboxs[i].ymax
        classId = sort_detectboxs[i].classId

        if sort_detectboxs[i].classId != -1:
            predBoxs.append(sort_detectboxs[i])
            for j in range(i + 1, len(sort_detectboxs), 1):
                if classId == sort_detectboxs[j].classId:
                    xmin2 = sort_detectboxs[j].xmin
                    ymin2 = sort_detectboxs[j].ymin
                    xmax2 = sort_detectboxs[j].xmax
                    ymax2 = sort_detectboxs[j].ymax
                    iou = IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
                    if iou > nmsThresh:
                        sort_detectboxs[j].classId = -1
    return predBoxs


def sigmoid(x):
    return 1 / (1 + exp(-x))


def postprocess(out, img_h, img_w):
    print('postprocess ... ')

    detectResult = []
    output = []
    for i in range(len(out)):
        print(out[i].shape)
        output.append(out[i].reshape((-1)))

    scale_h = img_h / input_imgH
    scale_w = img_w / input_imgW

    gridIndex = -2
    cls_index = 0
    cls_max = 0

    for index in range(headNum):
        reg = output[index * 2 + 0]
        cls = output[index * 2 + 1]

        for h in range(mapSize[index][0]):
            for w in range(mapSize[index][1]):
                gridIndex += 2

                if 1 == class_num:
                    cls_max = sigmoid(cls[0 * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w])
                    cls_index = 0
                else:
                    for cl in range(class_num):
                        cls_val = cls[cl * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w]
                        if 0 == cl:
                            cls_max = cls_val
                            cls_index = cl
                        else:
                            if cls_val > cls_max:
                                cls_max = cls_val
                                cls_index = cl
                    cls_max = sigmoid(cls_max)

                if cls_max > objectThresh:
                    regdfl = []
                    for lc in range(4):
                        sfsum = 0
                        locval = 0
                        for df in range(16):
                            temp = exp(reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w])
                            reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w] = temp
                            sfsum += temp

                        for df in range(16):
                            sfval = reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w] / sfsum
                            locval += sfval * df
                        regdfl.append(locval)

                    x1 = (meshgrid[gridIndex + 0] - regdfl[0]) * strides[index]
                    y1 = (meshgrid[gridIndex + 1] - regdfl[1]) * strides[index]
                    x2 = (meshgrid[gridIndex + 0] + regdfl[2]) * strides[index]
                    y2 = (meshgrid[gridIndex + 1] + regdfl[3]) * strides[index]

                    xmin = x1 * scale_w
                    ymin = y1 * scale_h
                    xmax = x2 * scale_w
                    ymax = y2 * scale_h

                    xmin = xmin if xmin > 0 else 0
                    ymin = ymin if ymin > 0 else 0
                    xmax = xmax if xmax < img_w else img_w
                    ymax = ymax if ymax < img_h else img_h

                    box = DetectBox(cls_index, cls_max, xmin, ymin, xmax, ymax)
                    detectResult.append(box)
    # NMS
    print('detectResult:', len(detectResult))
    predBox = NMS(detectResult)

    return predBox


def export_rknn_inference(img):
    # Create RKNN object
    rknn = RKNN(verbose=False)

    # pre-process config
    print('--> Config model')
    rknn.config(mean_values=[[0, 0, 0]], std_values=[[255, 255, 255]], quantized_algorithm='normal', quantized_method='channel', target_platform='rk3588')
    print('done')

    # Load ONNX model
    print('--> Loading model')
    ret = rknn.load_onnx(model=ONNX_MODEL)
    if ret != 0:
        print('Load model failed!')
        exit(ret)
    print('done')

    # Build model
    print('--> Building model')
    ret = rknn.build(do_quantization=QUANTIZE, dataset=DATASET, rknn_batch_size=1)
    if ret != 0:
        print('Build model failed!')
        exit(ret)
    print('done')

    # Export RKNN model
    print('--> Export rknn model')
    ret = rknn.export_rknn(RKNN_MODEL)
    if ret != 0:
        print('Export rknn model failed!')
        exit(ret)
    print('done')

    # Init runtime environment
    print('--> Init runtime environment')
    ret = rknn.init_runtime()
    # ret = rknn.init_runtime(target='rk3566')
    if ret != 0:
        print('Init runtime environment failed!')
        exit(ret)
    print('done')

    # Inference
    print('--> Running model')
    outputs = rknn.inference(inputs=[img])
    rknn.release()
    print('done')

    return outputs


if __name__ == '__main__':
    print('This is main ...')
    GenerateMeshgrid()

    img_path = './dataset/00003.png'
    orig_img = cv2.imread(img_path)
    img_h, img_w = orig_img.shape[:2]


    origimg = cv2.resize(orig_img, (input_imgW, input_imgH), interpolation=cv2.INTER_LINEAR)
    origimg = cv2.cvtColor(origimg, cv2.COLOR_BGR2RGB)

    img = np.expand_dims(origimg, 0)

    outputs = export_rknn_inference(img)

    out = []
    for i in range(len(outputs)):
        out.append(outputs[i])

    predbox = postprocess(out, img_h, img_w)

    print(len(predbox))

    for i in range(len(predbox)):
        xmin = int(predbox[i].xmin)
        ymin = int(predbox[i].ymin)
        xmax = int(predbox[i].xmax)
        ymax = int(predbox[i].ymax)
        classId = predbox[i].classId
        score = predbox[i].score

        cv2.rectangle(orig_img, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)
        ptext = (xmin, ymin)
        title = CLASSES[classId] + ":%.2f" % (score)
        cv2.putText(orig_img, title, ptext, cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2, cv2.LINE_AA)

    cv2.imwrite('./test_rknn_result.jpg', orig_img)
    # cv2.imshow("test", origimg)
    # cv2.waitKey(0)

四、RK3588部署

1、拷贝rknn文件到rk3588板子内。
2、执行代码段rknnlite_inference.py

(其实和onnx2rknn.py代码一样,唯独区别于板子上是使用RKNNLite)我这里修改了代码,补充了视频和图像文件的测试代码段,如下所示:

import glob
import os
import urllib
import traceback
import time
import sys
import numpy as np
import cv2
from rknnlite.api import RKNNLite
from math import exp

RKNN_MODEL = './model/detect_FQ.rknn'

dataset_file = './dataset.txt'
img_folder = "./dataset"
video_path = "00001.mp4"
video_inference = False

result_path = './detect_result'
CLASSES = ['broke', 'good', 'lose']

meshgrid = []

class_num = len(CLASSES)
headNum = 3
strides = [8, 16, 32]
mapSize = [[80, 80], [40, 40], [20, 20]]
nmsThresh = 0.5
objectThresh = 0.5

input_imgH = 640
input_imgW = 640


class DetectBox:
    def __init__(self, classId, score, xmin, ymin, xmax, ymax):
        self.classId = classId
        self.score = score
        self.xmin = xmin
        self.ymin = ymin
        self.xmax = xmax
        self.ymax = ymax


def GenerateMeshgrid():
    for index in range(headNum):
        for i in range(mapSize[index][0]):
            for j in range(mapSize[index][1]):
                meshgrid.append(j + 0.5)
                meshgrid.append(i + 0.5)


def IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2):
    xmin = max(xmin1, xmin2)
    ymin = max(ymin1, ymin2)
    xmax = min(xmax1, xmax2)
    ymax = min(ymax1, ymax2)

    innerWidth = xmax - xmin
    innerHeight = ymax - ymin

    innerWidth = innerWidth if innerWidth > 0 else 0
    innerHeight = innerHeight if innerHeight > 0 else 0

    innerArea = innerWidth * innerHeight

    area1 = (xmax1 - xmin1) * (ymax1 - ymin1)
    area2 = (xmax2 - xmin2) * (ymax2 - ymin2)

    total = area1 + area2 - innerArea

    return innerArea / total


def NMS(detectResult):
    predBoxs = []

    sort_detectboxs = sorted(detectResult, key=lambda x: x.score, reverse=True)

    for i in range(len(sort_detectboxs)):
        xmin1 = sort_detectboxs[i].xmin
        ymin1 = sort_detectboxs[i].ymin
        xmax1 = sort_detectboxs[i].xmax
        ymax1 = sort_detectboxs[i].ymax
        classId = sort_detectboxs[i].classId

        if sort_detectboxs[i].classId != -1:
            predBoxs.append(sort_detectboxs[i])
            for j in range(i + 1, len(sort_detectboxs), 1):
                if classId == sort_detectboxs[j].classId:
                    xmin2 = sort_detectboxs[j].xmin
                    ymin2 = sort_detectboxs[j].ymin
                    xmax2 = sort_detectboxs[j].xmax
                    ymax2 = sort_detectboxs[j].ymax
                    iou = IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
                    if iou > nmsThresh:
                        sort_detectboxs[j].classId = -1
    return predBoxs


def sigmoid(x):
    return 1 / (1 + exp(-x))


def postprocess(out, img_h, img_w):
    print('postprocess ... ')

    detectResult = []
    output = []
    for i in range(len(out)):
        print(out[i].shape)
        output.append(out[i].reshape((-1)))

    scale_h = img_h / input_imgH
    scale_w = img_w / input_imgW

    gridIndex = -2
    cls_index = 0
    cls_max = 0

    for index in range(headNum):
        reg = output[index * 2 + 0]
        cls = output[index * 2 + 1]

        for h in range(mapSize[index][0]):
            for w in range(mapSize[index][1]):
                gridIndex += 2

                if 1 == class_num:
                    cls_max = sigmoid(cls[0 * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w])
                    cls_index = 0
                else:
                    for cl in range(class_num):
                        cls_val = cls[cl * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w]
                        if 0 == cl:
                            cls_max = cls_val
                            cls_index = cl
                        else:
                            if cls_val > cls_max:
                                cls_max = cls_val
                                cls_index = cl
                    cls_max = sigmoid(cls_max)

                if cls_max > objectThresh:
                    regdfl = []
                    for lc in range(4):
                        sfsum = 0
                        locval = 0
                        for df in range(16):
                            temp = exp(reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h *
                                           mapSize[index][1] + w])
                            reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][
                                1] + w] = temp
                            sfsum += temp

                        for df in range(16):
                            sfval = reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][
                                1] + w] / sfsum
                            locval += sfval * df
                        regdfl.append(locval)

                    x1 = (meshgrid[gridIndex + 0] - regdfl[0]) * strides[index]
                    y1 = (meshgrid[gridIndex + 1] - regdfl[1]) * strides[index]
                    x2 = (meshgrid[gridIndex + 0] + regdfl[2]) * strides[index]
                    y2 = (meshgrid[gridIndex + 1] + regdfl[3]) * strides[index]

                    xmin = x1 * scale_w
                    ymin = y1 * scale_h
                    xmax = x2 * scale_w
                    ymax = y2 * scale_h

                    xmin = xmin if xmin > 0 else 0
                    ymin = ymin if ymin > 0 else 0
                    xmax = xmax if xmax < img_w else img_w
                    ymax = ymax if ymax < img_h else img_h

                    box = DetectBox(cls_index, cls_max, xmin, ymin, xmax, ymax)
                    detectResult.append(box)
    # NMS
    print('detectResult:', len(detectResult))
    predBox = NMS(detectResult)

    return predBox


def export_rknnlite_inference(img):
    # Create RKNN object
    rknnlite = RKNNLite(verbose=False)

    # Load ONNX model
    print('--> Loading model')
    ret = rknnlite.load_rknn(RKNN_MODEL)
    if ret != 0:
        print('Load model failed!')
        exit(ret)
    print('done')

    # Init runtime environment
    print('--> Init runtime environment')
    # ret = rknnlite.init_runtime()
    ret = rknnlite.init_runtime(core_mask=RKNNLite.NPU_CORE_0_1_2)
    if ret != 0:
        print('Init runtime environment failed!')
        exit(ret)
    print('done')

    # Inference
    print('--> Running model')
    outputs = rknnlite.inference(inputs=[img])
    rknnlite.release()
    print('done')

    return outputs


def get_dataset_txt(dataset_path, dataset_savefile):
    file_data = glob.glob(os.path.join(dataset_path, "*.png"))
    with open(dataset_savefile, "r") as f:
        for file in file_data:
            f.readlines(f"{file}\n")


if __name__ == '__main__':
    print('This is main ...')
    GenerateMeshgrid()
    isExist = os.path.exists(result_path)
    if not isExist:
        os.makedirs(result_path)

    if video_inference == False:
        print('--> image -----------------------------------------')
        img_names = os.listdir(img_folder)
        initime = time.time()
        num = 0
        for name in img_names:
            img_path = os.path.join(img_folder, name)
            num += 1
            start = time.time()
            orig_img = cv2.imread(img_path)
            img_h, img_w = orig_img.shape[:2]

            origimg = cv2.resize(orig_img, (input_imgW, input_imgH), interpolation=cv2.INTER_LINEAR)
            origimg = cv2.cvtColor(origimg, cv2.COLOR_BGR2RGB)

            img = np.expand_dims(origimg, 0)

            outputs = export_rknnlite_inference(img)

            out = []
            for i in range(len(outputs)):
                out.append(outputs[i])

            predbox = postprocess(out, img_h, img_w)

            print('detect:', len(predbox))
            fps = 1 / (time.time() - start)
            print('fps: ', fps, num / (time.time() - initime))
            for i in range(len(predbox)):
                xmin = int(predbox[i].xmin)
                ymin = int(predbox[i].ymin)
                xmax = int(predbox[i].xmax)
                ymax = int(predbox[i].ymax)
                classId = predbox[i].classId
                score = predbox[i].score

                cv2.rectangle(orig_img, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)
                ptext = (xmin, ymin)
                title = CLASSES[classId] + ":%.2f" % (score)
                cv2.putText(orig_img, title, ptext, cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2, cv2.LINE_AA)

            cv2.imwrite(f'./{result_path}/{name}', orig_img)
            cv2.imshow("test", orig_img)
            cv2.waitKey(1)
        end = time.time()
        print('avgTimes:', num / (end - initime), num, end - initime)
    else:
        print('--> video -----------------------------------------')
        cap = cv2.VideoCapture(video_path)
        initime = time.time()
        num = 0
        v = cv2.VideoWriter(f'./{result_path}/detect.avi', cv2.VideoWriter_fourcc(*'MJPG'), 30, (1920, 1080))

        while (cap.isOpened()):
            num += 1
            ret, frame = cap.read()
            print('ret:', ret)
            if not ret:
                break
            start = time.time()
            img_h, img_w = frame.shape[:2]

            frame = cv2.resize(frame, (input_imgW, input_imgH), interpolation=cv2.INTER_LINEAR)
            frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

            img = np.expand_dims(frame, 0)

            outputs = export_rknnlite_inference(img)

            out = []
            for i in range(len(outputs)):
                out.append(outputs[i])

            predbox = postprocess(out, img_h, img_w)

            print('detect:', len(predbox))
            fps = 1 / (time.time() - start)
            print('fps: ', fps, num / (time.time() - initime))
            for i in range(len(predbox)):
                xmin = int(predbox[i].xmin)
                ymin = int(predbox[i].ymin)
                xmax = int(predbox[i].xmax)
                ymax = int(predbox[i].ymax)
                classId = predbox[i].classId
                score = predbox[i].score
                print(f'point  score :', CLASSES[classId], score)

                cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)
                ptext = (xmin, ymin)
                title = CLASSES[classId] + ":%.2f" % (score)
                cv2.putText(frame, title, ptext, cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2, cv2.LINE_AA)


            cv2.imshow("output", frame)
            # i = cv2.resize(frame, (640, 640))
            v.write(frame)
            cv2.imwrite(f'./{result_path}/test_rknn_result.jpg', frame)
            cv2.waitKey(1)
        end = time.time()
        print('avgTimes:', num / (end - initime), num, end-initime)

大功告成,创作不易,辛苦点个赞????

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

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

相关文章

.NET6 多环境 在Windows IIS部署的应用场景

前言&#xff1a; 通常情况下 我们部署Web站点 需要用到 测试环境 和 正式环境 2个环境 Staging环境 或者其他环境 视 团队所处阶段、团队规模、质量要求、风险控制要求、第3方协议而定 1.我们把上一讲 IX.MultiEnvironment 这个项目发布到IIS中 2.IIS配置3个环境 我们重点…

MathType2025最新破解版补丁包+永久免费安装包win+mac系统

有一类笔记特别受欢迎&#xff0c;那就是“数学公式的排版”。这些笔记通常以图文并茂的方式&#xff0c;展示了如何使用各种工具来排版数学公式。其中&#xff0c;MathType 7 是最受欢迎的工具之一&#xff0c;它不仅功能强大、使用方便&#xff0c;还能让你轻松地制作出精美的…

Tailor:免费开源 AI 视频神器,创作者必备利器

目录 引言一、创新特性&#xff0c;引领视频编辑新潮流1. 智能人脸剪辑2. 精准语音剪辑3. 自动化口播生成4. 多样化字幕生成5. 一键式色彩生成 二、简单易用&#xff0c;新手也能快速上手1. 下载和安装2. 功能选择3. 操作流程 三、广泛应用&#xff0c;满足不同创作需求四、代码…

别让语法拖后腿:ChatGPT助你告别改稿噩梦!【建议收藏】

学术论文的撰写是研究成果传播的关键。清晰、准确、逻辑严密的表达对于学术论文的质量至关重要。人工智能技术的快速发展&#xff0c;尤其是ChatGPT 4.0的推出&#xff0c;为学术写作提供了新的辅助工具。本文将探讨如何有效利用ChatGPT 4.0进行论文润色。 ChatGPT&#xff1a…

线性代数:如何由AB=E 推出 BA=AB?

最近在二刷线性代数&#xff0c;在看逆矩阵定义的时候发现了这个问题。于是决定写一写&#xff0c;给出一种证明方式。 一、由逆矩阵的定义出发 这是我在mooc-山东大学-线性代数&#xff08;秦静老师&#xff09;第一章第十讲的ppt上截取的定义。 看到这个定义我就在想&#xf…

如何在Java中使用protobuf

写在前面 本文看下在Java中如何使用protofbuf。 1&#xff1a;介绍 1.1&#xff1a;什么是protobuf 是一种数据格式&#xff0c;同json&#xff0c;xml&#xff0c;等。但是一种二进制数据格式。 1.2&#xff1a;强在哪里&#xff1f;为啥要用&#xff1f; 小&#xff0c…

图新说-调整标绘线面的压盖顺序的两种方法

0.序 图新说作为一个三维可视化汇报工具&#xff0c;在公安消防领域常用于做态势标绘&#xff0c;应急救援方案&#xff0c;安保预案等。 如果撤离路线&#xff0c;或者行进路线【线对象】经过了水源地、危险区等【面对象】。如何确保线对象显示在面对象的上面&#xff0c;不被…

MyBatis中的占位符解析机制

深入理解 MyBatis 中的 #{} 占位符解析机制 在使用 MyBatis 进行数据库操作时&#xff0c;#{} 占位符是我们非常常用的一个特性。它能够将 Java 对象的属性值与 SQL 语句中的参数进行映射。在实际使用中&#xff0c;MyBatis 如何解析 #{} 占位符并获取对应的属性值呢&#xff…

如何实现低成本降噪?风扇噪声流体仿真解决方案

本文将说明工程师如何能够使用气动解决方案来模拟和降低一款小型发电机柜冷却风扇的噪音。ultraFluidX 的模拟结果将设备内部的流场和声场可视化&#xff0c;研究风扇和机柜内其他部件的相互作用&#xff0c;确认噪声源来自何处&#xff08;协助工程师采取有效的降噪措施&#…

Mybatis中的缓存

一&#xff0c;为什么要使用缓存 1&#xff0c;缓存的作用 缓存(cache&#xff09;的作用是为了减去数据库的压力&#xff0c;提高查询性能。 缓存实现的原理是 从数据库中查询出来的对象在使用完后不要销毁&#xff0c;而是存储在内存&#xff08;缓存&#xff09; 中&#…

zipkin启动发生报错 : Failed to start bean ‘armeriaServerGracefulShutdownLifecycle‘;

报错详情 : 在windows下启动zipkin的时候发生报错 : Failed to start bean ‘armeriaServerGracefulShutdownLifecycle’;nested exception is java.util.concurrent.CompletionException: java.lang.IllegalStateException: Armeria server failed to start解决 : 由于z…

SSM网上书店--附源码96453

摘 要 随着科学技术的飞速发展&#xff0c;各行各业都在努力与现代先进技术接轨&#xff0c;通过科技手段提高自身的优势&#xff1b;对于网上书店当然也不能排除在外&#xff0c;随着网络技术的不断成熟&#xff0c;带动了网上书店&#xff0c;它彻底改变了过去传统的管理方式…

安装cvxpy时遇到“subprocess-exited-with-error”的解决方式

尝试联邦学习时&#xff0c;遇到了这个问题&#xff0c;但实际上仔细看报错就能找到源头 ①更新cmake版本到3.17 参考此文即可更新 https://blog.csdn.net/why1249777255/article/details/138505546 【报错点中“Found CMake:…………”这一行&#xff0c;在不满足要求时会说…

信息学奥赛一本通编程启蒙(不断更新ing~)

可以作为c初学者的练习题&#xff0c;我会挑选有部分有代表意义的题目作为学生的课后作业&#xff0c;后面会在专栏中陆续更新题目解析&#xff0c;并附在这一篇文章的链接中 信息学奥赛一本通-编程启蒙&#xff08;C版&#xff09;在线评测系统 https://bas.ssoier.cn/index…

安全升级,智启未来!广东工业安全生产数智化转型闭门分享会圆满举办

8月26日&#xff0c;由华为技术有限公司&#xff08;以下简称“华为”&#xff09;与广州英码信息科技有限公司&#xff08;以下简称“英码科技”&#xff09;联合主办&#xff0c;广东省应急产业协会为支持单位的“广东工业安全生产数智化转型闭门分享会”在广州圆满举行。本次…

整合优化方案即将批复,您准备好了吗?

在自然保护地管理的新时代&#xff0c;规划编制的复杂性和高要求常常让各级管理者和规划者面临重重挑战。整合优化方案即将批复&#xff0c;规划任务将十分繁重&#xff01;为了应对这些难题&#xff0c;“自然保护地总体规划智能编制系统”应运而生&#xff0c;旨在为规划编制…

iPhone短信误删如何恢复,四种方法找回短信

在日常使用手机的过程中&#xff0c;我们可能会因为误操作或其他原因不小心删除了重要的短信。这些短信可能包含了工作沟通、家人关怀或朋友间的温馨对话&#xff0c;一旦丢失&#xff0c;难免让人感到焦虑和不安。不过&#xff0c;别担心&#xff0c;针对iPhone短信误删的问题…

Java开发者的专业显示器推荐-明基RD280U

哈喽&#xff0c;小伙伴们好呀&#xff0c;我混编程界已经好几年了&#xff0c;搞了这么多年的Java&#xff0c;换了好几家公司&#xff0c;有的公司发电脑&#xff0c;有的公司发笔记本&#xff0c;有的还发主机&#xff0c;不过你们有没有注意到一个普遍的问题&#xff0c;公…

金融工程--基于akshare的数据获取

背景 在进行金融工程和量化交易的时候&#xff0c;如何获取准确的数据来为我们模型和后期的判断提供支撑和依据成为了比较关键的一个点。对这个问题有几个方面的要求。第一&#xff0c;获取的数据的准确性&#xff0c;第二&#xff0c;大批量数据获取的接口稳定程度&#xff0…

Trivy 工具:开启高效漏洞检测之旅

在网络安全日益重要的今天&#xff0c;及时发现系统和应用中的漏洞成为了保护企业和个人信息安全的关键。而 Trivy 工具&#xff0c;就如同您手中的一把利剑&#xff0c;能够精准地刺破漏洞的伪装&#xff0c;为您的网络世界保驾护航。 Trivy 是一款功能强大、易于使用且开源的…