资源简介

有python环境,直接解压可以运行看效果,缺什么库补什么库。可以用来学习,了解一下过程

资源截图

代码片段和文件信息

import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
style.use(‘fivethirtyeight‘)

fig = plt.figure()
ax1 = fig.add_subplot(111)

def animate(i):
    graph_data = open(‘emotion.txt‘ ‘r‘).read()
    lines = graph_data.split(‘\n‘)
    xs = []
    y_angry = []
    y_fear = []
    y_happy = []
    y_sad = []
    y_surprise = []
    y_neutral = []
    for line in lines:
        if len(line) > 1:
            time angry fear happy sad surprise neutral = line.split(‘‘)
            xs.append(time)
            y_angry.append(angry)
            y_fear.append(fear)
            y_happy.append(happy)
            y_sad.append(sad)
            y_surprise.append(surprise)
            y_neutral.append(neutral)

    ax1.clear()
    ax1.plot(xs y_angry)
    ax1.plot(xs y_fear)
    ax1.plot(xs y_happy)
    ax1.plot(xs y_sad)
    ax1.plot(xs y_surprise)
    ax1.plot(xs y_neutral)

ani = animation.FuncAnimation(fig animate interval=1000)
plt.show()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        311  2018-06-11 19:31  real-time_emotion_analyzer\.idea\misc.xml

     文件        318  2018-06-11 19:30  real-time_emotion_analyzer\.idea\modules.xml

     文件        459  2018-06-11 19:31  real-time_emotion_analyzer\.idea\real-time_emotion_analyzer-master.iml

     文件        180  2018-06-11 19:31  real-time_emotion_analyzer\.idea\vcs.xml

     文件      17586  2018-06-12 14:37  real-time_emotion_analyzer\.idea\workspace.xml

     文件     650045  2018-06-12 14:13  real-time_emotion_analyzer\emotion.txt

    .......    930127  2016-09-03 21:19  real-time_emotion_analyzer\haarcascade_frontalface_default.xml

    .......      1007  2016-09-03 21:19  real-time_emotion_analyzer\live-plotting.py

    .......      5596  2016-09-03 21:19  real-time_emotion_analyzer\memecam.py

    .......    122784  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\angry-angry.png

    .......    141866  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\angry-fear.png

    .......     40667  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\angry-happy.png

    .......     59455  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\angry-neutral.png

    .......    320188  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\angry-sad.png

    .......    239074  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\angry-surprise.png

    .......    804848  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\dimensions-of-rage.png

    .......     17912  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\face_chart.xlsx

    .......    141866  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\fear-angry.png

    .......   1706561  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\fear-fear.png

    .......    260030  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\fear-happy.png

    .......    120054  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\fear-neutral.png

    .......     50985  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\fear-sad.png

    .......    551528  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\fear-surprise.png

    .......     40667  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\happy-angry.png

    .......    260030  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\happy-fear.png

    .......    394937  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\happy-happy.png

    .......     62257  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\happy-neutral.png

    .......    105332  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\happy-sad.png

    .......     96351  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\happy-surprise.png

    .......     59455  2016-09-03 21:19  real-time_emotion_analyzer\meme_faces\neutral-angry.png

............此处省略31个文件信息

评论

共有 条评论