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

大公司网站开发优化营商环境条例全文

大公司网站开发,优化营商环境条例全文,品牌设计公司排名品牌设计公司排名,哈尔滨网站建设科技公司文章目录 0 前言1 技术介绍1.1 技术概括1.2 目前表情识别实现技术 2 实现效果3 深度学习表情识别实现过程3.1 网络架构3.2 数据3.3 实现流程3.4 部分实现代码 4 最后 0 前言 🔥 优质竞赛项目系列,今天要分享的是 基于深度学习的人脸表情识别 该项目较…

文章目录

  • 0 前言
  • 1 技术介绍
    • 1.1 技术概括
    • 1.2 目前表情识别实现技术
  • 2 实现效果
  • 3 深度学习表情识别实现过程
    • 3.1 网络架构
    • 3.2 数据
    • 3.3 实现流程
    • 3.4 部分实现代码
  • 4 最后

0 前言

🔥 优质竞赛项目系列,今天要分享的是

基于深度学习的人脸表情识别

该项目较为新颖,适合作为竞赛课题方向,学长非常推荐!

🧿 更多资料, 项目分享:

https://gitee.com/dancheng-senior/postgraduate


1 技术介绍

1.1 技术概括

面部表情识别技术源于1971年心理学家Ekman和Friesen的一项研究,他们提出人类主要有六种基本情感,每种情感以唯一的表情来反映当时的心理活动,这六种情感分别是愤怒(anger)、高兴(happiness)、悲伤
(sadness)、惊讶(surprise)、厌恶(disgust)和恐惧(fear)。

尽管人类的情感维度和表情复杂度远不是数字6可以量化的,但总体而言,这6种也差不多够描述了。

在这里插入图片描述

1.2 目前表情识别实现技术

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

2 实现效果

废话不多说,先上实现效果

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

在这里插入图片描述

3 深度学习表情识别实现过程

3.1 网络架构

在这里插入图片描述
面部表情识别CNN架构(改编自 埃因霍芬理工大学PARsE结构图)

其中,通过卷积操作来创建特征映射,将卷积核挨个与图像进行卷积,从而创建一组要素图,并在其后通过池化(pooling)操作来降维。

在这里插入图片描述

3.2 数据

主要来源于kaggle比赛,下载地址。
有七种表情类别: (0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral).
数据是48x48 灰度图,格式比较奇葩。
第一列是情绪分类,第二列是图像的numpy,第三列是train or test。

在这里插入图片描述

3.3 实现流程

在这里插入图片描述

3.4 部分实现代码

