phuselab / pyVHR

Python framework for Virtual Heart Rate
http://phuselab.di.unimi.it/
GNU General Public License v3.0
457 stars 128 forks source link

Face anti-spoofing datasets - CASIA & MSU #18

Closed Morceguito closed 3 years ago

Morceguito commented 3 years ago

Hello, I am a Msc student and I am developing a zero-shot learning solution to the face spoofing problem. I am trying to incorporate a rPPG component. I have tried to use a code similar to the one on the basic_demo notebook, only changing it to run through a lot of samples in a loop. It has worked fine on the REPLAY-ATTACK and on OULU but I am having two errors on the datasets CASIA and MSU:

I am using the following params: params = {"video": video, "verb":1, "ROImask":"skin_adapt", "skinAdapt":0.2, "winSize":5}

CASIA: "WARNING! Strange face crop: video frame 36 probably does not contain the whole face... Reshaping Crop" that then leads to "OpenCV(4.1.2) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize'".

MSU: On the code line "bpmES_chrom, timesES_chrom = chrom.runOffline(**params)" --> ValueError: The length of the input vector x must be greater than padlen, which is 39.

Also, this warning appears a lot of times: "WARNING!! Found more than 2 HDIs in Hue Channel empirical Distribution... Considering only 2" should I be worried?

I would be very thankful for any help.

aledamelio commented 3 years ago

Hi @Morceguito,

thank you for the interest in this work,

the first warning pops out when the face is not fully contained in the frame; as a consequence the face crop in that frame may be wrong. As far as I can understand, probably in one frame the face crop is empty, hence opencv is unable to reshape it. For what concerns the second warning, it is due to the adaptive thresholding procedure used for skin detection. The thresholds are computed as the Highest Density Intervals (HDIs) of the channels color distribution. When more than 2 HDIs are found it just selects the first 2. In general you can ignore this warning.

Anyway we are currently working on an updated version of the package that will fix such issues. The new version will be out soon... so stay tuned!

Alessandro

Morceguito commented 3 years ago

Hello @aledamelio,

Thank you so much for the response :) It is a huge relief that you guys are working on an updated version adressing this issue.

I will be alert!

Daniel