用于检测面部情绪的Pythorch库

PyEmotion的Python项目详细描述


皮埃莫

PyEmotion-Version 1.0.0一个使用PyTorch进行面部情感识别的Python包。PyEmotion是一个python包,它可以帮助获取人的情绪。在

python versionPyPIDownloadsDownloads

Author:卡瑟夫纳加拉扬

电子邮件karthick965938@gmail.com

安装

我们可以使用以下命令安装PyEmotion

pip install PyEmotion

如何测试?在

在终端中运行python3时,它将产生如下输出:

^{pr2}$

运行以下代码可以获得PyEmotion包的初始化过程输出。在

>>> from PyEmotion import *
>>> PyEmotion()

package_sample_output

要求

pytorch >=1.5.1
torchvision >=0.6.1

可用操作

  1. 网络摄像头 - 结果为视频
from PyEmotion import *
import cv2 as cv

PyEmotion()er= DetectFace(device='cpu', gpu_id=0)# Open you default cameracap= cv.VideoCapture(0)while(True):
  ret, frame= cap.read()
  frame, emotion= er.predict_emotion(frame)
  cv.imshow('frame', frame)if cv.waitKey(1)&0xFF== ord('q'):
    break
cap.release()
cv.destroyAllWindows()
  1. Image - 结果为图像
from PyEmotion import *
import cv2 as cv

PyEmotion()er= DetectFace(device='cpu', gpu_id=0)# Open you default cameracap= cv.VideoCapture(0)
ret, frame= cap.read()
frame, emotion= er.predict_emotion(frame)
cv.imshow('frame', frame)
cv.waitKey(0)

论据

er= DetectFace(device='cpu', gpu_id=0)device='gpu' or cpu'

gpu_id will be effective only when more than two GPUs are detected or it will through error.

贡献

欢迎所有问题和拉请求!要在本地运行代码,请先分叉存储库,然后在计算机上运行以下命令:

git clone https://github.com/<your-username>/PyEmotion.git
cd PyEmotion
# Recommended creating a virtual environment before the next step
pip3 install -r requirements.txt

在添加代码时,一定要在必要时编写单元测试。在

联系人

{a7}是由情感创造的。请随时联系Twitter或通过Email!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Jsonify使用Jackson来定义嵌套对象   在Swing中禁用java图形调试   java Selenium Webdriver拖放在Jenkins上不起作用   java我对一个显示器的问题有一个非常不切实际的询问   java增强的“for”循环导致ArrayIndexOutOfBoundsException   ArrayAdapter适用于Java中的安卓编程,字符串数组   linux在Ubuntu上通过PulseAudio播放Java音频文件时出错   java在Spring应用程序中加载内部(类路径)和外部属性文件   java使用Maven连接到mySQL   Java应用程序的设计   websocket在电报api java中与dc的连接   java XMLStreamException,因为xml中的(&N)   java从控制台输出到JTextArea   Java导出文本文件   java实现parseInt方法   java为什么servlet容器会同步对特定资源/servlet的多个请求的访问?   循环中的Java“while”变量   用Java编程一个国际象棋游戏,gameOver布尔不起作用   java如何获得真正的JPanel大小?