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

Error in emotion detection example in Readme #222

Open
vpodpecan opened this issue Sep 14, 2022 · 0 comments
Open

Error in emotion detection example in Readme #222

vpodpecan opened this issue Sep 14, 2022 · 0 comments

Comments

@vpodpecan
Copy link

vpodpecan commented Sep 14, 2022

The mid-level example in Readme.md contains an error. The reported scores are both 1.0 which is wrong. Those 1.0 scores are set by the HaarCascadeFrontalFace pipeline and should be set to the real MiniXceptionFER scores just like the class_name is set.

The relevant lines in the example which are now like this:

for cropped_image, box2D in zip(cropped_images, boxes2D):
    box2D.class_name = self.classify(cropped_image)['class_name']

should be updated to something like this:

for cropped_image, box2D in zip(cropped_images, boxes2D):
    prediction = self.classify(cropped_image)
    box2D.class_name = prediction['class_name']
    box2D.score = prediction['scores'].ravel()[self.classify.class_names.index(prediction['class_name'])]

Then, the scores are reported as 0.80, happy and 0.38, fear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant