Jigsaw-VAD icon indicating copy to clipboard operation
Jigsaw-VAD copied to clipboard

list index out of range

Open zz1565 opened this issue 1 year ago • 5 comments

image Hi, thanks a lot for your great work. May I ask if I first converted the original STC dataset to your structure and then used the gen_patches.py file to generate a. npy file? However, I encountered this error. Can you tell me the reason for this? Thank you

zz1565 avatar Mar 27 '24 04:03 zz1565

Hi, I have the same problem as you. May I ask have you solved it? Thank you very much

khanghoang0902 avatar May 22 '24 01:05 khanghoang0902

I kind of forgot how to solve this problem, need to change the path

zz1565 avatar May 22 '24 04:05 zz1565

HI, I have encountered the same question as you. I command "python gen_patches.py --dataset avenue--phase test --filter_ratio 0.9 --sample_num 5" on both avenue train & test dataset at first. in the training section, I command "python main.py --dataset avenue --val_step 100 --print_interval 20 --batch_size 192 --sample_num 5 --epochs 20 --static_threshold 0.2 --filter_ratio 0.9" and encountered this error:

/Jigsaw-VAD/dataset.py", line 82, in _load_data detect_result = self.detect[video_file][frame] IndexError: list index out of range

May I ask the detailed solution? Thank you very much.

Liavan0122 avatar May 22 '24 08:05 Liavan0122

The problem is in dataset.py -> class VideoAnomalyDataset_C3D -> def _load_data -> line 74: l = os.listdir(self.data_dir + '/' + video_file) This path should be your image directory not the directory storing .npy files.

Va6lue avatar May 22 '24 13:05 Va6lue