C# OpenCvSharp DNN 部署YOLOV6目標檢測

目錄

效果

模型信息

項目

代碼

下載


C# OpenCvSharp DNN 部署YOLOV6目標檢測

效果

模型信息

Inputs
-------------------------
name:image_arrays
tensor:Float[1, 3, 640, 640]
---------------------------------------------------------------

Outputs
-------------------------
name:outputs
tensor:Float[1, 8400, 85]
---------------------------------------------------------------

項目

代碼

using OpenCvSharp;
using OpenCvSharp.Dnn;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace OpenCvSharp_DNN_Demo
{
? ? public partial class frmMain : Form
? ? {
? ? ? ? public frmMain()
? ? ? ? {
? ? ? ? ? ? InitializeComponent();
? ? ? ? }

? ? ? ? string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";
? ? ? ? string image_path = "";

? ? ? ? DateTime dt1 = DateTime.Now;
? ? ? ? DateTime dt2 = DateTime.Now;

? ? ? ? float confThreshold;
? ? ? ? float nmsThreshold;
? ? ? ? string modelpath;

? ? ? ? int inpHeight;
? ? ? ? int inpWidth;

? ? ? ? List<string> class_names;
? ? ? ? int num_class;

? ? ? ? Net opencv_net;
? ? ? ? Mat BN_image;

? ? ? ? Mat image;
? ? ? ? Mat result_image;

? ? ? ? private void button1_Click(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? OpenFileDialog ofd = new OpenFileDialog();
? ? ? ? ? ? ofd.Filter = fileFilter;
? ? ? ? ? ? if (ofd.ShowDialog() != DialogResult.OK) return;

? ? ? ? ? ? pictureBox1.Image = null;
? ? ? ? ? ? pictureBox2.Image = null;
? ? ? ? ? ? textBox1.Text = "";

? ? ? ? ? ? image_path = ofd.FileName;
? ? ? ? ? ? pictureBox1.Image = new Bitmap(image_path);
? ? ? ? ? ? image = new Mat(image_path);
? ? ? ? }

? ? ? ? private void Form1_Load(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? confThreshold = 0.3f;
? ? ? ? ? ? nmsThreshold = 0.5f;
? ? ? ? ? ? modelpath = "model/yolov6s.onnx";

? ? ? ? ? ? inpHeight = 640;
? ? ? ? ? ? inpWidth = 640;

? ? ? ? ? ? opencv_net = CvDnn.ReadNetFromOnnx(modelpath);

? ? ? ? ? ? class_names = new List<string>();
? ? ? ? ? ? StreamReader sr = new StreamReader("model/coco.names");
? ? ? ? ? ? string line;
? ? ? ? ? ? while ((line = sr.ReadLine()) != null)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? class_names.Add(line);
? ? ? ? ? ? }
? ? ? ? ? ? num_class = class_names.Count();

? ? ? ? ? ? image_path = "test_img/image3.jpg";
? ? ? ? ? ? pictureBox1.Image = new Bitmap(image_path);

? ? ? ? }

? ? ? ? float sigmoid(float x)
? ? ? ? {
? ? ? ? ? ? return (float)(1.0 / (1 + Math.Exp(-x)));
? ? ? ? }

? ? ? ? Mat ResizeImage(Mat srcimg, out int newh, out int neww, out int top, out int left)
? ? ? ? {
? ? ? ? ? ? int srch = srcimg.Rows, srcw = srcimg.Cols;
? ? ? ? ? ? top = 0;
? ? ? ? ? ? left = 0;
? ? ? ? ? ? newh = inpHeight;
? ? ? ? ? ? neww = inpWidth;
? ? ? ? ? ? Mat dstimg = new Mat();
? ? ? ? ? ? if (srch != srcw)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? float hw_scale = (float)srch / srcw;
? ? ? ? ? ? ? ? if (hw_scale > 1)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? newh = inpHeight;
? ? ? ? ? ? ? ? ? ? neww = (int)(inpWidth / hw_scale);
? ? ? ? ? ? ? ? ? ? Cv2.Resize(srcimg, dstimg, new OpenCvSharp.Size(neww, newh), 0, 0, InterpolationFlags.Area);
? ? ? ? ? ? ? ? ? ? left = (int)((inpWidth - neww) * 0.5);
? ? ? ? ? ? ? ? ? ? Cv2.CopyMakeBorder(dstimg, dstimg, 0, 0, left, inpWidth - neww - left, BorderTypes.Constant);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? newh = (int)(inpHeight * hw_scale);
? ? ? ? ? ? ? ? ? ? neww = inpWidth;
? ? ? ? ? ? ? ? ? ? Cv2.Resize(srcimg, dstimg, new OpenCvSharp.Size(neww, newh), 0, 0, InterpolationFlags.Area);
? ? ? ? ? ? ? ? ? ? top = (int)((inpHeight - newh) * 0.5);
? ? ? ? ? ? ? ? ? ? Cv2.CopyMakeBorder(dstimg, dstimg, top, inpHeight - newh - top, 0, 0, BorderTypes.Constant);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Cv2.Resize(srcimg, dstimg, new OpenCvSharp.Size(neww, newh));
? ? ? ? ? ? }
? ? ? ? ? ? return dstimg;
? ? ? ? }

