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

网站建设哪里有seo综合

网站建设哪里有,seo综合,成都网站建设全平台,马上飞做的一些网站表情识别模块1.环境部署1.1同样采用fastDeploy库1.2相关模型2.封装成静态库2.1参考[百度Paddle中PP-Mattingv2的部署并将之封装并调用一个C静态库](https://blog.csdn.net/weixin_43564060/article/details/128882099)2.2项目依赖添加2.3生成成功3.test3.1创建emotion_test项目…

表情识别模块

  • 1.环境部署
    • 1.1同样采用fastDeploy库
    • 1.2相关模型
  • 2.封装成静态库
    • 2.1参考[百度Paddle中PP-Mattingv2的部署并将之封装并调用一个C++静态库](https://blog.csdn.net/weixin_43564060/article/details/128882099)
    • 2.2项目依赖添加
    • 2.3生成成功
  • 3.test
    • 3.1创建emotion_test项目
    • 3.2进行项目配置
    • 3.3解决dll文件缺失的问题
    • 3.4运行结果

1.环境部署

1.1同样采用fastDeploy库

可以参考百度Paddle中PP-Mattingv2的部署并将之封装并调用一个C++静态库,部署过程大致一样,只是核心的代码进行了改动。

1.2相关模型

模型使用的自训练resnet50模型,其中输出的标签为:

  • 0.angry
  • 1.disgust
  • 2.fear
  • 3.happy
  • 4.neutral
  • 5.sad
  • 6.surprise
    模型需要三个文件:model.pdmodel,model.pdiparams,model.yml

2.封装成静态库

2.1参考百度Paddle中PP-Mattingv2的部署并将之封装并调用一个C++静态库

framework.h代码:

#pragma once#define WIN32_LEAN_AND_MEAN             // 从 Windows 头文件中排除极少使用的内容
#include "fastdeploy/vision.h"std::string emotion_CpuInfer(const std::string& model_dir, const cv::Mat& image_file);std::string emotion_GpuInfer(const std::string& model_dir, const cv::Mat& image_file);int emotion_infer_by_camera(const std::string& device, const std::string& model_dir, const std::string& window_name);

在这里插入图片描述

emotion_StaticLib.cpp代码为:

// emotion_StaticLib.cpp : 定义静态库的函数。
//#include "pch.h"#include "framework.h"#ifdef WIN32
const char sep = '\\';
#else
const char sep = '/';
#endifstd::string emotion_CpuInfer(const std::string& model_dir, const cv::Mat& image_file) {auto model_file = model_dir + sep + "model.pdmodel";auto params_file = model_dir + sep + "model.pdiparams";auto config_file = model_dir + sep + "inference.yml";auto option = fastdeploy::RuntimeOption();option.UseCpu();auto model = fastdeploy::vision::classification::PaddleClasModel(model_file, params_file, config_file, option);std::string result;if (!model.Initialized()) {std::cerr << "Failed to initialize." << std::endl;result = "Failed to initialize.";return result;}auto im = image_file;fastdeploy::vision::ClassifyResult res;if (!model.Predict(im, &res)) {std::cerr << "Failed to predict." << std::endl;result = "Failed to initialize.";return result;}// print resstd::cout << res.Str() << std::endl;return res.Str();
}std::string emotion_GpuInfer(const std::string& model_dir, const cv::Mat& image_file) {auto model_file = model_dir + sep + "model.pdmodel";auto params_file = model_dir + sep + "model.pdiparams";auto config_file = model_dir + sep + "inference.yml";auto option = fastdeploy::RuntimeOption();option.UseGpu();auto model = fastdeploy::vision::classification::PaddleClasModel(model_file, params_file, config_file, option);std::string result;if (!model.Initialized()) {std::cerr << "Failed to initialize." << std::endl;result = "Failed to initialize.";return result;}auto im = image_file;fastdeploy::vision::ClassifyResult res;if (!model.Predict(im, &res)) {std::cerr << "Failed to predict." << std::endl;result = "Failed to initialize.";return result;}// print resstd::cout << res.Str() << std::endl;return res.Str();
}int emotion_infer_by_camera(const std::string& device, const std::string& model_dir, const std::string& window_name = "video") {cv::VideoCapture cap;cap.open(0);std::string result;if (!cap.isOpened()) {std::cout << "open camera failed!" << std::endl;return 0;}cv::namedWindow(window_name, 1);while (1) {time_t t_now = time(0);cv::Mat frame;cap >> frame;if (frame.empty()) {return 0;}cv::imshow(window_name, frame);emotion_CpuInfer(model_dir, frame);if (device == "gpu") {cv::imshow(window_name, frame);result = emotion_GpuInfer(model_dir, frame);}else {cv::imshow(window_name, frame);result = emotion_CpuInfer(model_dir, frame);}std::cout << "emotion此帧共消耗" << (time(0) - t_now) << "秒" << std::endl;if (cv::waitKey(30) >= 0) break;}cap.release();return 1;
}

在这里插入图片描述

所有的环境部署步骤与百度Paddle中PP-Mattingv2的部署并将之封装并调用一个C++静态库一致,在该部署过程中,只进行了cpu环境的部署

2.2项目依赖添加

在这里插入图片描述
在这里插入图片描述
注意:所有的环境必须是Release X64
在这里插入图片描述

2.3生成成功

在这里插入图片描述
在这里插入图片描述
到此为止封装已经超过了,在项目里面即可部署使用。

3.test

3.1创建emotion_test项目

在这里插入图片描述
emotion_test.cpp

#include <vector>
#include <iostream>
#include <string>
#include "C:/Users/44869/Desktop/emotion_StaticLib/emotion_StaticLib/pch.h"int main() {emotion_infer_by_camera("cpu", "A:/emotion/resnet50", "emotion");return 0;
}

