InsightFace-REST icon indicating copy to clipboard operation
InsightFace-REST copied to clipboard

What is the difference between scrfd_10g_bnkps and scrfd_10g_gnkps

Open kurso06 opened this issue 10 months ago • 7 comments

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.

kurso06 avatar Apr 19 '24 21:04 kurso06

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.

SthPhoenix avatar Apr 20 '24 17:04 SthPhoenix

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

kurso06 avatar Apr 23 '24 13:04 kurso06

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.

SthPhoenix avatar May 11 '24 18:05 SthPhoenix

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?

kuanyshbakytuly avatar May 13 '24 03:05 kuanyshbakytuly

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

SthPhoenix avatar May 14 '24 18:05 SthPhoenix

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

kuanyshbakytuly avatar May 15 '24 13:05 kuanyshbakytuly

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.

SthPhoenix avatar May 15 '24 17:05 SthPhoenix