? ? ? ? private unsafe void button2_Click(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? if (image_path == "")
? ? ? ? ? ? {
? ? ? ? ? ? ? ? return;
? ? ? ? ? ? }
? ? ? ? ? ? textBox1.Text = "檢測中,請稍等……";
? ? ? ? ? ? pictureBox2.Image = null;
? ? ? ? ? ? Application.DoEvents();

? ? ? ? ? ? image = new Mat(image_path);

? ? ? ? ? ? int newh = 0, neww = 0, padh = 0, padw = 0;
? ? ? ? ? ? Mat dstimg = ResizeImage(image, out newh, out neww, out padh, out padw);

? ? ? ? ? ? BN_image = CvDnn.BlobFromImage(dstimg, 1 / 255.0, new OpenCvSharp.Size(inpWidth, inpHeight), new Scalar(0, 0, 0), true, false);

? ? ? ? ? ? //配置圖片輸入數據
? ? ? ? ? ? opencv_net.SetInput(BN_image);

? ? ? ? ? ? //模型推理,讀取推理結果
? ? ? ? ? ? Mat[] outs = new Mat[3] { new Mat(), new Mat(), new Mat() };
? ? ? ? ? ? string[] outBlobNames = opencv_net.GetUnconnectedOutLayersNames().ToArray();

? ? ? ? ? ? dt1 = DateTime.Now;

? ? ? ? ? ? opencv_net.Forward(outs, outBlobNames);

? ? ? ? ? ? dt2 = DateTime.Now;

? ? ? ? ? ? int num_proposal = outs[0].Size(0);
? ? ? ? ? ? int nout = outs[0].Size(1);

? ? ? ? ? ? if (outs[0].Dims > 2)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? num_proposal = outs[0].Size(1);
? ? ? ? ? ? ? ? nout = outs[0].Size(2);
? ? ? ? ? ? ? ? outs[0] = outs[0].Reshape(0, num_proposal);
? ? ? ? ? ? }

? ? ? ? ? ? float ratioh = 1.0f * image.Rows / newh, ratiow = 1.0f * image.Cols / neww;
? ? ? ? ? ? int n = 0, row_ind = 0; ///cx,cy,w,h,box_score,class_score
? ? ? ? ? ? float* pdata = (float*)outs[0].Data;

? ? ? ? ? ? List<Rect> boxes = new List<Rect>();
? ? ? ? ? ? List<float> confidences = new List<float>();
? ? ? ? ? ? List<int> classIds = new List<int>();

? ? ? ? ? ? for (n = 0; n < num_proposal; n++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? float box_score = pdata[4];

? ? ? ? ? ? ? ? if (box_score > confThreshold)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Mat scores = outs[0].Row(row_ind).ColRange(5, nout);
? ? ? ? ? ? ? ? ? ? double minVal, max_class_socre;
? ? ? ? ? ? ? ? ? ? OpenCvSharp.Point minLoc, classIdPoint;
? ? ? ? ? ? ? ? ? ? // Get the value and location of the maximum score
? ? ? ? ? ? ? ? ? ? Cv2.MinMaxLoc(scores, out minVal, out max_class_socre, out minLoc, out classIdPoint);
? ? ? ? ? ? ? ? ? ? max_class_socre *= box_score;

? ? ? ? ? ? ? ? ? ? int class_idx = classIdPoint.X;

? ? ? ? ? ? ? ? ? ? float cx = (pdata[0] - padw) * ratiow; ?//cx
? ? ? ? ? ? ? ? ? ? float cy = (pdata[1] - padh) * ratioh; ? //cy
? ? ? ? ? ? ? ? ? ? float w = pdata[2] * ratiow; ? //w
? ? ? ? ? ? ? ? ? ? float h = pdata[3] * ratioh; ?//h

? ? ? ? ? ? ? ? ? ? int left = (int)(cx - 0.5 * w);
? ? ? ? ? ? ? ? ? ? int top = (int)(cy - 0.5 * h);

? ? ? ? ? ? ? ? ? ? confidences.Add((float)max_class_socre);
? ? ? ? ? ? ? ? ? ? boxes.Add(new Rect(left, top, (int)w, (int)h));
? ? ? ? ? ? ? ? ? ? classIds.Add(class_idx);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? row_ind++;
? ? ? ? ? ? ? ? pdata += nout;

? ? ? ? ? ? }

