xiangrufan / keras-mtcnn

mtcnn face detection transplanted to keras
MIT License
123 stars 45 forks source link

Are the 12net.h5 24net.h5 48net.h5 pretrained for MTCNN #2

Closed jjjjohnson closed 6 years ago

jjjjohnson commented 6 years ago

Hi Xiangru,

Thanks a lot for the Keras example to train and use model. I tried to use the .h5 file to detect faces but looks like it fails to find any face... My question is that the whether the .h5 file you provide can be used to detect without retraining. If so I will go and find what I am missing.

Thanks

xiangrufan commented 6 years ago

have you tried some other photos? the H5 file should be working. I tried these files several months ago on other photos. It is converted directly from the caffe version of MTCNN (github.com/CongWeilin/mtcnn-caffe).

jjjjohnson commented 6 years ago

Hi Xiangru, Looks like I can load Pnet and Rnet successfully but not Onet. I assume net structure of 48net.h5 is different from that defined in function create_Kao_Onet (MTCNN.py)

xiangrufan commented 6 years ago

keras-mtcnn-tested18-01-24.zip I tried the code again and tested it in an image from internet, and it seems both Pnet, Rnet and Onet can load successfully in my computer. Just to make sure we are using the same version of code, I attached the whole package together with testing image into the attached zip file. You can run python Run_model_caffe_weight.py in windows cmd window to test the code. I have not tried the code in Linux, but it should be compatiable

jjjjohnson commented 6 years ago

Cool! Thank you very much!

jjjjohnson commented 6 years ago

I guress in Run_model_caffee_weight.py, you should add img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) before the rectangles = detectFace(img, threshold)