TreB1eN / InsightFace_Pytorch

Pytorch0.4.1 codes for InsightFace
MIT License
1.74k stars 423 forks source link

MTCNN problem #56

Closed kulkarniniraj closed 5 years ago

kulkarniniraj commented 5 years ago

MTCNN code changes in this repo compared to original TropComplique repo have reduced accuracy. I have checked that by replacing detector.py, first_stage.py and get_nets.py, I can improve accuracy significantly. Applies to mtcnn.py too.

Any idea what could be causing this drop in accuracy?

gunjunlee commented 5 years ago

I suffered from same issue too. I finally found out the cause of the problem. It's because of F.softmax() (at line 70, get_nets.py) this repo sets dimension but not TropComplique's. TropComplique's F.softmax implicitly choices dim=1 when this repo's dim is -1. this makes the difference.

kulkarniniraj commented 5 years ago

Thanks this works much better now. Hope this change is merged in this repo.

kalenforn commented 5 years ago

I suffered from same issue too. I finally found out the cause of the problem. It's because of F.softmax() (at line 70, get_nets.py) this repo sets dimension but not TropComplique's. TropComplique's F.softmax implicitly choices dim=1 when this repo's dim is -1. this makes the difference.

I changed this value, but found that the accuracy is still not ideal. although it is better than before, but the MTCNN effect of Tensorflow version I have contacted is much better than this. How can I modify the accuracy of the TF version? Does anyone have a good way to slove this problem? Thanks.

engmubarak48 commented 5 years ago

I suffered from same issue too. I finally found out the cause of the problem. It's because of F.softmax() (at line 70, get_nets.py) this repo sets dimension but not TropComplique's. TropComplique's F.softmax implicitly choices dim=1 when this repo's dim is -1. this makes the difference.

Thank you very much, the problem is solved now. @TreB1eN explicitly chose dim=-1. removing it improves the performance for detection (MTCNN).

kadirbeytorun commented 5 years ago

While changing this dim value to 1 increases recall rate, it crashes the precision rate of mtcnn greatly. I believe TreB1eN made the right call by setting it as "-1"

bokey007 commented 4 years ago

So what shold be done in this case since dim = -1 gives ValueError: need at least one array to concatenate and dim = 1 strike downs precision rate ?

Need Help

bokey007 commented 4 years ago

Also doing dim = 1 returns following error IndexError: index 0 is out of bounds for axis 0 with size 0