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

CVPR24-FAS inference problem (real and spoof faces nearly the same answer) #4

Open
zero-suger opened this issue May 7, 2024 · 0 comments

Comments

@zero-suger
Copy link

Good morning ~

First of all thank you such a hard work.

I have trained FAS model with my custom dataset and now i am trying to test trained model with my custom datasets. I applied the same preprocessing to test images (detect face and crop with MTCNN, Normalize, Resize, ToTensor ) :
normalization = transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])

test_transform = transforms.Compose([
    transforms.Resize((config.MODEL.image_size, config.MODEL.image_size)),
    transforms.ToTensor(),
    normalization
])

and when I tried to get results with Sigmoid the results of real faces and spoof faces are nearly the same:

(sample_image = test_transform(image)
logits = model(sample_image.unsqueeze(0))
print(f'I am Sigmoid score : {torch.sigmoid(logits).item()}')) -----> 0.4~ average score for real faces and also for spoof faces.

Note : but when i tried to get scores like : logit = logits if config.MODEL.num_classes==1 else F.softmax(logits, dim=1)[:, 1] the output for spoof faces are mainly '-' scores and for real faces the are '+' scores. But I wanna apply sigmoid and get a score in a range of [0~1].

I used default parameters 'ICM2O.yaml' and 'loss_func: "bce'.

Please can you help me, Thank you very much ...

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