biubug6 / Pytorch_Retinaface

Retinaface get 80.99% in widerface hard val using mobilenet0.25.
MIT License
2.62k stars 771 forks source link

Training model without landmarks #68

Open vovaxnz opened 4 years ago

vovaxnz commented 4 years ago

Hi, Thanks a lot for your great work! I ran into a problem when I fine-tune the model on my own dataset with faces marked without landmarks. Can you help me please and show what I'm doing wrong?

I organized annotations in the label.txt file as follows:

# vlcsnap-2019-12-21-16h31m20s653.jpg
729 81 115 104 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 1.0
1117 549 96 101 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 1.0
273 3 71 56 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 1.0
# vlcsnap-2019-12-21-16h31m22s880.jpg
1342 347 79 64 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 1.0
625 289 128 99 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 1.0
...

in data/config.py i changed batch_size from 24 to 6 and launched training using resnet50 during training the loss decreased, but when I made predictions on previously unseen data using python test_widerface.py predicted boxes were worse than with no-finetuned model this is how it looks before fine-tuning: Screenshot from 2020-01-13 12-31-32 and this is how they looked after fine-tuning: Screenshot from 2020-01-13 12-30-29 Could you please say what this may be connected with?

alicera commented 4 years ago

@moto55
hi, do you know widerface annotations format? I only know the face box and face landmark. I don't know the 0 and 0.82 Example: 0--Parade/0_Parade_marchingband_1_849.jpg 449 330 122 149 488.906 373.643 0.0 542.089 376.442 0.0 515.031 412.83 0.0 485.174 425.893 0.0 538.357 431.491 0.0 0.82

DuckJ commented 4 years ago

@moto55 have you solved your problem? how to train dataset without landmark

vovaxnz commented 4 years ago

@DuckJ I could not find a way to train without landmarks. Just used detector as is, it already works well

DuckJ commented 4 years ago

if the training label is organized in the above form,loss will not calculate landmark loss, right? You mean that the effect will become worse after finetune, right?

FlyEgle commented 4 years ago

i think the predict bbox is reverse the width and height

watertianyi commented 3 years ago

@vovaxnz Hello, can I ask you how to use your own data set to generate a data set in a format like widerFace. It is very urgent. It seems that no one maintains this code?

alicera commented 3 years ago

I think we have to know the widerface annotations format Do you know how to read it ? I don't know the 0 and 0.82 Example: 0--Parade/0_Parade_marchingband_1_849.jpg 449 330 122 149 488.906 373.643 0.0 542.089 376.442 0.0 515.031 412.83 0.0 485.174 425.893 0.0 538.357 431.491 0.0 0.82

watertianyi commented 3 years ago

@alicera 0 is equivalent to comma separated key points, 0.82 is estimated to be less than necessary

alicera commented 3 years ago

What is your label tool?

watertianyi commented 3 years ago

@alicera labelme