Git Product home page Git Product logo

Comments (20)

clks-wzz avatar clks-wzz commented on September 26, 2024 1

I try to train 50 epoch and then test on test set. I have a problem with this code.
score_norm = torch.sum(map_x)/torch.sum(val_maps[:,frame_t,:,:])
I found for spoof samples, this denominator is always zero. Then, it may lead to score_norm = inf.

Traceback (most recent call last):
  File "train_CDCN.py", line 445, in <module>
    train_test()
  File "train_CDCN.py", line 409, in train_test
val_threshold, test_threshold, val_ACC, val_ACER, test_ACC, test_APCER, test_BPCER, test_ACER, test_ACER_test_threshold = performances(map_score_val_filename, map_score_test_filename)

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

Can you help solve this problem? I'm confused about the meaning of this line of code

You can consider val_maps as the mask of face. The score normalization operation aims to only calculate the mean value of depth at the facial area.

from cdcn.

ZitongYu avatar ZitongYu commented on September 26, 2024 1

Hi . I am also wondering if use 'score_norm = torch.mean(map_x)' as the score of network , it will not be regularized between 0-1 . As we don't know the score range, how to set the threshold ?

I think you can try arbitrary other normalization ways or not normaliztion like 'mean' . It might drop the performance slightly. I don't think it will influence too much. Because the threshold is calculated from EER automatically. What you should do is to keep the same normaliztion/non-normaliztion in your both val and test phase.

from cdcn.

xuhangxuhang avatar xuhangxuhang commented on September 26, 2024 1

I think the code score_norm = torch.sum(map_x)/torch.sum(val_maps[:,frame_t,:,:]) means the normalization of the score. If the mean score of the ground truth depth map is 0.80( for instance), and the mean value of the predicted depth map is 0.70, then the normalization score is 7/8=0.875, and this is the final score of this prediction. If the final score is close to 1, then the model infers the result is real. You can use this normalized prediction score as the final score to get the threshold. What puzzles me is that @ZitongYu didn't provide a spoof situation. in a spoof video, torch.sum(val_maps[:,frame_t,:,:] is zero as depth map is a plane. How do you avoid the zero denominator problem? @ZitongYu Till now I implement this method using score_norm = torch.sum(map_x) , I dropout the denominator part, I will update my results recently.

from cdcn.

quangtn266 avatar quangtn266 commented on September 26, 2024 1

Hi all, Can anyone explain how to calculate a threshold ? Because if i use the evaluation code from the author, the threshold isn't correct.

from cdcn.

ZitongYu avatar ZitongYu commented on September 26, 2024

You can follow Load_OULUNPU_valtest.py.
Or you can just easily try 'score_norm = torch.mean(map_x)'

from cdcn.

superxi avatar superxi commented on September 26, 2024

Hi . I am also wondering if use 'score_norm = torch.mean(map_x)' as the score of network , it will not be regularized between 0-1 . As we don't know the score range, how to set the threshold ?

from cdcn.

baoyu-yuan avatar baoyu-yuan commented on September 26, 2024

Hi . I am also wondering if use 'score_norm = torch.mean(map_x)' as the score of network , it will not be regularized between 0-1 . As we don't know the score range, how to set the threshold ?

I think you can try arbitrary other normalization ways or not normaliztion like 'mean' . It might drop the performance slightly. I don't think it will influence too much. Because the threshold is calculated from EER automatically. What you should do is to keep the same normaliztion/non-normaliztion in your both val and test phase.

Hello, in order to abandon depth map during test phase, can I do the normalization without using depth map for both val and test phase ? Do you have any suggestions for doing this ? And if I use the same threshold for the val and test phase, will the performance fall sharply?

from cdcn.

baoyu-yuan avatar baoyu-yuan commented on September 26, 2024

Hi . I am also wondering if use 'score_norm = torch.mean(map_x)' as the score of network , it will not be regularized between 0-1 . As we don't know the score range, how to set the threshold ?

Have you tried training the model with any other normalization ?

from cdcn.

punitha-valli avatar punitha-valli commented on September 26, 2024

@clks-wzz
@xiao-keeplearning
@baorave @superxi @

Can you please tell me about the map_dir and am confused about the train, test and dev images. because in OULU-NPU dataset they provide only the videos,....

Thanks in advance

from cdcn.

lalalanding avatar lalalanding commented on September 26, 2024

I think the code score_norm = torch.sum(map_x)/torch.sum(val_maps[:,frame_t,:,:]) means the normalization of the score. If the mean score of the ground truth depth map is 0.80( for instance), and the mean value of the predicted depth map is 0.70, then the normalization score is 7/8=0.875, and this is the final score of this prediction. If the final score is close to 1, then the model infers the result is real. You can use this normalized prediction score as the final score to get the threshold. What puzzles me is that @ZitongYu didn't provide a spoof situation. in a spoof video, torch.sum(val_maps[:,frame_t,:,:] is zero as depth map is a plane. How do you avoid the zero denominator problem? @ZitongYu Till now I implement this method using score_norm = torch.sum(map_x) , I dropout the denominator part, I will update my results recently.
你好,请问你知道怎么解决分母为0 的情况了吗?

from cdcn.

xuhangxuhang avatar xuhangxuhang commented on September 26, 2024

from cdcn.

punitha-valli avatar punitha-valli commented on September 26, 2024

@xiao-keeplearning @ZitongYu @superxi @baorave @clks-wzz

I have finished mt training part and i got my model,

can anyone please tell me how to go into the test part,..?

because in CVPR2020_paper_codes, we have train.py which includes train, test and Val,

can anyone please tell me how to go into the test when I did with the train

from cdcn.

dangnh0611 avatar dangnh0611 commented on September 26, 2024

@punitha-valli Could you share your trained model, or detail process/environments for training phase?

from cdcn.

punitha-valli avatar punitha-valli commented on September 26, 2024

from cdcn.

liuyuchen6666 avatar liuyuchen6666 commented on September 26, 2024

@punitha-valli 你好,请问是每隔几秒钟将OULU数据集划分为图片的呢 非常感谢 您是否能分享一下 生成depth map和.dat文件的代码 或者数据 非常感谢 再次谢谢您

from cdcn.

luan1412167 avatar luan1412167 commented on September 26, 2024

@xiao-keeplearning @ZitongYu @superxi @baorave @clks-wzz

I have finished mt training part and i got my model,

can anyone please tell me how to go into the test part,..?

because in CVPR2020_paper_codes, we have train.py which includes train, test and Val,

can anyone please tell me how to go into the test when I did with the train

@punitha-valli @xuhangxuhang
Can you share me how to test my trained model?
Many thanks

from cdcn.

punitha-valli avatar punitha-valli commented on September 26, 2024

from cdcn.

luan1412167 avatar luan1412167 commented on September 26, 2024

@punitha-valli thanks for your help. I'm so appreciated.
In testing, I wonder that why author using binary_mask for testing? I'm so confused it

from cdcn.

punitha-valli avatar punitha-valli commented on September 26, 2024

from cdcn.

luan1412167 avatar luan1412167 commented on September 26, 2024

Just to compare the map from Cdcn and with the binary mark, It's upto you ,. You can skip the binary mark part

On Fri, Jun 11, 2021, 1:34 PM luan1412167 @.***> wrote: @punitha-valli https://github.com/punitha-valli thanks for your help. I'm so appreciated. In testing, I wonder that why author using binary_mask for testing? I'm so confused it — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMM7B23V4ZITS6X53TO4CMTTSGN7RANCNFSM4LSMKGGA .

Many thank you for your information.

from cdcn.

Related Issues (20)

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.