? ? ? ? ? ? int[] indices;
? ? ? ? ? ? CvDnn.NMSBoxes(boxes, confidences, confThreshold, nmsThreshold, out indices);

? ? ? ? ? ? result_image = image.Clone();

? ? ? ? ? ? for (int ii = 0; ii < indices.Length; ++ii)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? int idx = indices[ii];
? ? ? ? ? ? ? ? Rect box = boxes[idx];
? ? ? ? ? ? ? ? Cv2.Rectangle(result_image, new OpenCvSharp.Point(box.X, box.Y), new OpenCvSharp.Point(box.X + box.Width, box.Y + box.Height), new Scalar(0, 0, 255), 2);
? ? ? ? ? ? ? ? string label = class_names[classIds[idx]] + ":" + confidences[idx].ToString("0.00");
? ? ? ? ? ? ? ? Cv2.PutText(result_image, label, new OpenCvSharp.Point(box.X, box.Y - 5), HersheyFonts.HersheySimplex, 0.75, new Scalar(0, 0, 255), 1);
? ? ? ? ? ? }

? ? ? ? ? ? pictureBox2.Image = new Bitmap(result_image.ToMemoryStream());
? ? ? ? ? ? textBox1.Text = "推理耗時:" + (dt2 - dt1).TotalMilliseconds + "ms";
? ? ? ? }

? ? ? ? private void pictureBox2_DoubleClick(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? Common.ShowNormalImg(pictureBox2.Image);
? ? ? ? }

? ? ? ? private void pictureBox1_DoubleClick(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? Common.ShowNormalImg(pictureBox1.Image);
? ? ? ? }
? ? }
}

