You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi kprokofi, thanks for your great and very details training pipeline project.
I want to ask about the confidence score: it returns like [array([-0.04811478, -0.20894697, 0.00486435, ..., 0.3441045 , 0.04338361, -0.12098037], dtype=float32)] when i test on an image. And the label prediction is confidence[i][1], negative numbers sometimes returned.
Is it correct for the confidence score return ?
Do I have to sort the list ?
It seems not the same as your video demo. Looking forward to hearing from you. Thank you
The text was updated successfully, but these errors were encountered:
Hi. For these who will have this problem later:
In trainer.py there is row: output = self.make_output(input_, hot_target)
and in the definition of this function later:
features = self.model(input_)
...
all_tasks_output = model1.make_logits(features, all=True)
In models/model_tools.py you can find it:
def forward(self, x):
x = self.features(x)
x = self.conv_last(x)
x = self.avgpool(x)
return x
def make_logits(self, features, all=False):
all = all if self.multi_heads else False
output = features.view(features.size(0), -1)
spoof_out = self.spoofer(output)
if all:
type_spoof = self.spoof_type(output)
lightning_type = self.lightning(output)
real_atr = torch.sigmoid(self.real_atr(output))
return spoof_out, type_spoof, lightning_type, real_atr
return spoof_out
So, during a training, this model uses not only forward method, but one additional too. And in utils.py in build_model you can find these rows multiple times:
def forward_to_onnx(self,x):
x = self.features(x)
x = self.conv_last(x)
x = self.avgpool(x)
x = x.view(x.size(0), -1)
spoof_out = self.spoofer(x)
if isinstance(spoof_out, tuple):
spoof_out = spoof_out[0]
probab = F.softmax(spoof_out*self.scaling, dim=-1)
return probab
With using one of these methods you will get an output with a shape [N, 2] where N - batch-size. First element is the confidence that image is real, and the second is the score for 'spoof' answer.
Hi kprokofi, thanks for your great and very details training pipeline project.
I want to ask about the confidence score: it returns like [array([-0.04811478, -0.20894697, 0.00486435, ..., 0.3441045 , 0.04338361, -0.12098037], dtype=float32)] when i test on an image. And the label prediction is confidence[i][1], negative numbers sometimes returned.
It seems not the same as your video demo. Looking forward to hearing from you. Thank you
The text was updated successfully, but these errors were encountered: