This is a demo which takes input face or body from webcam and predicts the following emotions:
- Face
Neutral, Happiness, Sadness, Surprise, Frustration, Fear, Disgust
- Body
Positive, Neutral, Negative
Install the required packages below:
pip3 install torch torchvision torchaudio
pip install opencv-python
pip install mediapipe
pip install gdown
Webcam Input:
python demo.py INPUT
where INPUT
= { face
, body
}.
Optionally, apply medical face mask, by running:
python demo.py INPUT mask
The Face Mesh detection step is optional for body input.
The face MobileNetV2 model is trained on the AffectNet dataset, whereas the body MobileNetV2 model is trained on the BoLD dataset.