cvlab-yonsei / MNAD

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

Problem about trainset of ShanghaiTech #12

Closed ZiruiYan closed 3 years ago

ZiruiYan commented 3 years ago

I found that all videos from ped1, Avenue and the test set of Shanghaitech of science and technology were extracted into frames. However, Shanghaitech's trainsets are in video format. How to extract it?

gitcheol commented 3 years ago

Hi there, one of the way extracting is using the ffmpeg.

ffmpeg: https://ffmpeg.org

ex) ffmpeg -i 'input_file' -r 30 'result_file' # 30 means the fps, you can check the video info by using the ffmpeg -i 'video_file'

ZiruiYan commented 3 years ago

Hi Thanks for your reply! I try ffmpeg -r 1 -i 'input_file' -r 1 'result_file', which will automatically use the video's fps. And found that the fps may be different for different videos. eg. 04_001.avi is 25 fps while others are 24 fps.

Use the code above I extracted 274515 frames, which is the same as the paper "A Revisit of Sparse Coding Based Anomaly Detection in Stacked RNN Framework". But the provided test set has 40791 frames, which is less than 42883(given in the paper). I wonder if you did additional processing on this data set? Or I can access the original video of the test set.

ZiruiYan commented 3 years ago

Use ffmpeg -r 1 -i 'input_file' -qmin 1 - qscale:v 1 -r 1 'result_file' This will make the image size the same as the test set provided

xiximin commented 3 years ago

Hello, can you provide the download link of the processed shanghaitech dataset?

LeoGeralt commented 4 months ago

使用 ffmpeg -r 1 -i 'input_file' -qmin 1 - qscale:v 1 -r 1 'result_file' 这将使图像大小与提供的测试集相同 The original test set was originally just images, with only 40791 frames. Why can the test set in the article reach 42883 frames?