gdwang08 / Jigsaw-VAD

Code for the paper entitled "Video Anomaly Detection by Solving Decoupled Spatio-Temporal Jigsaw Puzzles" (ECCV 2022)
GNU General Public License v3.0
55 stars 8 forks source link

list index out of range #19

Open zz1565 opened 7 months ago

zz1565 commented 7 months ago

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

khanghoang0902 commented 5 months ago

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

zz1565 commented 5 months ago

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

Liavan0122 commented 5 months ago

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.

Va6lue commented 5 months ago

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.