Skip to main content

It recognize facial emotions from the image

Project description

Project Description

Facial Emotion Recognition using PyTorch.

It creates a bounding box around the face of the person present in the picture and put a text
at the top of the bounding box representing the recognised emotion.

Install

pip install emotion_recognition

Requirements

pytorch >= 1.2.0

torchvision >= 0.3.0

Usage:

from facial_emotion_recognition import EmotionRecognition

import cv2 as cv

er = EmotionRecognition(device='gpu', gpu_id=0)

cam = cv.VideoCapture(0)

success, frame = cam.read()

frame = er.recognise_emotion(frame, return_type='BGR')

cv.imshow("frame", frame)

while True:
    key = cv.waitKey(10)
    if key & 0xff == 27:
        break

Arguments

er = EmotionRecognition(device='gpu', 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.

frame = er.recognise_emotion(frame, return_type='BGR')

return_type='BGR' or 'RGB'

References

  1. "Challenges in Representation Learning: A report on three machine learning contests." I Goodfellow, D Erhan, PL Carrier, A Courville, M Mirza, B Hamner, W Cukierski, Y Tang, DH Lee, Y Zhou, C Ramaiah, F Feng, R Li, X Wang, D Athanasakis, J Shawe-Taylor, M Milakov, J Park, R Ionescu, M Popescu, C Grozea, J Bergstra, J Xie, L Romaszko, B Xu, Z Chuang, and Y. Bengio. arXiv 2013.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facial_emotion_recognition-0.3.4.tar.gz (27.1 MB view details)

Uploaded Source

File details

Details for the file facial_emotion_recognition-0.3.4.tar.gz.

File metadata

  • Download URL: facial_emotion_recognition-0.3.4.tar.gz
  • Upload date:
  • Size: 27.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.1.post20200323 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for facial_emotion_recognition-0.3.4.tar.gz
Algorithm Hash digest
SHA256 972f65e7cf05ba083d18c4665850689ddc9449f2d364b39684ac733bea48ab1a
MD5 fb88d2c44371ecbba8d4e91d850ab06e
BLAKE2b-256 e6432359558c6ebdfa3a3625e72afb46ab17c06d473af0321f56fe81fe40fa23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page