GithubHelp home page GithubHelp logo

rshaojimmy / maddog Goto Github PK

View Code? Open in Web Editor NEW
82.0 82.0 14.0 25.06 MB

[CVPR 2019] Pytorch codes for Multi-adversarial Discriminative Deep Domain Generalization for Face Presentation Attack Detection

Python 100.00%
adversarial-learning domain-generalization face-antispoofing

maddog's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

maddog's Issues

use of my own dataset

hello. Thanks for sharing your code. How can I use my own dataset for testing this model?

About equipment

I only have a gtx1080ti.
Is it enough to run this code successfully?
Looking forward to your reply.

About FeatExtractor

class FeatExtractor(nn.Module):
    def __init__(self, in_channels=6):
        super(FeatExtractor, self).__init__()

        self.inc = inconv(in_channels, 64)

        self.down1 = DOWN(64, 128)
        self.down2 = DOWN(128, 128)
        self.down3 = DOWN(128, 128)


    def forward(self, x):
        dx1 = self.inc(x)
        dx2 = self.down1(dx1)
        dx3 = self.down2(dx2)
        dx4 = self.down3(dx3)

        re_dx2 = F.adaptive_avg_pool2d(dx2, 32)
        re_dx3 = F.adaptive_avg_pool2d(dx3, 32)

        catfeat = torch.cat([re_dx2, re_dx3, dx4],1)

Hi, could you explain for me that
I have x with shape torch.Size([1, 6, 288, 288])
so when use FeatExtractor i get an issus that

re_dx2.shape = torch.Size([1, 128, 32, 32])
re_dx3.shape = torch.Size([1, 128, 32, 32])
dx4.shape = torch.Size([1, 128, 36, 36])

3 output must be the same shape but the dx4 have a diffirent shape for torch.cat
Can you explain this issue is relating to pytorch version or the input size
I'm using pytorch 1.11.0+cu113 now
Thank you.

Question about the Depth map

Good job. But I have a question about the depth map.

I wonder what is the range of your depth map used in your paper? [0:1] or [0:255]?

When Iuse the PRNet to generate the depth map, I think the range of values of the depth map are [0: 255], so how should I do?

Thank you very much.

Question about pretrain.py

Thanks for your open source code.

When I read your implement of the function Pre_train,I found that you use torch.nn.MSELoss

It is not correspond to the implement of the paper,which uses K-way classification with a crossentropy loss and does not use DepthEsmator.
It confused me for a lot time.

Thank you for your help.

about gan()

关于gan()函数收敛问题?怎么做才能使得gan()收敛?

Dataset file missing?

FileNotFoundError: [Errno 2] No such file or directory: '../../../datasets/OULU\image_list_real.txt'd

We had encountered this error when running the code, does anyone know the solution?
It seems that there is no data file

Dataset Problem

Hello, how do you set the sampling ratio when processing the video, I found that the images I sampled are almost the same; there is another problem, because the image sizes of different datasets are inconsistent. What about resizing them? Is it resize directly? Looking forward to hearing from you

关于域特征提取器和域判别器的一些疑问

您好,请教一下:
1、为什么每个域需要一个判别器呢?感觉可以多个域共用一个域判别器呀,是因为要和每个域的特征提取器相对应吗?
2、感觉域特征提取器也可以多个域共用一个呀,即直接对抗训练文中的G

关于对比方法的ROC曲线图

您好,请问您的工作MADDoG和RFmetaFAS中的ROC曲线图是如何绘制的呢?如果方便的话,能分享一下对比方法以及MADDoG和RFmetaFAS的FAR & FRR数据吗?谢谢您!

Domain generalization

Hey , thank you for sharing this with us. I want to try your idea on other dataset that is related to natural images (domain generalization) , this dataset is called PACS dataset each domain has seven classes and we have 4 different domains [art painting , sketch, photo, cartoon]. Do you think it is applicable ? Do you know what should I modify to make it work ? and what to take in consideration when doing that ?

Looking forward to hearing from you .

Some questions aboout the code

Congratulations, you have done a great job.

But I have two questions about the code:

  1. From you code, I could only see that you just calculate the ACC (Score) for training and testing?
    How do you choose the best model to get the lowest HTER score on the target domain?

  2. Can you share the code that calculate the HTER and AUC?

Thank you very much.
Looking forward to your reply!

Some questions about model initialization

Thanks for your open source code
But I had some problems initializing the model

File "/home/wky/3d-face-anti-spoofing/code/CVPR2019-MADDoG-master/misc/utils.py", line 48, in weights_init_xavier
init.uniform_(m.weight.data, 1.0, 0.02)
File "/home/wky/virtual/face-anti-spoofing/lib/python3.5/site-packages/torch/nn/init.py", line 88, in uniform_
return no_grad_uniform(tensor, a, b)
File "/home/wky/virtual/face-anti-spoofing/lib/python3.5/site-packages/torch/nn/init.py", line 14, in no_grad_uniform
return tensor.uniform_(a, b)
RuntimeError: Expected a_in <= b_in to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.)

When I exchange 0.02 and 1, it works fine, but I'm not sure if it will affect the result.
Another problem is that kaiming initialization is more suitable for the RELU activation function, but you use Xavier initialization in your code, could you please tell me why you chose it?
Thanks
Looking forward to your reply

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.