C# OnnxRuntime部署DAMO-YOLO香烟检测
目录
说明
效果
模型信息
项目
代码
下载
参考
说明

效果

模型信息
Model Properties
-------------------------
---------------------------------------------------------------
Inputs
-------------------------
name:input
tensor:Float[1, 3, 640, 640]
---------------------------------------------------------------
Outputs
-------------------------
name:transposed_output
tensor:Float[1, 5, 8400]
---------------------------------------------------------------
项目

代码
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenCvSharp;
using OpenCvSharp.Dnn;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Onnx_Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";
string image_path = "";
string model_path;
string classer_path;
public string[] class_names;
public int class_num;
DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now;
int input_height;
int input_width;
InferenceSession onnx_session;
int box_num;
float conf_threshold;
float nms_threshold;
StringBuilder sb = new StringBuilder();
/// <summary>
/// 选择图片
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = fileFilter;
if (ofd.ShowDialog() != DialogResult.OK) return;
pictureBox1.Image = null;
image_path = ofd.FileName;
pictureBox1.Image = new Bitmap(image_path);
textBox1.Text = "";
pictureBox2.Image = null;
}
/// <summary>
/// 推理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
if (image_path == "")
{
return;
}
button2.Enabled = false;
pictureBox2.Image = null;
textBox1.Text = "";
sb.Clear();
Application.DoEvents();
Mat image = new Mat(image_path);
float ratio = Math.Min(input_height * 1.0f / image.Rows, input_width * 1.0f / image.Cols);
int neww = (int)(image.Cols * ratio);
int newh = (int)(image.Rows * ratio);
Mat dstimg = new Mat();
Cv2.CvtColor(image, dstimg, ColorConversionCodes.BGR2RGB);
Cv2.Resize(dstimg, dstimg, new OpenCvSharp.Size(neww, newh));
Cv2.CopyMakeBorder(dstimg, dstimg, 0, input_height - newh, 0, input_width - neww, BorderTypes.Constant, new Scalar(1));
//Cv2.ImShow("input_img", dstimg);
//输入Tensor
Tensor<float> input_tensor = new DenseTensor<float>(new[] { 1, 3, 640, 640 });
for (int y = 0; y < dstimg.Height; y++)
{
for (int x = 0; x < dstimg.Width; x++)
{
input_tensor[0, 0, y, x] = dstimg.At<Vec3b>(y, x)[0];
input_tensor[0, 1, y, x] = dstimg.At<Vec3b>(y, x)[1];
input_tensor[0, 2, y, x] = dstimg.At<Vec3b>(y, x)[2];
}
}
dstimg.Dispose();
List<NamedOnnxValue> input_container = new List<NamedOnnxValue>
{
NamedOnnxValue.CreateFromTensor("input", input_tensor)
};
//推理
dt1 = DateTime.Now;
var ort_outputs = onnx_session.Run(input_container).ToArray();
dt2 = DateTime.Now;
float[] data = Transpose(ort_outputs[0].AsTensor<float>().ToArray(), 4 + class_num, box_num);
float[] confidenceInfo = new float[class_num];
float[] rectData = new float[4];
List<DetectionResult> detResults = new List<DetectionResult>();
for (int i = 0; i < box_num; i++)
{
Array.Copy(data, i * (class_num + 4), rectData, 0, 4);
Array.Copy(data, i * (class_num + 4) + 4, confidenceInfo, 0, class_num);
float score = confidenceInfo.Max(); // 获取最大值
int maxIndex = Array.IndexOf(confidenceInfo, score); // 获取最大值的位置
int xmin = (int)(rectData[0] / ratio);
int ymin = (int)(rectData[1] / ratio);
int xmax = (int)(rectData[2] / ratio);
int ymax = (int)(rectData[3] / ratio);
Rect box = new Rect();
box.X = (int)xmin;
box.Y = (int)ymin;
box.Width = (int)(xmax - xmin);
box.Height = (int)(ymax - ymin);
detResults.Add(new DetectionResult(
maxIndex,
class_names[maxIndex],
box,
score));
}
//NMS
CvDnn.NMSBoxes(detResults.Select(x => x.Rect), detResults.Select(x => x.Confidence), conf_threshold, nms_threshold, out int[] indices);
detResults = detResults.Where((x, index) => indices.Contains(index)).ToList();
sb.AppendLine("推理耗时:" + (dt2 - dt1).TotalMilliseconds + "ms");
sb.AppendLine("------------------------------");
//绘制结果
Mat result_image = image.Clone();
foreach (DetectionResult r in detResults)
{
Cv2.PutText(result_image, $"{r.Class}:{r.Confidence:P0}", new OpenCvSharp.Point(r.Rect.TopLeft.X, r.Rect.TopLeft.Y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
Cv2.Rectangle(result_image, r.Rect, Scalar.Red, thickness: 2);
sb.AppendLine(string.Format("{0}:{1},({2},{3},{4},{5})"
, r.Class
, r.Confidence.ToString("P0")
, r.Rect.TopLeft.X
, r.Rect.TopLeft.Y
, r.Rect.BottomRight.X
, r.Rect.BottomRight.Y
));
}
if (pictureBox2.Image != null)
{
pictureBox2.Image.Dispose();
}
pictureBox2.Image = new Bitmap(result_image.ToMemoryStream());
result_image.Dispose();
textBox1.Text = sb.ToString();
button2.Enabled = true;
}
/// <summary>
///窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_Load(object sender, EventArgs e)
{
model_path = "model/damoyolo_cigarette.onnx";
//创建输出会话,用于输出模型读取信息
SessionOptions options = new SessionOptions();
options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_INFO;
options.AppendExecutionProvider_CPU(0);// 设置为CPU上运行
// 创建推理模型类,读取模型文件
onnx_session = new InferenceSession(model_path, options);//model_path 为onnx模型文件的路径
input_height = 640;
input_width = 640;
box_num = 8400;
conf_threshold = 0.25f;
nms_threshold = 0.5f;
classer_path = "model/lable.txt";
class_names = File.ReadAllLines(classer_path, Encoding.UTF8);
class_num = class_names.Length;
image_path = "test_img/2.jpg";
pictureBox1.Image = new Bitmap(image_path);
}
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
if (pictureBox2.Image == null)
{
return;
}
Bitmap output = new Bitmap(pictureBox2.Image);
SaveFileDialog sdf = new SaveFileDialog();
sdf.Title = "保存";
sdf.Filter = "Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.bmp)|*.bmp|Images (*.emf)|*.emf|Images (*.exif)|*.exif|Images (*.gif)|*.gif|Images (*.ico)|*.ico|Images (*.tiff)|*.tiff|Images (*.wmf)|*.wmf";
if (sdf.ShowDialog() == DialogResult.OK)
{
switch (sdf.FilterIndex)
{
case 1:
{
output.Save(sdf.FileName, ImageFormat.Jpeg);
break;
}
case 2:
{
output.Save(sdf.FileName, ImageFormat.Png);
break;
}
case 3:
{
output.Save(sdf.FileName, ImageFormat.Bmp);
break;
}
case 4:
{
output.Save(sdf.FileName, ImageFormat.Emf);
break;
}
case 5:
{
output.Save(sdf.FileName, ImageFormat.Exif);
break;
}
case 6:
{
output.Save(sdf.FileName, ImageFormat.Gif);
break;
}
case 7:
{
output.Save(sdf.FileName, ImageFormat.Icon);
break;
}
case 8:
{
output.Save(sdf.FileName, ImageFormat.Tiff);
break;
}
case 9:
{
output.Save(sdf.FileName, ImageFormat.Wmf);
break;
}
}
MessageBox.Show("保存成功,位置:" + sdf.FileName);
}
}
private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
ShowNormalImg(pictureBox1.Image);
}
private void pictureBox2_DoubleClick(object sender, EventArgs e)
{
ShowNormalImg(pictureBox2.Image);
}
public void ShowNormalImg(Image img)
{
if (img == null) return;
frmShow frm = new frmShow();
frm.Width = Screen.PrimaryScreen.Bounds.Width;
frm.Height = Screen.PrimaryScreen.Bounds.Height;
if (frm.Width > img.Width)
{
frm.Width = img.Width;
}
if (frm.Height > img.Height)
{
frm.Height = img.Height;
}
bool b = frm.richTextBox1.ReadOnly;
Clipboard.SetDataObject(img, true);
frm.richTextBox1.ReadOnly = false;
frm.richTextBox1.Paste(DataFormats.GetFormat(DataFormats.Bitmap));
frm.richTextBox1.ReadOnly = b;
frm.ShowDialog();
}
public unsafe float[] Transpose(float[] tensorData, int rows, int cols)
{
float[] transposedTensorData = new float[tensorData.Length];
fixed (float* pTensorData = tensorData)
{
fixed (float* pTransposedData = transposedTensorData)
{
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
int index = i * cols + j;
int transposedIndex = j * rows + i;
pTransposedData[transposedIndex] = pTensorData[index];
}
}
}
}
return transposedTensorData;
}
}
public class DetectionResult
{
public DetectionResult(int ClassId, string Class, Rect Rect, float Confidence)
{
this.ClassId = ClassId;
this.Confidence = Confidence;
this.Rect = Rect;
this.Class = Class;
}
public string Class { get; set; }
public int ClassId { get; set; }
public float Confidence { get; set; }
public Rect Rect { get; set; }
}
}
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenCvSharp;
using OpenCvSharp.Dnn;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace Onnx_Demo
{public partial class Form1 : Form{public Form1(){InitializeComponent();}string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";string image_path = "";string model_path;string classer_path;public string[] class_names;public int class_num;DateTime dt1 = DateTime.Now;DateTime dt2 = DateTime.Now;int input_height;int input_width;InferenceSession onnx_session;int box_num;float conf_threshold;float nms_threshold;StringBuilder sb = new StringBuilder();/// <summary>/// 选择图片/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button1_Click(object sender, EventArgs e){OpenFileDialog ofd = new OpenFileDialog();ofd.Filter = fileFilter;if (ofd.ShowDialog() != DialogResult.OK) return;pictureBox1.Image = null;image_path = ofd.FileName;pictureBox1.Image = new Bitmap(image_path);textBox1.Text = "";pictureBox2.Image = null;}/// <summary>/// 推理/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button2_Click(object sender, EventArgs e){if (image_path == ""){return;}button2.Enabled = false;pictureBox2.Image = null;textBox1.Text = "";sb.Clear();Application.DoEvents();Mat image = new Mat(image_path);float ratio = Math.Min(input_height * 1.0f / image.Rows, input_width * 1.0f / image.Cols);int neww = (int)(image.Cols * ratio);int newh = (int)(image.Rows * ratio);Mat dstimg = new Mat();Cv2.CvtColor(image, dstimg, ColorConversionCodes.BGR2RGB);Cv2.Resize(dstimg, dstimg, new OpenCvSharp.Size(neww, newh));Cv2.CopyMakeBorder(dstimg, dstimg, 0, input_height - newh, 0, input_width - neww, BorderTypes.Constant, new Scalar(1));//Cv2.ImShow("input_img", dstimg);//输入TensorTensor<float> input_tensor = new DenseTensor<float>(new[] { 1, 3, 640, 640 });for (int y = 0; y < dstimg.Height; y++){for (int x = 0; x < dstimg.Width; x++){input_tensor[0, 0, y, x] = dstimg.At<Vec3b>(y, x)[0];input_tensor[0, 1, y, x] = dstimg.At<Vec3b>(y, x)[1];input_tensor[0, 2, y, x] = dstimg.At<Vec3b>(y, x)[2];}}dstimg.Dispose();List<NamedOnnxValue> input_container = new List<NamedOnnxValue>{NamedOnnxValue.CreateFromTensor("input", input_tensor)};//推理dt1 = DateTime.Now;var ort_outputs = onnx_session.Run(input_container).ToArray();dt2 = DateTime.Now;float[] data = Transpose(ort_outputs[0].AsTensor<float>().ToArray(), 4 + class_num, box_num);float[] confidenceInfo = new float[class_num];float[] rectData = new float[4];List<DetectionResult> detResults = new List<DetectionResult>();for (int i = 0; i < box_num; i++){Array.Copy(data, i * (class_num + 4), rectData, 0, 4);Array.Copy(data, i * (class_num + 4) + 4, confidenceInfo, 0, class_num);float score = confidenceInfo.Max(); // 获取最大值int maxIndex = Array.IndexOf(confidenceInfo, score); // 获取最大值的位置int xmin = (int)(rectData[0] / ratio);int ymin = (int)(rectData[1] / ratio);int xmax = (int)(rectData[2] / ratio);int ymax = (int)(rectData[3] / ratio);Rect box = new Rect();box.X = (int)xmin;box.Y = (int)ymin;box.Width = (int)(xmax - xmin);box.Height = (int)(ymax - ymin);detResults.Add(new DetectionResult(maxIndex,class_names[maxIndex],box,score));}//NMSCvDnn.NMSBoxes(detResults.Select(x => x.Rect), detResults.Select(x => x.Confidence), conf_threshold, nms_threshold, out int[] indices);detResults = detResults.Where((x, index) => indices.Contains(index)).ToList();sb.AppendLine("推理耗时:" + (dt2 - dt1).TotalMilliseconds + "ms");sb.AppendLine("------------------------------");//绘制结果Mat result_image = image.Clone();foreach (DetectionResult r in detResults){Cv2.PutText(result_image, $"{r.Class}:{r.Confidence:P0}", new OpenCvSharp.Point(r.Rect.TopLeft.X, r.Rect.TopLeft.Y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.Rectangle(result_image, r.Rect, Scalar.Red, thickness: 2);sb.AppendLine(string.Format("{0}:{1},({2},{3},{4},{5})", r.Class, r.Confidence.ToString("P0"), r.Rect.TopLeft.X, r.Rect.TopLeft.Y, r.Rect.BottomRight.X, r.Rect.BottomRight.Y));}if (pictureBox2.Image != null){pictureBox2.Image.Dispose();}pictureBox2.Image = new Bitmap(result_image.ToMemoryStream());result_image.Dispose();textBox1.Text = sb.ToString();button2.Enabled = true;}/// <summary>///窗体加载/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void Form1_Load(object sender, EventArgs e){model_path = "model/damoyolo_cigarette.onnx";//创建输出会话,用于输出模型读取信息SessionOptions options = new SessionOptions();options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_INFO;options.AppendExecutionProvider_CPU(0);// 设置为CPU上运行// 创建推理模型类,读取模型文件onnx_session = new InferenceSession(model_path, options);//model_path 为onnx模型文件的路径input_height = 640;input_width = 640;box_num = 8400;conf_threshold = 0.25f;nms_threshold = 0.5f;classer_path = "model/lable.txt";class_names = File.ReadAllLines(classer_path, Encoding.UTF8);class_num = class_names.Length;image_path = "test_img/2.jpg";pictureBox1.Image = new Bitmap(image_path);}/// <summary>/// 保存/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button3_Click(object sender, EventArgs e){if (pictureBox2.Image == null){return;}Bitmap output = new Bitmap(pictureBox2.Image);SaveFileDialog sdf = new SaveFileDialog();sdf.Title = "保存";sdf.Filter = "Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.bmp)|*.bmp|Images (*.emf)|*.emf|Images (*.exif)|*.exif|Images (*.gif)|*.gif|Images (*.ico)|*.ico|Images (*.tiff)|*.tiff|Images (*.wmf)|*.wmf";if (sdf.ShowDialog() == DialogResult.OK){switch (sdf.FilterIndex){case 1:{output.Save(sdf.FileName, ImageFormat.Jpeg);break;}case 2:{output.Save(sdf.FileName, ImageFormat.Png);break;}case 3:{output.Save(sdf.FileName, ImageFormat.Bmp);break;}case 4:{output.Save(sdf.FileName, ImageFormat.Emf);break;}case 5:{output.Save(sdf.FileName, ImageFormat.Exif);break;}case 6:{output.Save(sdf.FileName, ImageFormat.Gif);break;}case 7:{output.Save(sdf.FileName, ImageFormat.Icon);break;}case 8:{output.Save(sdf.FileName, ImageFormat.Tiff);break;}case 9:{output.Save(sdf.FileName, ImageFormat.Wmf);break;}}MessageBox.Show("保存成功,位置:" + sdf.FileName);}}private void pictureBox1_DoubleClick(object sender, EventArgs e){ShowNormalImg(pictureBox1.Image);}private void pictureBox2_DoubleClick(object sender, EventArgs e){ShowNormalImg(pictureBox2.Image);}public void ShowNormalImg(Image img){if (img == null) return;frmShow frm = new frmShow();frm.Width = Screen.PrimaryScreen.Bounds.Width;frm.Height = Screen.PrimaryScreen.Bounds.Height;if (frm.Width > img.Width){frm.Width = img.Width;}if (frm.Height > img.Height){frm.Height = img.Height;}bool b = frm.richTextBox1.ReadOnly;Clipboard.SetDataObject(img, true);frm.richTextBox1.ReadOnly = false;frm.richTextBox1.Paste(DataFormats.GetFormat(DataFormats.Bitmap));frm.richTextBox1.ReadOnly = b;frm.ShowDialog();}public unsafe float[] Transpose(float[] tensorData, int rows, int cols){float[] transposedTensorData = new float[tensorData.Length];fixed (float* pTensorData = tensorData){fixed (float* pTransposedData = transposedTensorData){for (int i = 0; i < rows; i++){for (int j = 0; j < cols; j++){int index = i * cols + j;int transposedIndex = j * rows + i;pTransposedData[transposedIndex] = pTensorData[index];}}}}return transposedTensorData;}}public class DetectionResult{public DetectionResult(int ClassId, string Class, Rect Rect, float Confidence){this.ClassId = ClassId;this.Confidence = Confidence;this.Rect = Rect;this.Class = Class;}public string Class { get; set; }public int ClassId { get; set; }public float Confidence { get; set; }public Rect Rect { get; set; }}}
下载
源码下载
参考
https://modelscope.cn/models/iic/cv_tinynas_object-detection_damoyolo_cigarette/summary
相关文章:
C# OnnxRuntime部署DAMO-YOLO香烟检测
目录 说明 效果 模型信息 项目 代码 下载 参考 说明 效果 模型信息 Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- name:input tensor:Floa…...
GitHub开源协议选择指南:如何为你的项目找到最佳“许可证”?
引言 当你站在GitHub仓库创建的十字路口时,是否曾被众多开源协议晃花了眼? 别担心!这篇指南将化身你的"协议导航仪",用一张流程图五个灵魂拷问,帮你轻松找到最佳选择。无论你是开发者、开源爱好者ÿ…...
[密码学实战]Java生成SM2根证书及用户证书
前言 在国密算法体系中,SM2是基于椭圆曲线密码(ECC)的非对称加密算法,广泛应用于数字证书、签名验签等场景。本文将结合代码实现,详细讲解如何通过Java生成SM2根证书及用户证书,并深入分析其核心原理。 一、证书验证 1.代码运行结果 2.根证书验证 3.用户证书验证 二、…...
安装 cnpm 出现 Unsupported URL Type “npm:“: npm:string-width@^4.2.0
Unsupported URL Type "npm:": npm:string-width^4.2.0 可能是 node 版本太低了,需要安装低版本的 cnpm 试试 npm cache clean --force npm config set strict-ssl false npm install -g cnpm --registryhttps://registry.npmmirror.com 改为 npm insta…...
探秘基带算法:从原理到5G时代的通信变革【九】QPSK调制/解调
文章目录 2.8 QPSK 调制 / 解调简介QPSK 发射机的实现与原理QPSK 接收机的实现与原理QPSK 性能仿真QPSK 变体分析 本博客为系列博客,主要讲解各基带算法的原理与应用,包括:viterbi解码、Turbo编解码、Polar编解码、CORDIC算法、CRC校验、FFT/…...
四、数据存储
在爬虫项目中,我们需要将目标站点数据进行持久化保存,一般数据保存的方式有两种: 文件保存数据库保存 在数据保存的过程中需要对数据完成去重操作,所有需要使用 redis 中的 set 数据类型完成去重。 1.CSV文件存储 1.1 什么是c…...
C# OnnxRuntime部署DAMO-YOLO人头检测
目录 说明 效果 模型信息 项目 代码 下载 参考 说明 效果 模型信息 Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- name:input tensor:Floa…...
Metal学习笔记七:片元函数
知道如何通过将顶点数据发送到 vertex 函数来渲染三角形、线条和点是一项非常巧妙的技能 — 尤其是因为您能够使用简单的单行片段函数为形状着色。但是,片段着色器能够执行更多操作。 ➤ 打开网站 https://shadertoy.com,在那里您会发现大量令人眼花缭乱…...
《一个端粒到端粒的参考基因组为木瓜中五环三萜类化合物生物合成提供了遗传学见解》
A telomere-to-telomere reference genome provides genetic insight into the pentacyclic triterpenoid biosynthesis in Chaenomeles speciosa Amplification of transposable elements 转座元件的扩增 Sequence mining disclosed that TEs were one main event in the ex…...
【Mac】2025-MacOS系统下常用的开发环境配置
早期版本的一个环境搭建参考 1、brew Mac自带终端运行: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Installation successful!成功后运行三行命令后更新环境(xxx是mac的username&a…...
蓝桥杯web第三天
展开扇子题目, #box:hover #item1 { transform:rotate(-60deg); } 当悬浮在父盒子,子元素旋转 webkit display: -webkit-box:将元素设置为弹性伸缩盒子模型。-webkit-box-orient: vertical:设置伸缩盒子的子元素排列方…...
Qt基础入门-详解
前言 qt之路正式开启 💓 个人主页:普通young man-CSDN博客 ⏩ 文章专栏:C_普通young man的博客-CSDN博客 ⏩ 本人giee: 普通小青年 (pu-tong-young-man) - Gitee.com 若有问题 评论区见📝 🎉欢迎大家点赞ὄ…...
FPGA开发,使用Deepseek V3还是R1(3):系统级与RTL级
以下都是Deepseek生成的答案 FPGA开发,使用Deepseek V3还是R1(1):应用场景 FPGA开发,使用Deepseek V3还是R1(2):V3和R1的区别 FPGA开发,使用Deepseek V3还是R1&#x…...
移动端国际化翻译同步解决方案-V3
1.前言 因为软件出海,从在上上家公司就开始做翻译系统,到目前为止已经出了两个比较大的版本了,各个版本解决的痛点如下: V1版本: 主要针对的是AndroidiOS翻译不一致和翻译内容管理麻烦的问题,通过这个工具…...
多空狙击线-新指标-图文教程,多空分界买点以及强弱操盘技术教程,通达信炒股软件指标
“多空狙击线”指标 “多空狙击线”特色指标是量能型技术指标,主要用于分析股票市场中机构做多/做空力量的强程度。该指标的构成、定义与原理如下: “多空狙击线”指标,又称机构做多/做空能量线,通过计算和分析股票市场中机构做多/做空力量…...
零信任架构和传统网络安全模式的
零信任到底是一个什么类型的模型?什么类型的思想或思路,它是如何实现的,我们要做零信任,需要考虑哪些问题? 零信任最早是约翰金德瓦格提出的安全模型。早期这个模型也是因为在安全研究上考虑的一个新的信任式模型。他最…...
Oracle 11g的部署配置
1、进入官网下载所需版本的Oracle 2、安装 ①:选择setup.exe开始安装 ②:安装提示如下,直接忽略,选是 ③:配置安全更新 填写邮箱,并取消勾选 ④:如果点击下一步,提示什么代理啥的…...
下载b站视频音频
文章目录 方案一:jjdown如何使用 方案二:bilibili哔哩哔哩下载助手如何使用进入插件网站插件下载插件安装 使用插件下载视频音频:复制音频下载地址 方案三:bat命令下载单个音频下载单个视频下载单个音视频 方案一:jjdo…...
记录spring-boot 3.X版本整合RocketMq
版本信息 先把该次整合的版本信息列如下: spring-boot spring-cloud rocketmq-spring-boot-starter rocketmq-client rocketmq 3.0.13 2022.0.5 2.2.3 4.9.8 4.9.8 版本信息是如何选择的呢?看rocketMq官网springcloud alibaba版本声明 rock…...
《基于HarmonyOS NEXT API 12+,搭建新闻创作智能写作引擎》
在信息爆炸的时代,新闻行业对于内容生产的效率和质量有着极高的要求。AI技术的发展为新闻创作带来了新的变革契机,借助AI智能写作助手,新闻工作者可以快速生成新闻稿件的初稿,大大提高创作效率。本文将基于HarmonyOS NEXT API 12及…...
探秘基带算法:从原理到5G时代的通信变革【六】CRC 校验
文章目录 2.5 CRC 校验2.5.1 前言2.5.2 CRC算法简介2.5.3 CRC计算的详细过程2.5.4 CRC校验的两种方法详解**分离比较法****整体运算法****不同位出错与余数的关系****总结** 2.5.5 CRC计算的C实现及工具介绍**C实现CRC计算****CRC计算工具推荐** **2.5.6 总结:CRC校…...
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_conf_add_dump
ngx_conf_add_dump 定义在src\core\ngx_conf_file.c static ngx_int_t ngx_conf_add_dump(ngx_conf_t *cf, ngx_str_t *filename) {off_t size;u_char *p;uint32_t hash;ngx_buf_t *buf;ngx_str_node_t *sn;ngx_conf_dump_t *cd;has…...
MySQL快速搭建主从复制
一、基于位点的主从复制部署流程 确定主库Binlog是否开启修改主从server_id主库导出数据从库导入数据确定主库备份时的位点在从库配置主库信息查看复制状态并测试数据是否同步 二、准备阶段(主库和从库配置都需要修改) 1、确定主库Binlog是否开启 2、修改主从se…...
Linux注册进程终止处理函数
atexit() 是一个标准库函数,用于注册在进程正常终止时要调用的函数。通过 atexit(),你可以确保在程序结束时自动执行一些清理工作,比如释放资源、保存状态等。 函数原型如下: #include <stdlib.h> int atexit(void (*func…...
pytorch 模型测试
在使用 PyTorch 进行模型测试时,一般包含加载测试数据、加载训练好的模型、进行推理以及评估模型性能等步骤。以下为你详细介绍每个步骤及对应的代码示例。 1. 导入必要的库 import torch import torch.nn as nn import torchvision import torchvision.transforms as trans…...
水仙花数(华为OD)
题目描述 所谓水仙花数,是指一个n位的正整数,其各位数字的n次方和等于该数本身。 例如153是水仙花数,153是一个3位数,并且153 13 53 33。 输入描述 第一行输入一个整数n,表示一个n位的正整数。n在3到7之间&#x…...
(十二)基于 Vue 3 和 Mapbox GL 实现的坐标拾取器组件示例
下面是一个基于 Vue 3 和 Mapbox GL 实现的坐标拾取器组件示例: <template><div class="map-container"><div ref="mapContainer" class="map"></div><div class="coordinates-box"><div v-if=&qu…...
【华为OD机试真题29.9¥】(E卷,100分) - IPv4地址转换成整数(Java Python JS C++ C )
题目描述 存在一种虚拟IPv4地址,由4小节组成,每节的范围为0~255,以#号间隔,虚拟IPv4地址可以转换为一个32位的整数,例如: 128#0#255#255,转换为32位整数的结果为2147549183(0x8000FFFF) 1#0#0#0,转换为32位整数的结果为16777216(0x01000000) 现以字符串形式给出一…...
《白帽子讲 Web 安全》之深入同源策略(万字详解)
目录 引言 一、同源策略基础认知 (一)定义 (二)作用 (三)作用机制详解 二、同源策略的分类 (一)域名同源策略 (二)协议同源策略 (三&…...
USRP4120-通用软件无线电平台
1、产品描述 USRP4120平台是彬鸿科技公司推出的以XILINX XC7Z020 SOC处理器为核心,搭配ADI AD9361射频集成芯片,针对无线通信系统科研与教学实验场景的一款通用软件无线电平台。产品频率范围70MHz~6GHz,模拟带宽200KHz~56MHz,支持…...
