Open BugMaker2002 opened 8 months ago
To calculate Pearson correlation, you should first get the predicted HR values and GT HR values from all your video clips. Then input them into scipy.stats.pearsonr
to get the Pearson correlation.
To calculate Pearson correlation, you should first get the predicted HR values and GT HR values from all your video clips. Then input them into
scipy.stats.pearsonr
to get the Pearson correlation.
But isn't the function hr_fft_batch()
used to calculate heart rate? The aforementioned error information indicates that the scipy.stats.pearsonr
function requires that the input arrays x and y have at least two elements, however, the function hr_fft_batch()
changes the tensor with shape (2, 900) to (2, 1)
hi, you should convert (2,1) to (2,) before input to scipy.stats.pearsonr
.
Some errors occurred when I used the following code to calculate
MAE, RMSE,
andPearson coefficients
:The output of the above code shows: a tensor with shape of
(2, 900)
afterhr_fft_batch()
function shape changed to(2,)
, and then I applied the output tensor to thescipy.stats.pearsonr
functionto find the Pearson coefficient, but error:That is, the
pearsonr()
function requires that the input arrays x and y have at least two elements, because the Pearson correlation coefficient is a statistic that measures the strength and direction of the linear relationship between two variables. What should I do about it?