Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Demo - Facial Expression Recognition #233

Merged
merged 4 commits into from
Feb 26, 2024
Merged

C++ Demo - Facial Expression Recognition #233

merged 4 commits into from
Feb 26, 2024

Conversation

DaniAffCH
Copy link
Contributor

This Pull Request introduces a C++ demo for utilizing and visualizing the Facial Expression Recognition (FER) model requested in issue #135 . The changes include:

  • demo.cpp: This file contains the demo implementation, featuring a class YuNet for face detection (adapted from face_detection_yunet/demo.cpp to create a stand-alone demo) and a class FER for preprocessing and inference with the Facial Expression Recognition model.

  • CMakeLists.txt: The related CMakeLists file necessary for building the program.

  • README.md: The README file has been updated to include information about this new demo.

The demo offers two modes of inference: real-time using the camera or processing a static image.

The coding style in demo.cpp aligns with the conventions used in other demos and follows the structure of the corresponding demo.py. Notably, I opted to utilize the estimateAffine2D function from the OpenCV library instead of reimplementing a similar mechanism, as was done in the Python version.

Testing

The program has been tested both with a single person and with multiple people at the same time.
Here are some screenshots:

Single Person from the cam

Screenshot from 2024-02-25 22-56-10

Multi-person from static image

result

Build & Run

cli run

@fengyuentau fengyuentau self-requested a review February 26, 2024 02:58
@fengyuentau fengyuentau self-assigned this Feb 26, 2024
@fengyuentau fengyuentau added the demo anything related to demo in Python / C++ label Feb 26, 2024
@fengyuentau fengyuentau added this to the 4.10.0 milestone Feb 26, 2024
Copy link
Member

@fengyuentau fengyuentau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean 👍 We can proceed to merge after the following minor comments are solved.

models/facial_expression_recognition/demo.cpp Outdated Show resolved Hide resolved
models/facial_expression_recognition/demo.cpp Outdated Show resolved Hide resolved
models/facial_expression_recognition/demo.cpp Outdated Show resolved Hide resolved
@DaniAffCH
Copy link
Contributor Author

Hi @fengyuentau thank you for your review. I just fixed the minor issues you pointed out.

@fengyuentau
Copy link
Member

fengyuentau commented Feb 26, 2024 via email

Copy link
Member

@fengyuentau fengyuentau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thank you for the contribution!

@fengyuentau fengyuentau merged commit 821a8df into opencv:main Feb 26, 2024
@ShiqiYu
Copy link
Member

ShiqiYu commented Feb 26, 2024

@DaniAffCH Thank you for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
demo anything related to demo in Python / C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants