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_head.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_head.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_head-detection_damoyolo/summary
相关文章:
 
C# OnnxRuntime部署DAMO-YOLO人头检测
目录 说明 效果 模型信息 项目 代码 下载 参考 说明 效果 模型信息 Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- name:input tensor:Floa…...
 
基于GeoTools的GIS专题图自适应边界及高宽等比例生成实践
目录 前言 一、原来的生成方案问题 1、无法自动读取数据的Bounds 2、专题图高宽比例不协调 二、专题图生成优化 1、直接读取矢量数据的Bounds 2、专题图成果抗锯齿 3、专题成果高宽比例自动调节 三、总结 前言 在当今数字化浪潮中,地理信息系统(…...
 
各种DCC软件使用Datasmith导入UE教程
3Dmax: 先安装插件 https://www.unrealengine.com/zh-CN/datasmith/plugins 左上角导出即可 虚幻中勾选3个插件,重启引擎 左上角选择文件导入即可 Blender导入Datasmith进UE 需要两个插件, 文章最下方链接进去下载安装即可 一样的,直接导出,然后UE导入即可 C4D 直接保存成…...
 
尚硅谷爬虫note15
一、当当网 1. 保存数据 数据交给pipelines保存 items中的类名: DemoNddwItem class DemoNddwItem(scrapy.Item): 变量名 类名() book DemoNddwItem(src src, name name, price price)导入: from 项目名.items import 类…...
 
云原生系列之本地k8s环境搭建
前置条件 Windows 11 家庭中文版,版本号 23H2 云原生环境搭建 操作系统启用wsl(windows subsystem for linux) 开启wsl功能,如下图 安装并开启github加速器 FastGithub 2.1 下载地址:点击下载 2.2 解压安装文件fastgithub_win-x64.zip 2…...
 
关于tomcat使用中浏览器打开index.jsp后中文显示不正常是乱码,但英文正常的问题
如果是jsp文件就在首行加 “<% page language"java" contentType"text/html; charsetUTF-8" pageEncoding"UTF-8" %>” 如果是html文件 在head标签加入: <meta charset"UTF-8"> 以jsp为例子,我们…...
mysql foreign_key_checks
foreign_key_checks是一个用于设置是否在DML/DDL操作中检查外键约束的系统变量。该变量默认启用,通常在正常操作期间启用以强制执行参照完整性。 功能描述 foreign_key_checks用于控制是否在DML(数据操纵语言)和DDL(数据定义…...
 
开发环境搭建-06.后端环境搭建-前后端联调-Nginx反向代理和负载均衡概念
一.前后端联调 我们首先来思考一个问题 前端的请求地址是:http://localhost/api/employee/login 后端的接口地址是:http://localhost:8080/admin/employee/login 明明请求地址和接口地址不同,那么前端是如何请求到后端接口所响应回来的数…...
REST API前端请求和后端接收
1、get请求,带"?" http://localhost:8080/api/aop/getResult?param123 GetMapping("getResult")public ResponseEntity<String> getResult(RequestParam("param") String param){return new ResponseEntity<>("12…...
道可云人工智能每日资讯|《奇遇三星堆》VR沉浸探索展(淮安站)开展
道可云元宇宙每日简报(2025年3月5日)讯,今日元宇宙新鲜事有: 《奇遇三星堆》VR沉浸探索展(淮安站)开展 近日,《奇遇三星堆》VR沉浸探索展(淮安站)开展。该展将三星堆文…...
 
服务器数据恢复—raid5阵列中硬盘掉线导致上层应用不可用的数据恢复案例
服务器数据恢复环境&故障: 某公司一台服务器,服务器上有一组由8块硬盘组建的raid5磁盘阵列。 磁盘阵列中2块硬盘的指示灯显示异常,其他硬盘指示灯显示正常。上层应用不可用。 服务器数据恢复过程: 1、将服务器中所有硬盘编号…...
【Pandas】pandas Series swaplevel
Pandas2.2 Series Computations descriptive stats 方法描述Series.argsort([axis, kind, order, stable])用于返回 Series 中元素排序后的索引位置的方法Series.argmin([axis, skipna])用于返回 Series 中最小值索引位置的方法Series.argmax([axis, skipna])用于返回 Series…...
 
esp32s3聊天机器人(二)
继续上文,硬件软件准备齐全,介绍一下主要用到的库 sherpa-onnx 开源的,语音转文本、文本转语音、说话人分类和 VAD,关键是支持C#开发 OllamaSharp 用于连接ollama,如其名C#开发 虽然离可玩还有一段距离࿰…...
 
pyside6学习专栏(九):在PySide6中使用PySide6.QtCharts绘制6种不同的图表的示例代码
PySide6的QtCharts类支持绘制各种型状的图表,如面积区域图、饼状图、折线图、直方图、线条曲线图、离散点图等,下面的代码是采用示例数据绘制这6种图表的示例代码,并可实现动画显示效果,实际使用时参照代码中示例数据的格式将实际数据替换即可…...
 
DVI分配器2进4出,2进8出,2进16出,120HZ
DVI(Digital Visual Interface)分配器GEFFEN/HDD系列是一种设备,它能够将一个DVI信号源的内容复制到多个显示设备上。根据您提供的信息,这里我们关注的是具有2个输入端口和多个(4个、8个或16个)输出端口的D…...
迷你世界脚本文字板接口:Graphics
文字板接口:Graphics 彼得兔 更新时间: 2024-08-27 11:12:18 具体函数名及描述如下: 序号 函数名 函数描述 1 makeGraphicsText(...) 创建文字板信息 2 makeflotageText(...) 创建漂浮文字信息 3 makeGraphicsProgress(...) 创建进度条信息…...
 
5分钟速览深度学习经典论文 —— attention is all you need
《Attention is All You Need》是一篇极其重要的论文,它提出的 Transformer 模型和自注意力机制不仅推动了 NLP 领域的发展,还对整个深度学习领域产生了深远影响。这篇论文的重要性体现在其开创性、技术突破和广泛应用上,是每一位深度学习研究…...
 
Cursor + IDEA 双开极速交互
相信很多开发者朋友应该和我一样吧,都是Cursor和IDEA双开的开发模式:在Cursor中快速编写和生成代码,然后在IDEA中进行调试和优化 在这个双开模式的开发过程中,我就遇到一个说大不大说小不小的问题: 得在两个编辑器之间来回切换查…...
 
HDFS的设计架构
HDFS 是 Hadoop 生态系统中的分布式文件系统,设计用于存储和处理超大规模数据集。它具有高可靠性、高扩展性和高吞吐量的特点,适合运行在廉价硬件上。 1. HDFS 的设计思想 HDFS 的设计目标是解决大规模数据存储和处理的问题,其核心设计思想…...
为wordpress自定义一个留言表单并可以在后台进行管理的实现方法
要为WordPress添加留言表单功能并实现后台管理,你可以按照以下步骤操作: 1. 创建留言表单 首先,你需要创建一个留言表单。可以使用插件(如Contact Form 7)或手动编写代码。 使用Contact Form 7插件 安装并激活Contact Form 7插件。 创建…...
 
网络编程(Modbus进阶)
思维导图 Modbus RTU(先学一点理论) 概念 Modbus RTU 是工业自动化领域 最广泛应用的串行通信协议,由 Modicon 公司(现施耐德电气)于 1979 年推出。它以 高效率、强健性、易实现的特点成为工业控制系统的通信标准。 包…...
 
C++初阶-list的底层
目录 1.std::list实现的所有代码 2.list的简单介绍 2.1实现list的类 2.2_list_iterator的实现 2.2.1_list_iterator实现的原因和好处 2.2.2_list_iterator实现 2.3_list_node的实现 2.3.1. 避免递归的模板依赖 2.3.2. 内存布局一致性 2.3.3. 类型安全的替代方案 2.3.…...
CVPR 2025 MIMO: 支持视觉指代和像素grounding 的医学视觉语言模型
CVPR 2025 | MIMO:支持视觉指代和像素对齐的医学视觉语言模型 论文信息 标题:MIMO: A medical vision language model with visual referring multimodal input and pixel grounding multimodal output作者:Yanyuan Chen, Dexuan Xu, Yu Hu…...
 
基于距离变化能量开销动态调整的WSN低功耗拓扑控制开销算法matlab仿真
目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.算法仿真参数 5.算法理论概述 6.参考文献 7.完整程序 1.程序功能描述 通过动态调整节点通信的能量开销,平衡网络负载,延长WSN生命周期。具体通过建立基于距离的能量消耗模型&am…...
【论文笔记】若干矿井粉尘检测算法概述
总的来说,传统机器学习、传统机器学习与深度学习的结合、LSTM等算法所需要的数据集来源于矿井传感器测量的粉尘浓度,通过建立回归模型来预测未来矿井的粉尘浓度。传统机器学习算法性能易受数据中极端值的影响。YOLO等计算机视觉算法所需要的数据集来源于…...
python如何将word的doc另存为docx
将 DOCX 文件另存为 DOCX 格式(Python 实现) 在 Python 中,你可以使用 python-docx 库来操作 Word 文档。不过需要注意的是,.doc 是旧的 Word 格式,而 .docx 是新的基于 XML 的格式。python-docx 只能处理 .docx 格式…...
sqlserver 根据指定字符 解析拼接字符串
DECLARE LotNo NVARCHAR(50)A,B,C DECLARE xml XML ( SELECT <x> REPLACE(LotNo, ,, </x><x>) </x> ) DECLARE ErrorCode NVARCHAR(50) -- 提取 XML 中的值 SELECT value x.value(., VARCHAR(MAX))…...
 
多模态大语言模型arxiv论文略读(108)
CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文标题:CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文作者:Sayna Ebrahimi, Sercan O. Arik, Tejas Nama, Tomas Pfister ➡️ 研究机构: Google Cloud AI Re…...
 
学习STC51单片机32(芯片为STC89C52RCRC)OLED显示屏2
每日一言 今天的每一份坚持,都是在为未来积攒底气。 案例:OLED显示一个A 这边观察到一个点,怎么雪花了就是都是乱七八糟的占满了屏幕。。 解释 : 如果代码里信号切换太快(比如 SDA 刚变,SCL 立刻变&#…...
Web 架构之 CDN 加速原理与落地实践
文章目录 一、思维导图二、正文内容(一)CDN 基础概念1. 定义2. 组成部分 (二)CDN 加速原理1. 请求路由2. 内容缓存3. 内容更新 (三)CDN 落地实践1. 选择 CDN 服务商2. 配置 CDN3. 集成到 Web 架构 …...
