Amazing-Python-Scripts

Форк
0

readme.md

Facial Expression Recognition


Facial expression recognition is a technology which detects emotions in human faces. More precisely, this technology is a sentiment analysis tool and is able to automatically detect the basic or universal expressions: happiness, sadness, anger, surprise, fear, and disgust etc.

Dependencies

pip install tensorflow pip install opencv-python

Implementation of OpenCV HAAR CASCADES

Here "Frontal Face Alt" Classifier is used for detecting the presence of Face in the WebCam. then, load this file which can be found in the label.py

classifier = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml')

ReTraining the Network - Tensorflow Image Classifier

Create an Image classifier that identifies whether a person is sad, happy and so on and then show this text on the OpenCV Window.

  • Create a directory named images. In this directory, create six sub directories with names like Happy, Sad, Angry, Surprise, Fear and Disgust.
  • Now fill these directories with respective images by downloading them from the Internet or take your own pictures(atleast 100). E.g., In "Happy" directory, fill only those iages of person who are happy.
  • Now run the "face-crop.py" program.
  • Once you have only cleaned images, you are ready to retrain the network.To run the training, hit the go to the parent folder and open Terminal here and hit the following:
python retrain.py --output_graph=retrained_graph.pb --output_labels=retrained_labels.txt --architecture=MobileNet_1.0_224 --image_dir=images

Importing the ReTrained Model and Setting Everything Up

Now run the "label.py" program by typing the following in Terminal:

python label.py

It will open a new window of OpenCV and then identifies your Facial Expression. ##You can express your emotions and get the results.##

[Facial-Expression-Recognition]

Author

Debashish kumar sahoo

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.