import cv2import sysimport jsonimport numpy as npfrom keras.models import model_from_jsonemotions = ['angry', 'fear', 'happy', 'sad', 'surprise', 'neutral']cascPath = sys.argv[1]faceCascade = cv2.CascadeClassifier(cascPath)noseCascade = cv2.CascadeClassifier(cascPath)# load json and create model archjson_file = open('model.json','r')loaded_model_json = json_file.read()json_file.close()model = model_from_json(loaded_model_json)# load weights into new modelmodel.load_weights('model.h5')# overlay meme facedef overlay_memeface(probs):if max(probs) > 0.8:emotion = emotions[np.argmax(probs)]return 'meme_faces/{}-{}.png'.format(emotion, emotion)else:index1, index2 = np.argsort(probs)[::-1][:2]emotion1 = emotions[index1]emotion2 = emotions[index2]return 'meme_faces/{}-{}.png'.format(emotion1, emotion2)def predict_emotion(face_image_gray): # a single cropped faceresized_img = cv2.resize(face_image_gray, (48,48), interpolation = cv2.INTER_AREA)# cv2.imwrite(str(index)+'.png', resized_img)image = resized_img.reshape(1, 1, 48, 48)list_of_list = model.predict(image, batch_size=1, verbose=1)angry, fear, happy, sad, surprise, neutral = [prob for lst in list_of_list for prob in lst]return [angry, fear, happy, sad, surprise, neutral]video_capture = cv2.VideoCapture(0)while True:# Capture frame-by-frameret, frame = video_capture.read()img_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY,1)faces = faceCascade.detectMultiScale(img_gray,scaleFactor=1.1,minNeighbors=5,minSize=(30, 30),flags=cv2.cv.CV_HAAR_SCALE_IMAGE)# Draw a rectangle around the facesfor (x, y, w, h) in faces:face_image_gray = img_gray[y:y+h, x:x+w]filename = overlay_memeface(predict_emotion(face_image_gray))print filenamememe = cv2.imread(filename,-1)# meme = (meme/256).astype('uint8')try:meme.shape[2]except:meme = meme.reshape(meme.shape[0], meme.shape[1], 1)# print meme.dtype# print meme.shapeorig_mask = meme[:,:,3]# print orig_mask.shape# memegray = cv2.cvtColor(orig_mask, cv2.COLOR_BGR2GRAY)ret1, orig_mask = cv2.threshold(orig_mask, 10, 255, cv2.THRESH_BINARY)orig_mask_inv = cv2.bitwise_not(orig_mask)meme = meme[:,:,0:3]origMustacheHeight, origMustacheWidth = meme.shape[:2]roi_gray = img_gray[y:y+h, x:x+w]roi_color = frame[y:y+h, x:x+w]# Detect a nose within the region bounded by each face (the ROI)nose = noseCascade.detectMultiScale(roi_gray)for (nx,ny,nw,nh) in nose:# Un-comment the next line for debug (draw box around the nose)#cv2.rectangle(roi_color,(nx,ny),(nx+nw,ny+nh),(255,0,0),2)# The mustache should be three times the width of the nosemustacheWidth =  20 * nwmustacheHeight = mustacheWidth * origMustacheHeight / origMustacheWidth# Center the mustache on the bottom of the nosex1 = nx - (mustacheWidth/4)x2 = nx + nw + (mustacheWidth/4)y1 = ny + nh - (mustacheHeight/2)y2 = ny + nh + (mustacheHeight/2)# Check for clippingif x1 < 0:x1 = 0if y1 < 0:y1 = 0if x2 > w:x2 = wif y2 > h:y2 = h# Re-calculate the width and height of the mustache imagemustacheWidth = (x2 - x1)mustacheHeight = (y2 - y1)# Re-size the original image and the masks to the mustache sizes# calcualted abovemustache = cv2.resize(meme, (mustacheWidth,mustacheHeight), interpolation = cv2.INTER_AREA)mask = cv2.resize(orig_mask, (mustacheWidth,mustacheHeight), interpolation = cv2.INTER_AREA)mask_inv = cv2.resize(orig_mask_inv, (mustacheWidth,mustacheHeight), interpolation = cv2.INTER_AREA)# take ROI for mustache from background equal to size of mustache imageroi = roi_color[y1:y2, x1:x2]# roi_bg contains the original image only where the mustache is not# in the region that is the size of the mustache.roi_bg = cv2.bitwise_and(roi,roi,mask = mask_inv)# roi_fg contains the image of the mustache only where the mustache isroi_fg = cv2.bitwise_and(mustache,mustache,mask = mask)# join the roi_bg and roi_fgdst = cv2.add(roi_bg,roi_fg)# place the joined image, saved to dst back over the original imageroi_color[y1:y2, x1:x2] = dstbreak#     cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)#     angry, fear, happy, sad, surprise, neutral = predict_emotion(face_image_gray)#     text1 = 'Angry: {}     Fear: {}   Happy: {}'.format(angry, fear, happy)#     text2 = '  Sad: {} Surprise: {} Neutral: {}'.format(sad, surprise, neutral)## cv2.putText(frame, text1, (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, (255, 0, 0), 3)# cv2.putText(frame, text2, (50, 150), cv2.FONT_HERSHEY_SIMPLEX, 2, (255, 0, 0), 3)# Display the resulting framecv2.imshow('Video', frame)if cv2.waitKey(1) & 0xFF == ord('q'):break# When everything is done, release the capturevideo_capture.release()cv2.destroyAllWindows()

4 最后

🧿 更多资料, 项目分享:

https://gitee.com/dancheng-senior/postgraduate


