Uploaded by nishattasnim5709

Emotion Recognizer Installation Guide Template

advertisement
Emotion Recognition Installation Guide: Facial expression
recognizer
Sungchul Jung
Realities Lab
SWEGD
Kennesaw State University, GA, USA
August 15, 2023
Contents
1 Introduction
1
2 Required Software
1
3 Project Setup
2
4 Training the ML Model
4.1 Prepare the model for training . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Training Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
3
5
5 Emotion Recognizer using camera
5.1 Setup the trained model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Results of trained model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
9
1
Introduction
In this document, we describe how to setup and execute the existing machine learning project which recognizes the various emotions of a person captured through camera.
We describe the system step-by-step, so it would be best to follow through all sections from first to last, but
you can refer to any section later. We’ve tried to give as much detail as possible, but also assume that the
reader will have a basic knowledge of python and machine learning
2
Required Software
1. Install python latest version. We have used 3.8 version
Please find the link to download - https://www.python.org/downloads/
2. Install Cuda
Please find the link to download- https://developer.nvidia.com/cuda-downloads
1
3. Install Anaconda. We have used anaconda 3
Please find the link to download - https://docs.anaconda.com/anaconda/install/windows/
4. Install visual studio 2019
Please find the link to visual studio - https://visualstudio.microsoft.com/downloads/
3
Project Setup
Git access should be provided to the end user. Login to git and copy the git url as highlighted below
Figure 1: Git url
Go to visual studio, click on File then select clone repository.
Import the AvatarFER project form git. Provide the git url in repository location(git url is user specific).
2
Click on clone
4
4.1
Training the ML Model
Prepare the model for training
Execute the SimpleCNN file.
Figure 2: SimpleCNN
You will observe the error as below
3
Figure 3: No module error
To fix the issue, Go to command prompt and execute the command as follows
Pip install <required library>
For example pip install seaborn . Please find the below screenshot
4
Similarly install all the required libraries from SimpleCNN file until all the errors are resolved.
4.2
Training Results
Finally execute the SimpleCNN file and train the model.
You will see the training results as below
5
5.1
Emotion Recognizer using camera
Setup the trained model
Create a virtual env using the below commands in command prompt
conda create –name dlib env python=3.8
conda activate dlib env
conda install cmake
conda install -c conda-forge dlib=19.1
Open the video validate python file
5
Please mention the path as per the location of Final.h5 file in your system. In the below image location of
final.h5 file is as per our system.
Figure 4: Add path as per location in your system
Comment the code which is not required and make all the necessary changes to match the below code in
video validate file. Refer to the screenshots below
6
Figure 5: code changes
Figure 6: code changes
7
Figure 7: code changes
Click on tools–python–python environments and activate the virtual environment by selecting dlib env and
click on make this the default environment for new projects. Please refer to the highlighted text in yellow in
below image
8
Now run the video validate file and Install all the required libraries as mentioned in training the ML model
(refer section 4.1) until all the errors are resolved
5.2
Results of trained model
Run the video validate file and observe the results as below
Figure 8: Emotion Recognizer Results
9
Download