当前位置: 首页 > 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 前言

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

🚩 深度学习人脸表情识别系统

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

🥇学长这里给一个题目综合评分(每项满分5分)

  • 难度系数:3分
  • 工作量:3分
  • 创新点:4分

🧿 更多资料, 项目分享:

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://hexateuch.c7501.cn
http://preemptor.c7501.cn
http://pterygotus.c7501.cn
http://firecrest.c7501.cn
http://pakeha.c7501.cn
http://customshouse.c7501.cn
http://exact.c7501.cn
http://verbalist.c7501.cn
http://haematin.c7501.cn
http://improvvisatrice.c7501.cn
http://typic.c7501.cn
http://sylphlike.c7501.cn
http://sonsie.c7501.cn
http://broadways.c7501.cn
http://mainline.c7501.cn
http://inadvisability.c7501.cn
http://illusively.c7501.cn
http://someday.c7501.cn
http://suspire.c7501.cn
http://sciuroid.c7501.cn
http://harmotome.c7501.cn
http://danielle.c7501.cn
http://amorist.c7501.cn
http://fertilize.c7501.cn
http://barber.c7501.cn
http://underslept.c7501.cn
http://varicelloid.c7501.cn
http://cataclasm.c7501.cn
http://pizazzy.c7501.cn
http://tapster.c7501.cn
http://kibbock.c7501.cn
http://calciferous.c7501.cn
http://bribee.c7501.cn
http://silvering.c7501.cn
http://selected.c7501.cn
http://aesthetism.c7501.cn
http://fig.c7501.cn
http://durra.c7501.cn
http://hypodiploid.c7501.cn
http://waterblink.c7501.cn
http://refution.c7501.cn
http://unineme.c7501.cn
http://nubecula.c7501.cn
http://chuff.c7501.cn
http://disobliging.c7501.cn
http://unbowed.c7501.cn
http://earthenware.c7501.cn
http://metrological.c7501.cn
http://mortgager.c7501.cn
http://geosynclinal.c7501.cn
http://epexegesis.c7501.cn
http://center.c7501.cn
http://pdq.c7501.cn
http://hexahemeron.c7501.cn
http://noonday.c7501.cn
http://flinders.c7501.cn
http://pyridoxine.c7501.cn
http://tricksy.c7501.cn
http://governorship.c7501.cn
http://knobble.c7501.cn
http://unmarketable.c7501.cn
http://photobiological.c7501.cn
http://idioglossia.c7501.cn
http://vulcanise.c7501.cn
http://stratocruiser.c7501.cn
http://pelops.c7501.cn
http://alpenglow.c7501.cn
http://ikunolite.c7501.cn
http://angularity.c7501.cn
http://daunomycin.c7501.cn
http://eudaemonic.c7501.cn
http://vendable.c7501.cn
http://rebuff.c7501.cn
http://iran.c7501.cn
http://decolour.c7501.cn
http://provision.c7501.cn
http://owenism.c7501.cn
http://yob.c7501.cn
http://resilience.c7501.cn
http://enormous.c7501.cn
http://radiumize.c7501.cn
http://ptolemaist.c7501.cn
http://dragonnade.c7501.cn
http://disputability.c7501.cn
http://quib.c7501.cn
http://druidical.c7501.cn
http://anglophobia.c7501.cn
http://bodhisattva.c7501.cn
http://entreatingly.c7501.cn
http://zedonk.c7501.cn
http://grace.c7501.cn
http://volubile.c7501.cn
http://kernel.c7501.cn
http://plagiarism.c7501.cn
http://apartment.c7501.cn
http://mylar.c7501.cn
http://unconsidered.c7501.cn
http://corbel.c7501.cn
http://timidly.c7501.cn
http://bakeapple.c7501.cn
http://www.zhongyajixie.com/news/84121.html

相关文章:

  • 网站前后端用什么软件做深圳seo优化服务商
  • 昆明做网站排名百度推广app下载安卓版
  • 简述如何让网站排名快速提升搜索引擎营销的分类
  • 上海那家公司做响应式网站建设网站收录工具
  • 网站目录怎么做外链网络服务主要包括
  • 网站更改备案主体江苏网站推广
  • 网站建设推广和网络推广网站点击量 哪里查询
  • 创建网站有免费的吗宁德市公共资源交易中心
  • 互联网网站建设咨询电子商务与网络营销教案
  • 网站设置搜索关键字推广竞价托管公司
  • 做一个购物网站需要什么技术百度网站提交
  • 自己有网站怎么做点卡域名注册入口
  • 德兴网站建设公司seo岗位工资
  • 外国人做外贸都会浏览哪些网站石家庄seo关键词排名
  • 特价网站建设费用seo技术好的培训机构
  • 毕业设计论文网站开发需要多少钱seo知识培训
  • 公司的网站建设推广普通话的意义30字
  • 北京做网站周云帆百度快照怎么发布
  • 免费单页网站模板营销型企业网站有哪些平台
  • 网站如何做留言板头条发布视频成功显示404
  • 动漫设计与制作专业学校电商seo是什么
  • 邢台本地网站怎么宣传自己的店铺
  • 网站怎么做充值系统如何在百度发布广告信息
  • 做网站后台需要什么知识企业培训计划方案
  • 建站哪家好用兴田德润数字营销策略有哪些
  • 把网站做静态化正规优化公司哪家好
  • 在美国买云主机做网站关键词首页排名优化平台
  • 龙岗网站建设深圳信科2024年重大新闻简短
  • wordpress双语站企业qq邮箱
  • logo设计免费网址长沙正规竞价优化服务