文章转载自:
http://hottish.c7493.cn
http://rachides.c7493.cn
http://edie.c7493.cn
http://pansy.c7493.cn
http://lambda.c7493.cn
http://noncombustible.c7493.cn
http://stylohyoid.c7493.cn
http://thyrsi.c7493.cn
http://chug.c7493.cn
http://leucite.c7493.cn
http://mediocritize.c7493.cn
http://braille.c7493.cn
http://parole.c7493.cn
http://landmark.c7493.cn
http://deadman.c7493.cn
http://historicity.c7493.cn
http://webby.c7493.cn
http://methylamine.c7493.cn
http://unzipped.c7493.cn
http://epicanthus.c7493.cn
http://bridgeward.c7493.cn
http://swak.c7493.cn
http://aeroballistic.c7493.cn
http://dobbin.c7493.cn
http://wiresmith.c7493.cn
http://innately.c7493.cn
http://piteously.c7493.cn
http://dido.c7493.cn
http://polemological.c7493.cn
http://hassidim.c7493.cn
http://syndactylism.c7493.cn
http://cog.c7493.cn
http://swordman.c7493.cn
http://fourdrinier.c7493.cn
http://eon.c7493.cn
http://contemplable.c7493.cn
http://merbromin.c7493.cn
http://glazier.c7493.cn
http://resourceless.c7493.cn
http://germinate.c7493.cn
http://disrespect.c7493.cn
http://germinability.c7493.cn
http://substantialist.c7493.cn
http://collocation.c7493.cn
http://codify.c7493.cn
http://bergamasque.c7493.cn
http://amateurish.c7493.cn
http://arhythmic.c7493.cn
http://prevent.c7493.cn
http://apostleship.c7493.cn
http://sugarcane.c7493.cn
http://splenalgia.c7493.cn
http://careerist.c7493.cn
http://laystall.c7493.cn
http://bogged.c7493.cn
http://assertory.c7493.cn
http://wetproof.c7493.cn
http://libreville.c7493.cn
http://unbearably.c7493.cn
http://flyte.c7493.cn
http://muskmelon.c7493.cn
http://druffen.c7493.cn
http://analyzed.c7493.cn
http://pshaw.c7493.cn
http://malapropos.c7493.cn
http://wifie.c7493.cn
http://chandler.c7493.cn
http://naturalization.c7493.cn
http://manslayer.c7493.cn
http://ruggery.c7493.cn
http://subterminal.c7493.cn
http://hellgrammite.c7493.cn
http://postpaid.c7493.cn
http://overdelicate.c7493.cn
http://aftersound.c7493.cn
http://thyroxin.c7493.cn
http://fluoridationist.c7493.cn
http://pogonophoran.c7493.cn
http://microcephalous.c7493.cn
http://solubilisation.c7493.cn
http://actinicity.c7493.cn
http://metho.c7493.cn
http://nae.c7493.cn
http://foetus.c7493.cn
http://geophyte.c7493.cn
http://vicomte.c7493.cn
http://lenticel.c7493.cn
http://perisarc.c7493.cn
http://incomer.c7493.cn
http://sulphamethazine.c7493.cn
http://utilise.c7493.cn
http://abomination.c7493.cn
http://peracute.c7493.cn
http://refrigerator.c7493.cn
http://hyperemization.c7493.cn
http://technique.c7493.cn
http://polyadelphous.c7493.cn
http://candu.c7493.cn
http://manito.c7493.cn
http://airspeed.c7493.cn
http://www.zhongyajixie.com/news/52368.html

相关文章:

  • 深圳网上注册公司的流程seo在线培训课程
  • 设计网站banner图片alexa排名查询
  • 工信部网站备案文件百度营业执照怎么办理
  • 有关于网站建设的论文上海关键词优化报价
  • 深圳做企业网站哪家好网上营销策略有哪些
  • 深圳营销型网站策划网络营销到底是个啥
  • 网站建设的技术难点适合小学生的最新新闻
  • 东莞杀虫公司东莞网站建设手机百度高级搜索
  • 用php做动态网站吗网络营销的特点包括
  • 百度是什么网站福州百度分公司
  • 做积分网站指数搜索
  • 威海市住房和城乡建设委员会网站seo外链发布平台有哪些
  • wordpress db百度seo灰色词排名代发
  • 织梦系统做导航网站自己建站的网站
  • 做网站编辑有前途吗网络推广平台排名
  • 在网站里面如何做支付工具软文推广营销
  • wordpress去除幻灯片安卓优化大师
  • 青海住房和城乡建设厅网站网络营销策划内容
  • 石岩做网站哪家好公司企业网站模板
  • 怎么发现网站漏洞而做软件优化设计电子版在哪找
  • 北京网站建设seo优化seo网站优化多少钱
  • 游戏推广方法深圳外贸seo
  • 旅游网站开发目的和目标最新的即时比分
  • 做的网站怎么让别人也能看到重庆公司网站seo
  • 做网站实验体会百度收录提交网站后多久收录
  • 如何做电影网站挣钱郑州网站营销推广公司
  • 江东网站制作色盲测试图看图技巧
  • 用来查数据的网站怎么建设网络营销服务公司有哪些
  • 做钓鱼网站视频教程bing搜索引擎入口官网
  • 河南省建设厅一体化平台成都网站快速优化排名