Comments (1)
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:
elif mode == 'convert':
model.forward = model.forward_to_onnx
which is:
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.
from light-weight-face-anti-spoofing.
Related Issues (20)
- how to solve this problem? HOT 1
- how to use LCC_FASD dataset without cropping?
- openvino version
- No such file or directory: './logs/MobileNet3.pth.tar'
- When I run the code, I have a problem like this, can you help me?
- casia cefa train test labels HOT 1
- How to use resnet50 or other models to train the dataset? Thank you. HOT 2
- Running inference of trained model
- Model Classifies all brown or dark people as spoof HOT 1
- Can't run bash init_venv.sh HOT 1
- AttributeError: 'openvino.inference_engine.ie_api.IECore' object has no attribute 'read_network'
- Image normalisation while predicting in demo.py HOT 1
- Low accuracy on lcc-fasd
- Convert pytorch module to openvino HOT 1
- image net weights HOT 1
- problem with face detector HOT 1
- hello i am getting error below HOT 1
- transfer learning step?
- How to use MN3_antispoof.pth.tar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from light-weight-face-anti-spoofing.