Skip to content

Model is not giving correct prediction scores on android #35

@nahla-naz

Description

@nahla-naz

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. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions