cvlab-yonsei / MNAD

An official implementation of "Learning Memory-guided Normality for Anomaly Detection" (CVPR 2020) in PyTorch.
333 stars 82 forks source link

about shanghai dataset on evaluation #47

Open Smallwhite999 opened 2 years ago

Smallwhite999 commented 2 years ago

The model can be trained normally during training, but an error is reported during testing. Does anyone know how to solve it?

File "F:\PycharmProjects\MNAD\Evaluate1.py", line 114, in valrec1 labels_list = np.append(labels_list,labels[0][4+label_length:videos[video_name]['length']+label_length]) IndexError: invalid index to scalar variable. This error is also reported on Linux

The following is the structure of Shanghai data set: 图片

TanMing11 commented 2 years ago

the label of the shanghai dataset is a list not a dict, so the code to generate the corresponding label_list is: labels_list = np.append(labels_list, labels[4+label_length:videos[video_name]['length']+label_length])

Smallwhite999 commented 2 years ago

the label of the shanghai dataset is a list not a dict, so the code to generate the corresponding label_list is: labels_list = np.append(labels_list, labels[4+label_length:videos[video_name]['length']+label_length])

It has been solved perfectly, thank you

huyi1998 commented 2 years ago

can you show your code to github? I have some problems,and I want to see your code.