supernotman / RetinaFace_Pytorch

Reimplement RetinaFace with Pytorch
305 stars 68 forks source link

Unable to detect rotated faces / landmarks inaccurate #4

Open xsacha opened 5 years ago

xsacha commented 5 years ago

t1 t4

These two test images look better in other implementations of RetinaFace for PyTorch, for eg. https://github.com/bogireddytejareddy/retinaface-pytorch/blob/master/test_results/t1.jpg https://github.com/bogireddytejareddy/retinaface-pytorch/blob/master/test_results/t4.jpg

supernotman commented 5 years ago

t1 t4

These two test images look better in other implementations of RetinaFace for PyTorch, for eg. https://github.com/bogireddytejareddy/retinaface-pytorch/blob/master/test_results/t1.jpg https://github.com/bogireddytejareddy/retinaface-pytorch/blob/master/test_results/t4.jpg

t1 t4

These two test images look better in other implementations of RetinaFace for PyTorch, for eg. https://github.com/bogireddytejareddy/retinaface-pytorch/blob/master/test_results/t1.jpg https://github.com/bogireddytejareddy/retinaface-pytorch/blob/master/test_results/t4.jpg

Thanks for your test.And i noticed the problem as well , i am still trying to figure it out and try to make the performance and recall for rotated faces better. And i think there is some probable cause for this:

  1. I use different loss weight for cls,box and landmarks . In the paper,the author said the loss-balancing parameters are set to 1, 0.25, 0.1,but i see the origin code it seems to be 1,1,0.5(I am not sure).So this might influence the performance.
  2. I find that when i use random flip Augmentation, losses for landmarks seems weird like this: TIM截图20190812103320 Some noises in landmark loss.But i checked the groundtruth and found no wrong label.
  3. There are some components to do like deformable convolution and data augumentation ways i listed in Todo list in readme. These may also make some affect. Still there are some bugs in the code and i am trying to fixed it. And it is welcomed to commit a issue if you have any find. Thanks.
xsacha commented 5 years ago

Landmarks are more accurate after your latest bug fix! Getting high precision (over 90%) quite early now at about epoch 10. Rotated faces are still not detected but I suppose that is due to the data loader.

Comparing to your result in README, which I was unable to achieve before:

---- [Epoch 39/200, Batch 400/403] ----
+----------------+-----------------------+
| loss name      | value                 |
+----------------+-----------------------+
| total_loss     | 0.09969855844974518   |
| classification | 0.09288528561592102   |
| bbox           | 0.0034053439740091562 |
| landmarks      | 0.003407923271879554  |
+----------------+-----------------------+
-------- RetinaFace Pytorch --------
Evaluating epoch 39
Recall: 0.7432201780921814
Precision: 0.906913273261629

I now get quite a bit better results than what you had: Recall of 75% and precision of 94.5%

---- [Epoch 39/200, Batch 1600/1610] ----
+----------------+-----------------------+
| loss name      | value                 |
+----------------+-----------------------+
| total_loss     | 0.08609515428543091   |
| classification | 0.0003947564400732517 |
| bbox           | 0.035630300641059875  |
| landmarks      | 0.05007009953260422   |
+----------------+-----------------------+
-------- RetinaFace Pytorch --------
Evaluating epoch 39
Recall: 0.7492150513297574
Precision: 0.9453832716431287
xsacha commented 5 years ago

Just a note that epoch 39 was actually the best epoch I had out of the lot, so it only got worse from there.

supernotman commented 5 years ago

Just a note that epoch 39 was actually the best epoch I had out of the lot, so it only got worse from there.

yes,I also noticed this.I am stilling trying to fix all these problems.