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

网店网站怎么做的睢阳区网

网店网站怎么做的,睢阳区网,3d做ppt模板下载网站,wordpress 前台发布文章PaddleSegSharp 是一个基于百度飞桨PaddleSeg项目的人像分割模块而开发的.NET的工具类库。 PaddleSegSharp 中PaddleSeg.dll文件是基于开源项目最新发布版本PaddleSeg PaddleSeg的版本修改而成的C动态库#xff0c;基于opencv的x64编译而成的。 PaddleSeg是基于飞桨PaddlePa…PaddleSegSharp 是一个基于百度飞桨PaddleSeg项目的人像分割模块而开发的.NET的工具类库。 PaddleSegSharp 中PaddleSeg.dll文件是基于开源项目最新发布版本PaddleSeg PaddleSeg的版本修改而成的C动态库基于opencv的x64编译而成的。 PaddleSeg是基于飞桨PaddlePaddle的端到端图像分割套件内置45模型算法及140预训练模型支持配置化驱动和API调用开发方式打通数据标注、模型开发、训练、压缩、部署的全流程提供语义分割、交互式分割、Matting、全景分割四大分割能力助力算法在医疗、工业、遥感、娱乐等场景落地应用。 本项目只能在X64的CPU上编译和使用只能在avx指令集上的CPU上使用目前仅支持windows平台。 PaddleSegSharp 支持飞桨人像抠图的所有模型。PP-MattingV2-512、PP-Matting-512、PP-Matting-1024、PP-HumanMatting、MODNet-MobileNetV2。 默认使用MODNet-MobileNetV2模型。 1、新建winform项目 2、添加引用PaddleSegSharp 使用NuGet 搜索添加PaddleSegSharp  3、窗体上添加图片显示控件以及按钮 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PaddleSegSharp;namespace WindowsFormzhengjian {public partial class Form1 : Form{#region 字段private string[] bmpFilters new string[] { .bmp, .jpg, .jpeg, .tiff, .tif, .png };private string fileFilter *.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png;private PaddleSegMattingEngine engine;MattingParameter parameter;string modelPath null;string path Environment.CurrentDirectory \out\;/// summary/// 创建画布的画板背景/// /summaryBitmap backgroundImage null;#endregionpublic Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){//初始化 引擎engine new PaddleSegMattingEngine();//参数parameter new MattingParameter();//parameter.outbgfile true;//输出mask图//parameter.bgtransparent true;//背景透明engine.Init(modelPath, parameter);if (!Directory.Exists(path)){Directory.CreateDirectory(path);}}/// summary/// 选择图片/// /summary/// param namesender/param/// param namee/paramprivate void btnSelectPic_Click(object sender, EventArgs e){OpenFileDialog ofd new OpenFileDialog();ofd.Filter fileFilter;if (ofd.ShowDialog() DialogResult.OK){//pictureBox1.Image new Bitmap(ofd.FileName);using (FileStream ms File.OpenRead(ofd.FileName)){//解决内存异常问题以及this.pbx.BackgroundImage System.Drawing.Image.FromStream(ms)导致的一般性gdi 问题using (Bitmap bt new Bitmap(ms)){#region MyRegion//backgroundImage new Bitmap(bt.Width, bt.Height);Graphics g pbx.CreateGraphics();//Graphics g Graphics.FromImage(backgroundImage);g.DrawLine(Pens.Black, startPoint, e.Location);g.Clear(Color.White);Pen myPen new Pen(Color.Black, int.TryParse(ConfigurationManager.AppSettings[penwidth], out int penwidth) ? penwidth : 3);//g.SmoothingMode SmoothingMode.AntiAlias;//g.CompositingQuality CompositingQuality.HighQuality;//g.CompositingMode CompositingMode.SourceOver;//g.DrawImage(bt, bt.Width, bt.Height);PointF pointFstart PointToPointF(startPoint);PointF pointFend PointToPointF(e.Location);g.DrawBeziers(myPen, new PointF[] { pointFstart, pointFend });//pbx.BackgroundImage backgroundImage;//g.Dispose();bt.Save(Fingerprint.jpg);this.pbx.BackgroundImage System.Drawing.Image.FromStream(ms); #endregionbackgroundImage new Bitmap(bt.Width, bt.Height, bt.PixelFormat);Graphics g Graphics.FromImage(backgroundImage);g.SmoothingMode SmoothingMode.AntiAlias;g.CompositingQuality CompositingQuality.HighQuality;g.CompositingMode CompositingMode.SourceOver;g.DrawImage(bt, 0, 0);backgroundImage.Save(Fingerprint11.jpg);//pictureBox1.Image Image.FromHbitmap(backgroundImage.GetHbitmap());pictureBox1.Image backgroundImage;g.Dispose();pictureBox1.Refresh();}}#region ok参数//MattingParameter parameter new MattingParameter();初始化引擎//PaddleSegMattingEngine engine new PaddleSegMattingEngine();//engine.Init(modelPath, parameter);设置背景颜色//engine.Setbackground(45, 145, 255);分割后的文件//string outfile Guid.NewGuid().ToString() .png;//string outbgfile Path.GetFileNameWithoutExtension(outfile) _bg.png;//engine.Seg(ofd.FileName, outfile, outbgfile); #endregion}this.Refresh();}/// summary/// 替换背景色/// /summary/// param namesender/param/// param namee/paramprivate void btnReplaceBackground_Click(object sender, EventArgs e){if (pictureBox1.Image ! null){参数ok//MattingParameter parameter new MattingParameter();初始化引擎//PaddleSegMattingEngine engine new PaddleSegMattingEngine();//engine.Init(modelPath, parameter);设置背景颜色//Color bgcolor Color.White;//ColorDialog colorDialog new ColorDialog();//colorDialog.Color bgcolor;//if (colorDialog.ShowDialog() ! DialogResult.OK) return;//bgcolor colorDialog.Color;//engine.Setbackground(bgcolor.R, bgcolor.G, bgcolor.B);engine.Setbackground(45, 145, 255);分割后的文件//string outfile Guid.NewGuid().ToString() .png;//string outbgfile Path.GetFileNameWithoutExtension(outfile) _bg.png;engine.Seg(小一寸.png, outfile, outbgfile);engine.Seg(new Bitmap(小一寸.png), outfile, outbgfile);//engine.Seg(pictureBox1.Image, outfile, outbgfile);engine new PaddleSegMattingEngine();engine.Init(modelPath, parameter);Color bgcolor Color.White;ColorDialog colorDialog new ColorDialog();colorDialog.Color bgcolor;if (colorDialog.ShowDialog() ! DialogResult.OK) return;bgcolor colorDialog.Color;engine.Setbackground(bgcolor.R, bgcolor.G, bgcolor.B);//engine.SetbackgroundFile();string outfile path Guid.NewGuid().ToString() .png;string outbgfile path Path.GetFileNameWithoutExtension(outfile) _bg.png;engine.Seg(pictureBox1.Image, outfile, outbgfile);//engine.Setbackground(45, 145, 255);分割后的文件//string outfile C:\\ Guid.NewGuid().ToString() .bmp;//engine.Seg(C:\\Users\\Administrator\\Desktop\\1.jpg, outfile, mask图路径);pictureBox2.Image new Bitmap(outfile);}}/// summary/// 替换背景图/// /summary/// param namesender/param/// param namee/paramprivate void btnSetBackground_Click(object sender, EventArgs e){if (pictureBox1.Image ! null){engine new PaddleSegMattingEngine();engine.Init(modelPath, parameter);OpenFileDialog ofd new OpenFileDialog();ofd.Filter fileFilter;if (ofd.ShowDialog() ! DialogResult.OK)return;engine.SetbackgroundFile(ofd.FileName);string outfile path Guid.NewGuid().ToString() .png;string outbgfile path Path.GetFileNameWithoutExtension(outfile) _bg.png;//string outfile path 1.png;//string outbgfile path 1_bg.png;engine.Seg(pictureBox1.Image, outfile, outbgfile);pictureBox2.Image new Bitmap(outfile);}}private void btnSave_Click(object sender, EventArgs e){if (pictureBox2.Image ! null){SaveFileDialog fileDialog new SaveFileDialog();fileDialog.Filter Image files (JPeg, Gif, Bmp, etc.)|*.jpg;*.jpeg;*.gif;*.bmp;*.tif; *.tiff; *.png| JPeg files (*.jpg;*.jpeg)|*.jpg;*.jpeg |GIF files (*.gif)|*.gif |BMP files (*.b mp)|*.bmp|Tiff files (*.tif;*.tiff)|*.tif;*.tiff|Png files (*.png)| *.png |All f iles (*.*)|*.*;if ((fileDialog.ShowDialog() System.Windows.Forms.DialogResult.OK)){string path fileDialog.FileName.ToString();pictureBox2.Image.Save(path);}}}private void btnOCR_Click(object sender, EventArgs e){//OpenFileDialog ofd new OpenFileDialog();//ofd.Filter *.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png;//if (ofd.ShowDialog() ! DialogResult.OK)// return;//var imagebyte File.ReadAllBytes(ofd.FileName);//Bitmap bitmap new Bitmap(new MemoryStream(imagebyte));//OCRModelConfig config null;//OCRParameter oCRParameter new OCRParameter();//OCRResult ocrResult new OCRResult();//using (PaddleOCREngineengine new PaddleOCREngine(config, oCRParameter))//{// ocrResult engine.DetectText(bitmap);//}//if (ocrResult ! null)//{// MessageBox.Show(ocrResult.Text, 识别结果);//}}} }
http://www.lakalapos1.cn/news/25590/