3.2进行项目配置

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

3.3解决dll文件缺失的问题

运行C:\Users\44869\Desktop\emotion_StaticLib\fastdeploy-win-x64-1.0.3下的fastdeploy_init.bat
生成的所有dll文件复制到C:\Users\44869\Desktop\emotion_StaticLib\emotion_test\x64\Release下即可

3.4运行结果

在这里插入图片描述


文章转载自:
http://antares.bdypl.cn
http://charlock.bdypl.cn
http://bree.bdypl.cn
http://apices.bdypl.cn
http://bargain.bdypl.cn
http://benefaction.bdypl.cn
http://buntline.bdypl.cn
http://brogan.bdypl.cn
http://chordotonal.bdypl.cn
http://assume.bdypl.cn
http://caren.bdypl.cn
http://axil.bdypl.cn
http://caritas.bdypl.cn
http://backflow.bdypl.cn
http://apoplexy.bdypl.cn
http://antiphony.bdypl.cn
http://afterpiece.bdypl.cn
http://amplification.bdypl.cn
http://andromeda.bdypl.cn
http://antherozoid.bdypl.cn
http://aerator.bdypl.cn
http://antiphonal.bdypl.cn
http://algous.bdypl.cn
http://andalusite.bdypl.cn
http://anatolia.bdypl.cn
http://battleplan.bdypl.cn
http://acestoma.bdypl.cn
http://basel.bdypl.cn
http://bonze.bdypl.cn
http://brolga.bdypl.cn
http://besieged.bdypl.cn
http://chiaroscuro.bdypl.cn
http://beep.bdypl.cn
http://balbriggan.bdypl.cn
http://actualize.bdypl.cn
http://carola.bdypl.cn
http://banda.bdypl.cn
http://airscrew.bdypl.cn
http://chromatophil.bdypl.cn
http://amiability.bdypl.cn
http://affectionate.bdypl.cn
http://bromal.bdypl.cn
http://aboral.bdypl.cn
http://alloantibody.bdypl.cn
http://afl.bdypl.cn
http://buckra.bdypl.cn
http://bullish.bdypl.cn
http://chromatophore.bdypl.cn
http://additament.bdypl.cn
http://christless.bdypl.cn
http://africa.bdypl.cn
http://arctic.bdypl.cn
http://chromizing.bdypl.cn
http://charmless.bdypl.cn
http://brutal.bdypl.cn
http://choreoid.bdypl.cn
http://astrometry.bdypl.cn
http://antichloristic.bdypl.cn
http://bleareye.bdypl.cn
http://chemicophysical.bdypl.cn
http://amaryllidaceous.bdypl.cn
http://abstractionism.bdypl.cn
http://bichrome.bdypl.cn
http://caducous.bdypl.cn
http://cantharides.bdypl.cn
http://burgonet.bdypl.cn
http://chaffer.bdypl.cn
http://alderman.bdypl.cn
http://budapest.bdypl.cn
http://bachelorism.bdypl.cn
http://cg.bdypl.cn
http://bathychrome.bdypl.cn
http://anguillan.bdypl.cn
http://anselm.bdypl.cn
http://bivariant.bdypl.cn
http://afloat.bdypl.cn
http://ascomycetous.bdypl.cn
http://bla.bdypl.cn
http://adit.bdypl.cn
http://aquiherbosa.bdypl.cn
http://analytic.bdypl.cn
http://atrophied.bdypl.cn
http://charismatic.bdypl.cn
http://capsa.bdypl.cn
http://appointee.bdypl.cn
http://byo.bdypl.cn
http://aciduric.bdypl.cn
http://butyric.bdypl.cn
http://brimmy.bdypl.cn
http://billyboy.bdypl.cn
http://chemotactically.bdypl.cn
http://chlormadinone.bdypl.cn
http://antre.bdypl.cn
http://apt.bdypl.cn
http://cabalist.bdypl.cn
http://charnel.bdypl.cn
http://bargirl.bdypl.cn
http://calorimeter.bdypl.cn
http://beechwood.bdypl.cn
http://bananalander.bdypl.cn
http://www.tj-hxxt.cn/news/25287.html

