oarriaga/paz

Error in emotion detection example in Readme

vpodpecan opened this issue · 0 comments

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.