相关文章:

  • 济南建站都选企汇优先做后付个人网站栏目设计
  • 越秀区网站建设公司html简单网页代码如何运行
  • 从化建设局网站关停WordPress用户图片
  • 大型flash网站乌海网站seo
  • 免费网站成本辽宁平台网站建设平台
  • 网站被k的表现qq网页版登录
  • 做一个网站一般费用拓者设计吧 现代风格
  • 北京 网站建设婚纱网站建设目的
  • 西安在线网站广州一起做网店官网
  • 服务好的高端网站建设报价西宁企业网站开发定制
  • 太原网站开发定制极简风格的网站
  • 高校网站建设评比标准崇左做网站公司
  • 网站公众平台建设方案wordpress百度网站地图
  • 网站建设 技术电子商务网页设计代码
  • 我公司是做网站开发的怎么纳税怎么自己做网址手机版
  • 黑龙江建设人力资源网站提供网站建设公司报价
  • 音乐网站建设程序学网络运营什么学校好
  • 运动鞋官方网站建设计划书seo诊断的网络问题
  • 网站是怎么搭建的公司注册代理费
  • 网站开发与维护难吗专业设计美容院装修公司
  • 网站建设公司itcask保定建设工程信息网
  • 网站上的视频直播是怎么做的呢网站排名查询平台
  • 深圳网站制作建设哪家专业destoon 网站后台
  • 可以做羞羞的游戏视频网站东莞营销网站建设多少钱
  • 网站优化自己做该怎么做佛山网站建设全方位服务
  • 百度关键词网站怎么做手机可以做网站的服务器吗
  • 广州网站建设V芯ee8888e学校网站建设的要点
  • 网站建立公司上海网页设计公司哪家最好
  • 网站开发部门工资会计分录怀柔网站整站优化公司
  • 绵阳阡陌网站建设可以做动画的网站都有哪些软件下载