当前位置: 首页 > news >正文

Linux 36.3 + JetPack v6.0@jetson-inference之图像分类

Linux 36.3 + JetPack v6.0@jetson-inference之图像分类

  • 1. 源由
  • 2. imagenet
    • 2.1 命令选项
    • 2.2 下载模型
    • 2.3 操作示例
      • 2.3.1 单张照片
      • 2.3.2 视频
  • 3. 代码
    • 3.1 Python
    • 3.2 C++
  • 4. 参考资料
  • 5. 补充
    • 5.1 第一次运行模型本地适应初始化
    • 5.2 samba软连接

1. 源由

从应用角度来说,图像分类是计算机视觉里面最基本的一个操作。

2. imagenet

imageNet对象接受输入图像并输出每个类别的概率。GoogleNet和ResNet-18模型在构建过程中自动下载,这些模型已在包含1000个物体的ImageNet ILSVRC数据集上进行了训练。

2.1 命令选项

$ imagenet --help
usage: imagenet [--help] [--network=NETWORK] ...input_URI [output_URI]Classify a video/image stream using an image recognition DNN.
See below for additional arguments that may not be shown above.optional arguments:--help            show this help message and exit--network=NETWORK pre-trained model to load (see below for options)--topK=N         show the topK number of class predictions (default: 1)
positional arguments:input_URI       resource URI of input stream  (see videoSource below)output_URI      resource URI of output stream (see videoOutput below)imageNet arguments:--network=NETWORK    pre-trained model to load, one of the following:* alexnet* googlenet (default)* googlenet-12* resnet-18* resnet-50* resnet-101* resnet-152* vgg-16* vgg-19* inception-v4--model=MODEL        path to custom model to load (caffemodel, uff, or onnx)--prototxt=PROTOTXT  path to custom prototxt to load (for .caffemodel only)--labels=LABELS      path to text file containing the labels for each class--input-blob=INPUT   name of the input layer (default is 'data')--output-blob=OUTPUT name of the output layer (default is 'prob')--threshold=CONF     minimum confidence threshold for classification (default is 0.01)--smoothing=WEIGHT   weight between [0,1] or number of frames (disabled by default)--profile            enable layer profiling in TensorRTvideoSource arguments:input                resource URI of the input stream, for example:* /dev/video0               (V4L2 camera #0)* csi://0                   (MIPI CSI camera #0)* rtp://@:1234              (RTP stream)* rtsp://user:pass@ip:1234  (RTSP stream)* webrtc://@:1234/my_stream (WebRTC stream)* file://my_image.jpg       (image file)* file://my_video.mp4       (video file)* file://my_directory/      (directory of images)--input-width=WIDTH    explicitly request a width of the stream (optional)--input-height=HEIGHT  explicitly request a height of the stream (optional)--input-rate=RATE      explicitly request a framerate of the stream (optional)--input-save=FILE      path to video file for saving the input stream to disk--input-codec=CODEC    RTP requires the codec to be set, one of these:* h264, h265* vp8, vp9* mpeg2, mpeg4* mjpeg--input-decoder=TYPE   the decoder engine to use, one of these:* cpu* omx  (aarch64/JetPack4 only)* v4l2 (aarch64/JetPack5 only)--input-flip=FLIP      flip method to apply to input:* none (default)* counterclockwise* rotate-180* clockwise* horizontal* vertical* upper-right-diagonal* upper-left-diagonal--input-loop=LOOP      for file-based inputs, the number of loops to run:* -1 = loop forever*  0 = don't loop (default)* >0 = set number of loopsvideoOutput arguments:output               resource URI of the output stream, for example:* file://my_image.jpg       (image file)* file://my_video.mp4       (video file)* file://my_directory/      (directory of images)* rtp://<remote-ip>:1234    (RTP stream)* rtsp://@:8554/my_stream   (RTSP stream)* webrtc://@:1234/my_stream (WebRTC stream)* display://0               (OpenGL window)--output-codec=CODEC   desired codec for compressed output streams:* h264 (default), h265* vp8, vp9* mpeg2, mpeg4* mjpeg--output-encoder=TYPE  the encoder engine to use, one of these:* cpu* omx  (aarch64/JetPack4 only)* v4l2 (aarch64/JetPack5 only)--output-save=FILE     path to a video file for saving the compressed streamto disk, in addition to the primary output above--bitrate=BITRATE      desired target VBR bitrate for compressed streams,in bits per second. The default is 4000000 (4 Mbps)--headless             don't create a default OpenGL GUI windowlogging arguments:--log-file=FILE        output destination file (default is stdout)--log-level=LEVEL      message output threshold, one of the following:* silent* error* warning* success* info* verbose (default)* debug--verbose              enable verbose logging (same as --log-level=verbose)--debug                enable debug logging   (same as --log-level=debug)

注:关于照片、视频等基本操作,详见: 《Linux 36.3 + JetPack v6.0@jetson-inference之视频操作》

2.2 下载模型

两种方式:

  1. 创建imageNet对象时,初始化会自动下载
  2. 通过手动将模型文件放置到data/networks/目录下

国内,由于“墙”的存在,对于我们这种处于起飞阶段的菜鸟来说就是“障碍”。有条件的朋友可以参考《apt-get通过代理更新系统》进行设置网络。

不过,NVIDIA还是很热心的帮助我们做了“Work around”,所有的模型都已经预先存放在中国大陆能访问的位置:Github - model-mirror-190618

  --network=NETWORK    pre-trained model to load, one of the following:* alexnet* googlenet (default)* googlenet-12* resnet-18* resnet-50* resnet-101* resnet-152* vgg-16* vgg-19* inception-v4--model=MODEL        path to custom model to load (caffemodel, uff, or onnx)

根据以上Model方面信息,该命令支持:

  • alexnet
  • googlenet (default)
  • googlenet-12
  • resnet-18
  • resnet-50
  • resnet-101
  • resnet-152
  • vgg-16
  • vgg-19
  • inception-v4
  • 支持定制模型(需要用到通用的模型文件caffemodel, uff, or onnx)

作为示例,就下载一个googlenet (default)模型

$ mkdir model-mirror-190618
$ cd model-mirror-190618
$ wget https://github.com/dusty-nv/jetson-inference/releases/download/model-mirror-190618/GoogleNet.tar.gz
$ mkdir -p ../data/networks/Googlenet
$ tar -zxvf GoogleNet.tar.gz -C ../data/networks/Googlenet
$ cd ..

注:这个模型文件下载要注意,将解压缩文件放置到Googlenet目录下。

2.3 操作示例

它加载图像(或多张图像),使用TensorRT和imageNet类进行推理,然后叠加分类结果并保存输出图像。该项目附带了供您使用的示例图像,这些图像位于images/目录下。

  • What’s wrong with imagenet, continous printf?
$ cd build/aarch64/bin/

2.3.1 单张照片

# C++
$ ./imagenet images/orange_0.jpg images/test/output_imagenet_cpp.jpg

在这里插入图片描述

# Python
$ ./imagenet.py images/strawberry_0.jpg images/test/output_imagenet_python.jpg

在这里插入图片描述

2.3.2 视频

# Download test video (thanks to jell.yfish.us)
$ wget https://nvidia.box.com/shared/static/tlswont1jnyu3ix2tbf7utaekpzcx4rc.mkv -O jellyfish.mkv
# C++
$ ./imagenet --network=resnet-18 ../../../jellyfish.mkv images/test/output_imagenet_jellyfish_cpp.mkv
# Python
$ ./imagenet.py --network=resnet-18 ../../../jellyfish.mkv images/test/output_imagenet_jellyfish_python.mkv

这里视频就放一份了,理论上将既然有概率性的问题求解方式,不同时间运算的结果可能会有差异。但是基于这个模型,计算机没有记忆,所以理论上是同一个概率。

那么问题来了,照片的CPP和Python两次运算概率确是是不一样的。这是什么原因呢?

output_imagenet_jellyfish_cpp

3. 代码

3.1 Python

Import statements
├── sys
├── argparse
├── jetson_inference
│   └── imageNet
└── jetson_utils├── videoSource├── videoOutput├── cudaFont└── LogCommand line parsing
├── Create ArgumentParser
│   ├── description
│   ├── formatter_class
│   └── epilog
├── Add arguments
│   ├── input
│   ├── output
│   ├── --network
│   └── --topK
└── Parse arguments├── try│   └── args = parser.parse_known_args()[0]└── except├── print("")├── parser.print_help()└── sys.exit(0)Load the recognition network
└── net = imageNet(args.network, sys.argv)Optional hard-coded model loading (commented out)
└── net = imageNet(model="model/resnet18.onnx", labels="model/labels.txt", input_blob="input_0", output_blob="output_0")Create video sources & outputs
├── input = videoSource(args.input, argv=sys.argv)
├── output = videoOutput(args.output, argv=sys.argv)
└── font = cudaFont()Process frames until EOS or user exits
└── while True├── Capture the next image│   ├── img = input.Capture()│   └── if img is None│       └── continue├── Classify the image and get the topK predictions│   └── predictions = net.Classify(img, topK=args.topK)├── Draw predicted class labels│   └── for n, (classID, confidence) in enumerate(predictions)│       ├── classLabel = net.GetClassLabel(classID)│       ├── confidence *= 100.0│       ├── print(f"imagenet:  {confidence:05.2f}% class #{classID} ({classLabel})")│       └── font.OverlayText(img, text=f"{confidence:05.2f}% {classLabel}", │                            x=5, y=5 + n * (font.GetSize() + 5),│                            color=font.White, background=font.Gray40)├── Render the image│   └── output.Render(img)├── Update the title bar│   └── output.SetStatus("{:s} | Network {:.0f} FPS".format(net.GetNetworkName(), net.GetNetworkFPS()))├── Print out performance info│   └── net.PrintProfilerTimes()└── Exit on input/output EOS└── if not input.IsStreaming() or not output.IsStreaming()└── break

3.2 C++

#include statements
├── "videoSource.h"
├── "videoOutput.h"
├── "cudaFont.h"
├── "imageNet.h"
└── <signal.h>Global variables
└── bool signal_recieved = false;Function definitions
├── void sig_handler(int signo)
│   └── if (signo == SIGINT)
│       ├── LogVerbose("received SIGINT\n");
│       └── signal_recieved = true;
└── int usage()├── printf("usage: imagenet [--help] [--network=NETWORK] ...\n");├── printf("                input_URI [output_URI]\n\n");├── printf("Classify a video/image stream using an image recognition DNN.\n");├── printf("See below for additional arguments that may not be shown above.\n\n");├── printf("optional arguments:\n");├── printf("  --help            show this help message and exit\n");├── printf("  --network=NETWORK pre-trained model to load (see below for options)\n");├── printf("  --topK=N          show the topK number of class predictions (default: 1)\n");├── printf("positional arguments:\n");├── printf("    input_URI       resource URI of input stream  (see videoSource below)\n");├── printf("    output_URI      resource URI of output stream (see videoOutput below)\n\n");├── printf("%s", imageNet::Usage());├── printf("%s", videoSource::Usage());├── printf("%s", videoOutput::Usage());└── printf("%s", Log::Usage());main function
├── Parse command line
│   ├── commandLine cmdLine(argc, argv);
│   └── if (cmdLine.GetFlag("help"))
│       └── return usage();
├── Attach signal handler
│   └── if (signal(SIGINT, sig_handler) == SIG_ERR)
│       └── LogError("can't catch SIGINT\n");
├── Create input stream
│   ├── videoSource* input = videoSource::Create(cmdLine, ARG_POSITION(0));
│   └── if (!input)
│       ├── LogError("imagenet:  failed to create input stream\n");
│       └── return 1;
├── Create output stream
│   ├── videoOutput* output = videoOutput::Create(cmdLine, ARG_POSITION(1));
│   └── if (!output)
│       ├── LogError("imagenet:  failed to create output stream\n");
│       └── return 1;
├── Create font for image overlay
│   ├── cudaFont* font = cudaFont::Create();
│   └── if (!font)
│       ├── LogError("imagenet:  failed to load font for overlay\n");
│       └── return 1;
├── Create recognition network
│   ├── imageNet* net = imageNet::Create(cmdLine);
│   └── if (!net)
│       ├── LogError("imagenet:  failed to initialize imageNet\n");
│       └── return 1;
│   ├── const int topK = cmdLine.GetInt("topK", 1);  // default top result
├── Processing loop
│   └── while (!signal_recieved)
│       ├── uchar3* image = NULL;
│       ├── int status = 0;
│       ├── if (!input->Capture(&image, &status))
│       │   └── if (status == videoSource::TIMEOUT)
│       │       └── continue;
│       │   └── break; // EOS
│       ├── imageNet::Classifications classifications; // classID, confidence
│       ├── if (net->Classify(image, input->GetWidth(), input->GetHeight(), classifications, topK) < 0)
│       │   └── continue;
│       ├── for (uint32_t n=0; n < classifications.size(); n++)
│       │   ├── const uint32_t classID = classifications[n].first;
│       │   ├── const char* classLabel = net->GetClassLabel(classID);
│       │   ├── const float confidence = classifications[n].second * 100.0f;
│       │   ├── LogVerbose("imagenet:  %2.5f%% class #%i (%s)\n", confidence, classID, classLabel);
│       │   ├── char str[256];
│       │   ├── sprintf(str, "%05.2f%% %s", confidence, classLabel);
│       │   └── font->OverlayText(image, input->GetWidth(), input->GetHeight(),
│       │       str, 5, 5 + n * (font->GetSize() + 5), 
│       │       make_float4(255,255,255,255), make_float4(0,0,0,100));
│       ├── if (output != NULL)
│       │   ├── output->Render(image, input->GetWidth(), input->GetHeight());
│       │   ├── char str[256];
│       │   ├── sprintf(str, "TensorRT %i.%i.%i | %s | Network %.0f FPS", NV_TENSORRT_MAJOR, NV_TENSORRT_MINOR, NV_TENSORRT_PATCH, net->GetNetworkName(), net->GetNetworkFPS());
│       │   └── output->SetStatus(str);
│       │   └── if (!output->IsStreaming())
│       │       └── break;
│       └── net->PrintProfilerTimes();
├── Destroy resources
│   ├── LogVerbose("imagenet:  shutting down...\n");
│   ├── SAFE_DELETE(input);
│   ├── SAFE_DELETE(output);
│   ├── SAFE_DELETE(net);
└── LogVerbose("imagenet:  shutdown complete.\n");return 0;

4. 参考资料

【1】jetson-inference - Classifying Images with ImageNet

5. 补充

5.1 第一次运行模型本地适应初始化

第一次运行神经网络,虽然模型是预训练的,但是本地部署还是有个初始化过程,好像是建立一些cache的过程,具体有待进一步研究。

注:有知道为什么是这样,也请评论区告诉我,谢谢!

  • imagenet can’t work as readme says, see attached log #1858
  • could not find engine cache … MonoDepth-FCN-Mobilenet/monodepth_fcn_mobilenet.onnx.1.1.8602.GPU.FP16.engine ? #1855
  • What’s wrong with imagenet/detectnet, continous printf?

5.2 samba软连接

注:share请替换为samba共享目录,比如:home

  • ubuntu22.04 配置
[global]
allow insecure wide links = yes[share]
follow symlinks = yes
wide links = yes
  • 之前的版本
[global]
unix extensions = no[share]
follow symlinks = yes
wide links = yes

相关文章:

Linux 36.3 + JetPack v6.0@jetson-inference之图像分类

Linux 36.3 JetPack v6.0jetson-inference之图像分类 1. 源由2. imagenet2.1 命令选项2.2 下载模型2.3 操作示例2.3.1 单张照片2.3.2 视频 3. 代码3.1 Python3.2 C 4. 参考资料5. 补充5.1 第一次运行模型本地适应初始化5.2 samba软连接 1. 源由 从应用角度来说&#xff0c;图…...

重庆公司记账代理,打造专业财务管理解决方案的领先企业

重庆公司记账代理&#xff0c;作为专业的财务管理服务提供商&#xff0c;我们的目标是为公司的经营管理和决策提供科学、准确的财务数据支持&#xff0c;我们通过长期的专业经验和对市场的深入理解&#xff0c;为您提供一站式的记账服务和财务咨询。 专业团队 我们拥有一支由经…...

transformers 阅读:Llama 模型

正文 学习一下 transformers 库中&#xff0c;Llama 模型的代码&#xff0c;学习过程中写下这篇笔记&#xff0c;一来加深印象&#xff0c;二来可以多次回顾。 笔者小白&#xff0c;里面错误之处请不吝指出。 层归一化 LlamaRMSNorm transformers 中对于 LlamaRMSNorm 类的…...

python绘制piper三线图

piper三线图 Piper三线图是一种常用于水化学分析的图表&#xff0c;它能够帮助我们理解和比较水样的化学成分。该图表由三个部分组成&#xff1a;两个三角形和一个菱形。两个三角形分别用于显示阳离子和阴离子的相对比例&#xff0c;而菱形部分则综合显示了这些离子比例在水样…...

咖啡机器人如何精准控制液位流量

在如今快节奏的生活中&#xff0c;精确控制液位流量的需求愈发迫切&#xff0c;特别是在咖啡机器人等精密设备中。为了满足这一需求&#xff0c;工程师们不断研发出各种先进的技术&#xff0c;以确保液体流量的精准控制。其中&#xff0c;霍尔式流量计和光电式流量计就是两种常…...

Go go-redis应用

go-redis 是 Go 语言的一个流行的 Redis 客户端库&#xff0c;它提供了丰富的功能来与 Redis 数据库进行交互。 1、简单应用 package mainimport ("context""fmt""log""github.com/redis/go-redis/v9" )func main() {ctx : context…...

从混乱到有序:PDM系统如何优化物料编码

在现代制造业中&#xff0c;物料管理是企业运营的核心。物料编码作为物料管理的基础&#xff0c;对于确保物料的准确性、唯一性和高效性至关重要。随着产品种类的不断增加和产品变型的多样化&#xff0c;传统的物料编码管理方式已经不能满足企业的需求。本文将探讨产品数据管理…...

npm发布自己的插件包

要发布自己的插件包到npm&#xff0c;可以按照以下步骤进行操作: 1.创建一个新项目 首先确保你已经安装了Node.js和npm。然后&#xff0c;在你的项目目录中初始化一个新的npm项目&#xff1a;npm init命令会引导你创建一个package.json文件&#xff0c;其中包含你插件包的基本…...

Pygame:新手指南与入门教程

在游戏开发领域,pygame 是一个广受欢迎的 Python 库,它提供了开发二维游戏的丰富工具和方法。这个库让开发者可以较少地关注底层图形处理细节,更多地专注于游戏逻辑和玩法的实现。本文将详细介绍 pygame,包括其安装过程、基本概念、主要功能和一个简单游戏的开发流程。 一…...

动态IP与静态IP的优缺点

在网络连接中&#xff0c;使用动态和静态 IP 地址取决于连接的性质和要求。静态 IP 地址通常更适合企业相关服务&#xff0c;而动态 IP 地址更适合家庭网络。让我们来看看动态 IP 与静态 IP 的优缺点。 1.静态IP的优点&#xff1a; 更好的 DNS 支持&#xff1a;静态 IP 地址在…...

上海市计算机学会竞赛平台2024年1月月赛丙组最大的和

题目描述 给定两个序列 &#x1d44e;1,&#x1d44e;2,…,&#x1d44e;&#x1d45b;a1​,a2​,…,an​ 与 &#x1d44f;1,&#x1d44f;2,…,&#x1d44f;&#x1d45b;b1​,b2​,…,bn​&#xff0c;请从这两个序列中分别各找一个数&#xff0c;要求这两个数的差不超过给…...

C++三大特性之继承,详细介绍

阿尼亚全程陪伴大家学习~ 前言 每个程序员在开发新系统时&#xff0c;都希望能够利用已有的软件资源&#xff0c;以缩短开发周期&#xff0c;提高开发效率。 为了提高软件的可重用性(reusability)&#xff0c;C提供了类的继承机制。 1.继承的概念 继承&#xff1a; 指在现有…...

Python推导式详解

引言 推导式&#xff08;Comprehensions&#xff09;是Python中一种简洁且强大的语法结构&#xff0c;可以用来生成列表、字典和集合。推导式使得代码更加简洁、易读&#xff0c;同时也更具Pythonic风格。今天我将将详细介绍列表推导式、字典推导式和集合推导式&#xf…...

stm32中如何实现EXTI线 0 ~ 15与对应IO口的配置呢?

STM32的EXTI控制器支持19 个外部中断/ 事件请求。每个中断设有状态位&#xff0c;每个中断/ 事件都有独立的触发和屏蔽设置。 STM32的19个外部中断对应着19路中断线&#xff0c;分别是EXTI_Line0-EXTI_Line18&#xff1a; 线0~15&#xff1a;对应外部 IO口的输入中断。 线16&…...

Python 短文本匹配,短文本语义相似度,基于大模型的短文本匹配,基于LLMs的短文本语义相似度识别,短文本语义扩充和匹配

1.任务描述 之前在做疾病相似度匹配的时候&#xff0c;堪称史诗级难题&#xff0c;虽然最后加上规则以及一些nlp模型&#xff0c;取得了差强人意的效果&#xff0c;但是短文本的语义相似度匹配一直属于比较难以攻克的难题 2.思路 随着近年大模型的飞速发展&#xff0c;就之前…...

提升接口性能方式汇总

1&#xff0c;sql 2&#xff0c;缓存&#xff0c;尤其面向用户&#xff0c;如app数据。可用redis咖啡&#xff0c;二级缓存。 充分利用redis&#xff0c;redis数据类型很多&#xff0c;平时场景中结合实际情况&#xff0c;找一下对应的redis实现方案 比如Zset可以排序&#…...

C++中的常见语法糖汇总

C中的语法糖是指使代码更简洁、可读性更高的语言特性和简化的语法。以下是一些常见的C语法糖&#xff1a; 1. 自动类型推导&#xff08;auto&#xff09; 使用 auto 关键字可以让编译器自动推导变量的类型&#xff0c;简化变量的声明。 auto x 10; // 编译器推导 x…...

TensorFlow Playground神经网络演示工具使用方法详解

在现代机器学习领域,神经网络无疑是一个重要的研究方向。然而,对于许多初学者来说,神经网络的概念和实际操作可能显得相当复杂。幸运的是,TensorFlow Playground 提供了一个交互式的在线工具,使得我们可以直观地理解和实验神经网络的基本原理。在这篇博客中,我们将详细介…...

【git】subtree 简单教程

git subtree使用案例 &#x1f604;生命不息&#xff0c;写作不止 &#x1f525; 继续踏上学习之路&#xff0c;学之分享笔记 &#x1f44a; 总有一天我也能像各位大佬一样 &#x1f3c6; 博客首页 怒放吧德德 To记录领地 &#x1f31d;分享学习心得&#xff0c;欢迎指正&am…...

C语言基础:字符串函数使用与剖析

strtok&#xff08;分割字符串&#xff09; char * strtok ( char * str, const char * sep ); sep参数是个字符串&#xff0c;定义了用作分隔符的字符集合 第一个参数指定一个字符串&#xff0c;它包含了0个或者多个由sep字符串中一个或者多个分隔符分割的标 记。strtok函数找…...

理解 MCP 工作流:使用 Ollama 和 LangChain 构建本地 MCP 客户端

&#x1f31f; 什么是 MCP&#xff1f; 模型控制协议 (MCP) 是一种创新的协议&#xff0c;旨在无缝连接 AI 模型与应用程序。 MCP 是一个开源协议&#xff0c;它标准化了我们的 LLM 应用程序连接所需工具和数据源并与之协作的方式。 可以把它想象成你的 AI 模型 和想要使用它…...

对WWDC 2025 Keynote 内容的预测

借助我们以往对苹果公司发展路径的深入研究经验&#xff0c;以及大语言模型的分析能力&#xff0c;我们系统梳理了多年来苹果 WWDC 主题演讲的规律。在 WWDC 2025 即将揭幕之际&#xff0c;我们让 ChatGPT 对今年的 Keynote 内容进行了一个初步预测&#xff0c;聊作存档。等到明…...

2021-03-15 iview一些问题

1.iview 在使用tree组件时&#xff0c;发现没有set类的方法&#xff0c;只有get&#xff0c;那么要改变tree值&#xff0c;只能遍历treeData&#xff0c;递归修改treeData的checked&#xff0c;发现无法更改&#xff0c;原因在于check模式下&#xff0c;子元素的勾选状态跟父节…...

解决本地部署 SmolVLM2 大语言模型运行 flash-attn 报错

出现的问题 安装 flash-attn 会一直卡在 build 那一步或者运行报错 解决办法 是因为你安装的 flash-attn 版本没有对应上&#xff0c;所以报错&#xff0c;到 https://github.com/Dao-AILab/flash-attention/releases 下载对应版本&#xff0c;cu、torch、cp 的版本一定要对…...

智能仓储的未来:自动化、AI与数据分析如何重塑物流中心

当仓库学会“思考”&#xff0c;物流的终极形态正在诞生 想象这样的场景&#xff1a; 凌晨3点&#xff0c;某物流中心灯火通明却空无一人。AGV机器人集群根据实时订单动态规划路径&#xff1b;AI视觉系统在0.1秒内扫描包裹信息&#xff1b;数字孪生平台正模拟次日峰值流量压力…...

蓝桥杯3498 01串的熵

问题描述 对于一个长度为 23333333的 01 串, 如果其信息熵为 11625907.5798&#xff0c; 且 0 出现次数比 1 少, 那么这个 01 串中 0 出现了多少次? #include<iostream> #include<cmath> using namespace std;int n 23333333;int main() {//枚举 0 出现的次数//因…...

Netty从入门到进阶(二)

二、Netty入门 1. 概述 1.1 Netty是什么 Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. Netty是一个异步的、基于事件驱动的网络应用框架&#xff0c;用于…...

SQL慢可能是触发了ring buffer

简介 最近在进行 postgresql 性能排查的时候,发现 PG 在某一个时间并行执行的 SQL 变得特别慢。最后通过监控监观察到并行发起得时间 buffers_alloc 就急速上升,且低水位伴随在整个慢 SQL,一直是 buferIO 的等待事件,此时也没有其他会话的争抢。SQL 虽然不是高效 SQL ,但…...

STM32---外部32.768K晶振(LSE)无法起振问题

晶振是否起振主要就检查两个1、晶振与MCU是否兼容&#xff1b;2、晶振的负载电容是否匹配 目录 一、判断晶振与MCU是否兼容 二、判断负载电容是否匹配 1. 晶振负载电容&#xff08;CL&#xff09;与匹配电容&#xff08;CL1、CL2&#xff09;的关系 2. 如何选择 CL1 和 CL…...

从“安全密码”到测试体系:Gitee Test 赋能关键领域软件质量保障

关键领域软件测试的"安全密码"&#xff1a;Gitee Test如何破解行业痛点 在数字化浪潮席卷全球的今天&#xff0c;软件系统已成为国家关键领域的"神经中枢"。从国防军工到能源电力&#xff0c;从金融交易到交通管控&#xff0c;这些关乎国计民生的关键领域…...