SthPhoenix / InsightFace-REST

InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Apache License 2.0
486 stars 118 forks source link

What is the difference between scrfd_10g_bnkps and scrfd_10g_gnkps #130

Open kurso06 opened 4 months ago

kurso06 commented 4 months ago

Hey. I have analyzed .onnx files of both gnkps and bnkps models for scrfd_10g, and I saw that there are so many differences in architecture of these models. So what is the DIFFERENCES between gnkps and bnkps. I mean, If I want to create gnkps on my own, how would I do? For example, I know that one of them is trained with GN(group normalization) and the other one is BN(batch normalization) BUT is that all?

I wonder of why GNKPS is more successful, and the bnkps is not, especially for big faces but small faces too. Thanks in advance.

SthPhoenix commented 4 months ago

Hi! Yes, all the difference is in GN vs BN, nothing else was changed during training. I've commited GN config to main insightface repo, if I recall correctly, so all the training can be reproduced with original repo.

You can read the discussion on this issue here: https://github.com/deepinsight/insightface/issues/1518

BTW: for now yolov5-face models performs much better in edge cases.

kurso06 commented 4 months ago

Thanks for your quick response. I see your point. Can you just please share --config file of scrfd_10g_gnkps which is .py extended and .pth extended version of scrfd_10g_gnps.onnx file with me please?

I want to run test.py in scrfd/tools/ but as you know it needs --config and --checkpoint file OR perhaps you could suggest another way to run test.py with scrfd_10g_gnkps.

image

SthPhoenix commented 3 months ago

Hi! Unfortunately I have lost original pth files with faulty ssd, only ONNX on google drive have left. Also I recommend using yolov5 models for now, they produce better landmarks, which increase face recognition quality.

kuanyshbakytuly commented 3 months ago

Hi! Unfortunately I have lost original pth files with faulty ssd, only ONNX on google drive have left. Also I recommend using yolov5 models for now, they produce better landmarks, which increase face recognition quality.

Could you share link to google drive's folder with scrfd models on onnx?

SthPhoenix commented 3 months ago

Hi! Unfortunately I have lost original pth files with faulty ssd, only ONNX on google drive have left. Also I recommend using yolov5 models for now, they produce better landmarks, which increase face recognition quality.

Could you share link to google drive's folder with scrfd models on onnx?

https://drive.google.com/drive/folders/109D__GLXHPmiW9tIgsCadTdjcXB0u0vK?usp=drive_link

kuanyshbakytuly commented 3 months ago

Hi! Unfortunately I have lost original pth files with faulty ssd, only ONNX on google drive have left. Also I recommend using yolov5 models for now, they produce better landmarks, which increase face recognition quality.

Could you share link to google drive's folder with scrfd models on onnx?

https://drive.google.com/drive/folders/109D__GLXHPmiW9tIgsCadTdjcXB0u0vK?usp=drive_link

I have installed scrfd_2.5g_gnkps.onnx from this folder. I get md5sum a711d520006b358240836689b26ab4b4 But you said that here https://github.com/SthPhoenix/InsightFace-REST/issues/100#issuecomment-1303181418 md5sum of scrfd_2.5g_gnkps.onnx is 50febd32caa699ef7a47cf7422c56bbd

And I get error InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Invalid Output Name:score_8

SthPhoenix commented 3 months ago

Proper model for scrfd_2.5g_gnkps is scrfd_2.5g_gnkps_v2.onnx it has matching hash.

InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Invalid Output Name:score_8

It seems library have tried building TRT engine, but it failed. Try cleaning models/trt-engines/scrfd_2.5g_gnkps/ directory, and than run container again, after downloading proper model.