minivision-ai / Silent-Face-Anti-Spoofing-APK

Apache License 2.0
255 stars 131 forks source link

Issue with param file architecture #31

Open vrindamathur1428 opened 1 year ago

vrindamathur1428 commented 1 year ago

Hi. I was manually converting the anti spoof pth models given here into bin and param files (i.e. ncnn format) after referring to #3 issue, and following these steps. However, the architecture of my onnx/param files is different from the actual param files given here

This is the param file given in the repo: model_2.param

And this is my param file architecture: ncnn_07Apr.zip

And I checked the architectures on https://netron.app/ And they're clearly different.

And the original APK script is running fine with the original models, but crashes with the new ones. No traceback or warning or error is displayed upon crashing. There is nothing in the logs. Would you have any idea why that might be? Any insight is appreciated.

vrindamathur1428 commented 1 year ago

Solution: they're doing pth -> caffe -> ncnn instead of pth -> onnx -> ncnn

and this solution is applicable only to the first model (2.7_80x80_MiniFASNetV2.pth), and not the second model (4_0_0_80x80_MiniFASNetV1SE.pth), because it has an se_module, that is not supported by Pytorch2Caffe library, and their caffe conversion tool is not open source yet.

you can check here and here

abcxys commented 1 year ago

Hi. I was manually converting the anti spoof pth models given here into bin and param files (i.e. ncnn format) after referring to #3 issue, and following these steps. However, the architecture of my onnx/param files is different from the actual param files given here

This is the param file given in the repo: model_2.param

And this is my param file architecture: ncnn_07Apr.zip

And I checked the architectures on https://netron.app/ And they're clearly different.

And the original APK script is running fine with the original models, but crashes with the new ones. No traceback or warning or error is displayed upon crashing. There is nothing in the logs. Would you have any idea why that might be? Any insight is appreciated.

Hi there! I am trying to run the apk script in Android Studio, but kept seeing warnings "java.lang.UnsatisfiedLinkError: dlopen failed: library "libengine.so" not found" error "java.lang.UnsatisfiedLinkError: No implementation found for long com.mv.engine.FaceDetector.allocate() (tried Java_com_mv_engine_FaceDetector_allocate and Java_com_mv_engine_FaceDetector_allocate__)"

Have you encountered this issue? Many thanks!