-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add script to evaluate face recognition by LFW #72
Conversation
LGTM. |
tools/eval/datasets/lfw.py
Outdated
ids = self.ids | ||
embeddings = np.zeros(shape=(len(self), 128)) | ||
for idx, img in tqdm(enumerate(self), desc="Evaluating {} with {} val set".format(model.name, self.name)): | ||
embedding = model.infer(img) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image should be aligned before being fed into the model. This can be the problem of low accuracy.
To get aligned image, you need to get the bounding box of the face using YuNet. For simplicity, you can start with treating the bounding box of highest score as the only face in the image. So I suggest you:
- Validate whether alignment using YuNet improves the accuracy.
- If it does, store those boxes in a constant in this file (or a separate .npy file) and load it when requires to save time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! After using YuNet to get bbox, the accuracy is 97.92%. this is still not 99.6% as described in the documentation. I will try to solve this problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference can be YuNet failing to detect a face in some images. You can have a check on the images with low score faces or no face.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may not be the problem. Each image is detected with a face and the selected bbox scores are all above 0.8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes it may fail even with score 0.8. Please, take a look at those faces with score lower than 0.9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lfw_face_features.npy
should be renamed to lfw_face_bboxes.npy
to address confusions. Should also explain what this file is for and the data structure (e.g. [[x1, y1, x2, y2, lm1_x, lm1_y, ... ]]
) in the section of LFW in readme.
Others look good to me 👍 Thank you so much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
The script is modified based on evaluation of InsightFace.