using OpenCvSharp;
using OpenCvSharp.Dnn;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;namespace OpenCvSharp_DNN_Demo
{public partial class frmMain : Form{public frmMain(){InitializeComponent();}string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";string image_path = "";DateTime dt1 = DateTime.Now;DateTime dt2 = DateTime.Now;float confThreshold;float nmsThreshold;string modelpath;int inpHeight;int inpWidth;List<string> class_names;int num_class;Net opencv_net;Mat BN_image;Mat image;Mat result_image;private void button1_Click(object sender, EventArgs e){OpenFileDialog ofd = new OpenFileDialog();ofd.Filter = fileFilter;if (ofd.ShowDialog() != DialogResult.OK) return;pictureBox1.Image = null;pictureBox2.Image = null;textBox1.Text = "";image_path = ofd.FileName;pictureBox1.Image = new Bitmap(image_path);image = new Mat(image_path);}private void Form1_Load(object sender, EventArgs e){confThreshold = 0.3f;nmsThreshold = 0.5f;modelpath = "model/yolov6s.onnx";inpHeight = 640;inpWidth = 640;opencv_net = CvDnn.ReadNetFromOnnx(modelpath);class_names = new List<string>();StreamReader sr = new StreamReader("model/coco.names");string line;while ((line = sr.ReadLine()) != null){class_names.Add(line);}num_class = class_names.Count();image_path = "test_img/image3.jpg";pictureBox1.Image = new Bitmap(image_path);}float sigmoid(float x){return (float)(1.0 / (1 + Math.Exp(-x)));}Mat ResizeImage(Mat srcimg, out int newh, out int neww, out int top, out int left){int srch = srcimg.Rows, srcw = srcimg.Cols;top = 0;left = 0;newh = inpHeight;neww = inpWidth;Mat dstimg = new Mat();if (srch != srcw){float hw_scale = (float)srch / srcw;if (hw_scale > 1){newh = inpHeight;neww = (int)(inpWidth / hw_scale);Cv2.Resize(srcimg, dstimg, new OpenCvSharp.Size(neww, newh), 0, 0, InterpolationFlags.Area);left = (int)((inpWidth - neww) * 0.5);Cv2.CopyMakeBorder(dstimg, dstimg, 0, 0, left, inpWidth - neww - left, BorderTypes.Constant);}else{newh = (int)(inpHeight * hw_scale);neww = inpWidth;Cv2.Resize(srcimg, dstimg, new OpenCvSharp.Size(neww, newh), 0, 0, InterpolationFlags.Area);top = (int)((inpHeight - newh) * 0.5);Cv2.CopyMakeBorder(dstimg, dstimg, top, inpHeight - newh - top, 0, 0, BorderTypes.Constant);}}else{Cv2.Resize(srcimg, dstimg, new OpenCvSharp.Size(neww, newh));}return dstimg;}private unsafe void button2_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "檢測中,請稍等……";pictureBox2.Image = null;Application.DoEvents();image = new Mat(image_path);int newh = 0, neww = 0, padh = 0, padw = 0;Mat dstimg = ResizeImage(image, out newh, out neww, out padh, out padw);BN_image = CvDnn.BlobFromImage(dstimg, 1 / 255.0, new OpenCvSharp.Size(inpWidth, inpHeight), new Scalar(0, 0, 0), true, false);//配置圖片輸入數據opencv_net.SetInput(BN_image);//模型推理,讀取推理結果Mat[] outs = new Mat[3] { new Mat(), new Mat(), new Mat() };string[] outBlobNames = opencv_net.GetUnconnectedOutLayersNames().ToArray();dt1 = DateTime.Now;opencv_net.Forward(outs, outBlobNames);dt2 = DateTime.Now;int num_proposal = outs[0].Size(0);int nout = outs[0].Size(1);if (outs[0].Dims > 2){num_proposal = outs[0].Size(1);nout = outs[0].Size(2);outs[0] = outs[0].Reshape(0, num_proposal);}float ratioh = 1.0f * image.Rows / newh, ratiow = 1.0f * image.Cols / neww;int n = 0, row_ind = 0; ///cx,cy,w,h,box_score,class_scorefloat* pdata = (float*)outs[0].Data;List<Rect> boxes = new List<Rect>();List<float> confidences = new List<float>();List<int> classIds = new List<int>();for (n = 0; n < num_proposal; n++){float box_score = pdata[4];if (box_score > confThreshold){Mat scores = outs[0].Row(row_ind).ColRange(5, nout);double minVal, max_class_socre;OpenCvSharp.Point minLoc, classIdPoint;// Get the value and location of the maximum scoreCv2.MinMaxLoc(scores, out minVal, out max_class_socre, out minLoc, out classIdPoint);max_class_socre *= box_score;int class_idx = classIdPoint.X;float cx = (pdata[0] - padw) * ratiow;  //cxfloat cy = (pdata[1] - padh) * ratioh;   //cyfloat w = pdata[2] * ratiow;   //wfloat h = pdata[3] * ratioh;  //hint left = (int)(cx - 0.5 * w);int top = (int)(cy - 0.5 * h);confidences.Add((float)max_class_socre);boxes.Add(new Rect(left, top, (int)w, (int)h));classIds.Add(class_idx);}row_ind++;pdata += nout;}int[] indices;CvDnn.NMSBoxes(boxes, confidences, confThreshold, nmsThreshold, out indices);result_image = image.Clone();for (int ii = 0; ii < indices.Length; ++ii){int idx = indices[ii];Rect box = boxes[idx];Cv2.Rectangle(result_image, new OpenCvSharp.Point(box.X, box.Y), new OpenCvSharp.Point(box.X + box.Width, box.Y + box.Height), new Scalar(0, 0, 255), 2);string label = class_names[classIds[idx]] + ":" + confidences[idx].ToString("0.00");Cv2.PutText(result_image, label, new OpenCvSharp.Point(box.X, box.Y - 5), HersheyFonts.HersheySimplex, 0.75, new Scalar(0, 0, 255), 1);}pictureBox2.Image = new Bitmap(result_image.ToMemoryStream());textBox1.Text = "推理耗時:" + (dt2 - dt1).TotalMilliseconds + "ms";}private void pictureBox2_DoubleClick(object sender, EventArgs e){Common.ShowNormalImg(pictureBox2.Image);}private void pictureBox1_DoubleClick(object sender, EventArgs e){Common.ShowNormalImg(pictureBox1.Image);}}
}

下載

源碼下載

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/214004.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/214004.shtml
英文地址,請注明出處:http://en.pswp.cn/news/214004.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

一個不上進的愛好,讓我走進了計算機世界

為什么當初選擇計算機行業 當初選擇計算機專業&#xff0c;真的就是覺得學習計算機專業&#xff0c;就可以經常接觸計算機&#xff0c;可以有很多的機會可以玩游戲。 后來高考的時候&#xff0c;考試成績也不理想&#xff0c;分數就不好意思說了。但是喜從天降&#xff0c;居…

Windows Terminal的半透明效果

打開Windows Terminal的半透明效果 最終實現效果&#xff1a; 系統&#xff1a;win11 23H2 步驟&#xff1a; 1.winx打開終端 2.右鍵打開設置 3.打開外觀->亞克力材料開啟 4.默認值->外觀->透明度&#xff0c;按喜好選擇即可

Linux+Moba+虛擬機

軟件&#xff1a; VMware Workstation ProMobaXterm 簡介 是一款由VMware公司開發的強大的虛擬機軟件。它可以在單臺物理計算機上創建、運行和管理多個虛擬機&#xff0c;每個虛擬機都可以獨立運行不同的操作系統和應用程序。 功能&#xff1a; 虛擬化&#xff1a;能…

PPP協議概述與實驗示例

PPP協議概述與實驗示例 概述 PPP&#xff08;Point-to-Point Protocol&#xff09;是一種用于在點對點連接上傳輸多協議數據包的標準方法。它已經成為最廣泛使用的互聯網接入數據鏈路層協議&#xff0c;可以與各種技術結合&#xff0c;如ADSL、LAN等&#xff0c;實現寬帶接入…

如何通過內網穿透工具實現任意瀏覽器遠程訪問Linux本地zabbix web管理界面

前言 Zabbix是一個基于WEB界面的提供分布式系統監視以及網絡監視功能的企業級的開源解決方案。能監視各種網絡參數&#xff0c;保證服務器系統的安全運營&#xff1b;并提供靈活的通知機制以讓系統管理員快速定位/解決存在的各種問題。 本地zabbix web管理界面限制在只能局域…

MyBatis-Plus - 論 1 個實體類被 N 個DAO 類綁定,導致 MP 特性(邏輯刪)失效的解決方案

問題描述 最近遇到一個奇奇怪怪的問題&#xff0c;發現 Mybatis-Plus『邏輯刪』特性失效&#xff0c;而且是偶現&#xff0c;有時候可以&#xff0c;有時候又不行。于是開啟了 Debug Mybatis-Plus 源碼之旅 原因分析 我們接下來重點關注 TableInfoHelper 類 /** Copyright (…

算法:兩數之和(暴力解法和優化算法)

暴力解法&#xff1a;使用快慢指針解決&#xff0c;時間復雜度 O(n^2)&#xff0c;空間復雜度 O(n) /*** param {number[]} nums* param {number} target* return {number[]}*/ var twoSum function(nums, target) {let slow 0let fast 1// 如果慢指針沒有超過nums邊界就繼…

代理IP怎么使用?Mac蘋果系統設置http代理IP教程

代理IP是一種通過將請求轉發到另一個服務器&#xff0c;以隱藏自己的真實IP地址的服務器。使用代理IP可以保護您的隱私和安全&#xff0c;防止被跟蹤或被攻擊。在本文中&#xff0c;我們將介紹如何在Mac蘋果系統上設置http代理IP教程。 一、了解代理IP 代理IP地址是一種可以用來…

基于Java二手房交易管理系統

基于Java二手房交易管理系統 功能需求 1、房源信息管理&#xff1a;系統需要能夠記錄和管理所有房源的詳細信息&#xff0c;包括房屋地址、房屋面積、售價、房屋類型等。管理員和房東可以添加、編輯和刪除房源信息。 2、買家信息管理&#xff1a;系統需要能夠記錄和管理所有…

2023.12.9 關于 Spring Boot 事務傳播機制詳解

目錄 事務傳播機制 七大事務傳播機制 支持當前調用鏈上的事務 Propagation.REQUIRED Propagation.SUPPORTS Propagation.MANDATORY 不支持當前調用鏈上的事務 Propagation.REQUIRES_NEW Propagation.NOT_SUPPORTED Propagation.NEVER 嵌套事務 Propagation.NESTED…

蜂窩、無線設備應用 HXG-242+、PVGA-123+、PMA-5452+、PSA-39+、PSA-14+射頻放大器(IC器件)

1、HXG-242 射頻放大器 IC 無線 LAN&#xff0c;LTE 700MHz 至 2.4GHz&#xff0c;6-SMD 模塊 HXG-242&#xff08;符合RoHS規范&#xff09;是一款先進的放大器模塊&#xff0c;結合了高動態范圍MMIC技術和優化電路&#xff0c;可在聚焦頻率范圍內提供業界領先的線性度。它采…

創建并測試第一個django項目并解決過程中遇到的問題

Django 是一個高級 Python Web 框架&#xff0c;它鼓勵快速開發和簡潔、實用的設計。它由經驗豐富的開發人員構建&#xff0c;解決了 Web 開發的大部分麻煩&#xff0c;因此您可以專注于編寫應用程序&#xff0c;而無需重新發明輪子。它是免費和開源的。 目錄 一、django項目 …

Nginx 簡單入門操作

前言:之前的文章有些過就不羅嗦了。 Nginx 基礎內容 是什么? Nginx 是一個輕量級的 HTTP 服務器,采用事件驅動、異步非阻塞處理方式的服務器,它具有極好的 IO 性能,常用于 HTTP服務器(包含動靜分離)、正向代理、反向代理、負載均衡 等等. Nginx 和 Node.js 在很多方…

pdb 調試 python 代碼

pdb python的官方調試工具; 默認下載的模塊 參考文檔 pdbpdb有官方文檔, 也有源碼, 可能閱讀python源碼更容易理解; 和gdb非常相似&#xff0c;也支持擴展; 基于bdb,cmd拓展; 代碼中設置調試點(一次性調試) 好處是可以源碼級別的調試, 對于剛了解pdb又想調試子進程的比較…

大語言模型有什么意義?亞馬遜訓練自己的大語言模型有什么用?

近年來&#xff0c;大語言模型的嶄露頭角引起了廣泛的關注&#xff0c;成為科技領域的一項重要突破。而在這個領域的巔峰之上&#xff0c;亞馬遜云科技一直致力于推動人工智能的發展。那么&#xff0c;作為一家全球科技巨頭&#xff0c;亞馬遜為何會如此注重大語言模型的研發與…

解讀 | GPT-4突然“變賴“ 是莫名其妙還是另有玄機

大家好&#xff0c;我是極智視界&#xff0c;歡迎關注我的公眾號&#xff0c;獲取我的更多前沿科技分享 邀您加入我的知識星球「極智視界」&#xff0c;星球內有超多好玩的項目實戰源碼和資源下載&#xff0c;鏈接&#xff1a;https://t.zsxq.com/0aiNxERDq 事情是這樣的&#…

初學websocket有感-待研究

https://www.bilibili.com/video/BV1KN411n7WD/ 看到一半的時候就會想到以下的問題&#xff1a; 初學websocket有感-待研究 既然每一個endPoint都是對應著一個服務器和客戶端瀏覽器的連接對象&#xff0c;那么就是說要創建很多個endPoint對象咯。 一、是否回將創建的這么多…

項目經理和產品經理哪個更有發展前景?

如果是單看“錢途”的話&#xff0c;如果是在傳統行業&#xff0c;可能差不多&#xff1b;如果是在IT行業的話&#xff0c;可能更需要項目經理&#xff1b;互聯網行業的話&#xff0c;可能更需要產品經理。 項目經理跟產品經理兩個證都挺受市場歡迎的&#xff0c;兩個崗位職責…

關東升老師Python著作推薦(由電子工業出版社出版)

前言&#xff1a;關東升老師簡單介紹 一個在IT領域摸爬滾打20多年的老程序員、軟件架構師、高級培訓講師、IT作家。熟悉Java、Kotlin、Python、iOS、Android、游戲開發、數據庫開發與設計、軟件架構設計等多種IT技術。參與設計和開發北京市公交一卡通百億級大型項目&#xff0c…

釣魚網站域名識別工具dnstwist算法研究

先上一個AI的回答&#xff1a; dnstwist是一種釣魚網站域名識別工具&#xff0c;可幫助用戶識別和檢測可能被惡意使用的域名。它通過生成類似的域名變體來模擬攻擊者可能使用的釣魚域名&#xff0c;并提供了一系列有用的功能和信息。 dnstwist能夠生成一組類似的域名變體&…