-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
HRNet keypoints head (Facial landmarks) #3391
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3391 +/- ##
==========================================
- Coverage 57.97% 57.30% -0.68%
==========================================
Files 202 209 +7
Lines 13491 14005 +514
Branches 2282 2375 +93
==========================================
+ Hits 7822 8025 +203
- Misses 5310 5601 +291
- Partials 359 379 +20
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hello, any news ? A merge would be helpfull to use a keypoint regression in combination with the latest models from the zoo :) |
Well it is more than one year old now, I am not sure how much work is needed to make it compatible with latest mmdet. |
Thanks for your contribution. Is it possible to use this keypoints header for the swin transformer which based on mmdection? |
I guess you can do some refactoring and get a keypoints head compatible with the swin transformer |
Thanks for your advice! |
This PR is a re implementation of HR Net keypoints detection (Facial landmarks): https://github.com/HRNet/HRNet-Facial-Landmark-Detection
Some ideas from Mask RCNN tentative: https://github.com/powerlic/mmdetection/commit/e7773ca738c2ff35cf7d38af117464d445a6edbc?diff=unified
The MSE loss is calculated on the heatmaps
Outputs should be a N*3 vector for N keypoints, with 2 coordinates and the confidence level for each keypoint
Current status
Trained and tested on WFLW dataset: https://wywu.github.io/projects/LAB/WFLW.html
Note that a small sigma (on the heatmap) will make it more difficult to adapt
COCO dataset has a visibility flag for each keypoint, we added this possibility and the input data should be a N*3 array similar to MSCOCO input
TODO
Ideas
CenterOnFace
pipeline. What we can do is convert the dataset and load a small image already centered on the face, with the proper annotation.Notes
config
folder, accuracy is similar, removing the neck makes it run faster) The original ones is available here: https://github.com/HRNet/HRNet-Object-Detection/blob/master/mmdet/models/backbones/hrnet.py#L442bbox
,mask
,keypoints
,heatmaps
), or the original format: a numpy array (bboxes only) or a tuple (np.array, list of dicts) for masksmmdet/apis/test.py
had to be modified accordingly to handle and display keypoints (TODO: Check whether mmcv can handle keypoints directly)model/roi_head/keypoint_head/num_keypoints
) and theWflwDataset
code underload_annotations
keep_ratio=False
if the batch size is > 1, or it might create errors due to the concatenation of heatmaps of different sizes (depends on your original image size)Btw, I noticed you guys recently started a new
mmpose
project, but we started working on that some time ago. Feel free to move it tommpose
if you think it should go there.