deepcam-cn / Face-Anti-spoofing.pytorch

Train code of face anti-spoofing with a single RGB frame

Home Page:https://deepcam.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

preprocess input image

cswwp opened this issue · comments

commented

Hi, i am curious about these two aspect:
First: I am curious about the input of net, just crop detect box of face(resize to 128*128?), is there other process?
Second: I am also curious about why net depth output hold 2 channel? depth mask label just 1 channel

  1. You can do face alignment according to the landmark
  2. I get the final depth information from the first output channel after doing softmax and it needs 2 channels to do softmax. Of cause, you can use only 1 channel as output.
commented
  1. You can do face alignment according to the landmark
  2. I get the final depth information from the first output channel after doing softmax and it needs 2 channels to do softmax. Of cause, you can use only 1 channel as output.

For 2, I still confused by the out channel is 2, as you say, pixel classify, but why the depth loss is mse between the softmax probality and tue label mask? I'm confused by this question, why not regression one output channel and use mse

commented

It seems strange that using MSE between soft probability of 0 channel and depth mask

The value of depth is 01, and we can get 01 with softmax.

commented

The value of depth is 01, and we can get 01 with softmax.

Ok, did you generate depth maps with prnet? but the output depth map of prnet pixel is 0-255, mybe clip to 0or 1 will loss more detail information

Yes, I use PRNET to generate the depth maps. The depth value is [0,1], not only 0 and 1.

@liurs1990 the input image size of net is resized to 128*128 ,but the image mean is 127.5? the scalefactor is 0.0078125? The input image is converted to RGB? I'm sorry ,I use this net and use your datasets train sucess in PyTorch, and then i converted model to caffe ,but i got the same result even using the fake picture sample ,please tell me what the problem is?

@liurs1990 the input image size of net is resized to 128*128 ,but the image mean is 127.5? the scalefactor is 0.0078125? The input image is converted to RGB? I'm sorry ,I use this net and use your datasets train sucess in PyTorch, and then i converted model to caffe ,but i got the same result even using the fake picture sample ,please tell me what the problem is?

Do you use the full datasets? The dataset provided is only parts of the whole datasets.

@NOON47 You can try the onnx model.

@CodingMice I use a large database to train the model for commercial products. but I can not share the whole database.