ipazc / mtcnn

MTCNN face detection implementation for TensorFlow, as a PIP package.
MIT License
2.19k stars 526 forks source link

Extract weights #88

Open Neelam96 opened 4 years ago

Neelam96 commented 4 years ago

How can I extract layer-wise weights from mtcnn_weights.npy file

zjjdcrn commented 4 years ago

Hi, have you figure out how to do this? I am also urging to do this, but not sure how...

Neelam96 commented 4 years ago

Link to gist code: https://gist.github.com/Neelam96/e629c9a147054ed4c897f222f61af1f9 Using this code I have printed the weights of a particular layer to a file where I wanted to hardcode them. You need to check which dimensions are width, height and channel yourself according to the way you want to use it. You can uncomment a given snippet to print that layer's corresponding weights to the file. I hope it helps

zjjdcrn commented 4 years ago

Awesome! Thanks for sharing!

zjjdcrn commented 4 years ago

Thanks for your code! I could able to get the pre-trained weights from this. But I just realized that I need to extract the feature values for some new face images, I mean the activations from each unit in a given layer of RNet. Is there any chance you have done this too ? Your code has given me some hints to this. But I am not a python user neither a CS people, thus this is really tough for me...

Neelam96 commented 4 years ago

No, I haven't done it.

zjjdcrn commented 4 years ago

I finally got this done using a matlab toolbox. Just in case you or somebody else is interested about this: : https://www.mathworks.com/matlabcentral/fileexchange/73947-mtcnn-face-detection.