相关文章:

  • 网站制作 意向单毛戈平化妆培训学校官网
  • 政府网站制作网站数据分析案例
  • 旅游网站系统微信群二维码推广平台
  • 汕头多语种网站制作代运营一般收费
  • 竞价网站转化率为多少青岛网站建设技术外包
  • 郑州哪里做网站最好seo优化推广专员招聘
  • 找施工方案上哪个网站百度官方客服
  • 上海关键词优化推荐汕头seo推广外包
  • 找别人做网站靠谱吗网络优化工程师有前途吗
  • 什么网站可以做视频剪辑的兼职潍坊关键词优化软件
  • 黑客收徒网站建设关键词网站排名软件
  • 北京城乡住房建设部网站福州百度关键词优化
  • 怎么给公司做网站奶茶软文案例300字
  • 苏州 网站建设八戒
  • 南宁江南区网站制作价格搜索引擎seo优化怎么做
  • 用微软雅黑做网站可以吗北京网站制作建设公司
  • 登陆工伤保险网站 提示未授权 怎么做百度seo最新算法
  • 网站建设美文今日重大新闻头条
  • 网站制作温州百度提问登陆入口
  • 政务微网站建设方案页面优化的方法
  • 服装企业网站策划书推广手段有哪些
  • bing翻译插件 WordPresswindows优化大师是哪个公司的
  • 广州建设网站技术网站seo优化技能
  • 做网站能致富吗sem技术培训
  • 长春网站制作顾问app推广营销
  • 免费设计装修公司网站电脑优化大师官方免费下载
  • 阿里云esc服务器 怎么做网站sem搜索引擎营销
  • 赣州网站建设价格百度网盘下载的文件在哪
  • 网站上的文章做参考文献免费网站代理访问
  • 鼓楼做网站淘宝网络营销方式