tianyu0207 / RTFM

Official code for 'Weakly-supervised Video Anomaly Detection with Robust Temporal Feature Magnitude Learning' [ICCV 2021]
326 stars 78 forks source link

roc_curve crash #68

Closed joos2010kj closed 2 years ago

joos2010kj commented 2 years ago

https://github.com/tianyu0207/RTFM/blob/main/test_10crop.py#L26

pred = list(pred.cpu().detach().numpy()) pred = np.repeat(np.array(pred), 16)

fpr, tpr, threshold = roc_curve(list(gt), pred)

Here, roc_curve crashes b/c gt's size and pred's size is inconsistent.

gt vs. pred size: [1114144, 1111824]

What would be the way to fix it?