Below you can observe detailed desctiption of how to run script of emotions recognition by using OpenPose. Project was done as a part of Human-Robot Interaction course in Nazarbayev University.
First of all you need to install OpenPose itself. In order to do that, go to the official release page and download it OpenPose.
- Download adove folder and place it inside the folder, where OpenPose installed.
- To detect and extract keypoints from videos you can use
parse_videos.py
script. Move your videos to thevideos
folder and run this script. Data will be saved in theoutput
folder injson
. - In order to save all data into one
csv
file run theto_format.py
script. - In order to run the OpenPose on a webcam you can use the
webcam.py
script. Extracted files will be saved in theoutput
folder inHH_MM_SS
named new folder.
In my case I used three emotion: happy, neutral and surprise. On the official website of OpenPose you can obserb location of keypoints. By importing your csv
file to Python, Excel or online csv reader, you can observe x
and y
values. Thus, by comparing them you will achieve desired results.
It should be noted, that in case if emotion not in the list it should throw garbage.
Also, you can modify pos[] for your emotion.