Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model is not giving correct prediction scores on android #35

Open
nahla-naz opened this issue Mar 7, 2024 · 0 comments
Open

Model is not giving correct prediction scores on android #35

nahla-naz opened this issue Mar 7, 2024 · 0 comments

Comments

@nahla-naz
Copy link

nahla-naz commented Mar 7, 2024

Hi,
I created Face Antispoof .pth model which is similar to the layers of model_1.param. The .pth model gives good results on my PC. I am getting prediction scores between 0-100. However, the model is giving optimised prediction scores such as 0 and 1 while running on android ( I used Silent-Face-Anti-Spoofing-APK project's code).

I did the following preprocessing for training the model:

transform = transforms.Compose([
transforms.RandomResizedCrop(size=tuple([80, 80]),
scale=(0.9, 1.1)),
transforms.ColorJitter(brightness=0.4,
contrast=0.4, saturation=0.4, hue=0.1),
transforms.RandomRotation(10),
transforms.RandomHorizontalFlip(),
transforms.ToTensor()
])

I need to implement the same preprocessing in 'Silent-Face-Anti-Spoofing-APK' project's code to get the correct prediction scores on android. Can anyone help?

If the preprocessing is not the problem, what else could it be? I tried to fix the conversion ( pth-> onnx -> param,bin). The onnx file is giving good results as well. So I'm guessing it could be because of the preprocessing. Please help. Thanks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant