Skip to content

kimphys/FutureFramePrediction.pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FutureFramePrediction.pytorch

Introduction

This is a PyTorch implementation of Future Frame Prediction for Anomaly Detection – A New Baseline.

Input image result

Preresquisties

  • PyTorch
  • tqdm
  • Albumentations
  • NumPy
  • imageio

How to train

  • For training, you should get a sequence of video frames which contains 'normal' situations.
  • It is a good way to see UCSD Anomaly Detection Dataset to get more details.
  • Put a sequence and set your training phase at train.py
class args():
    # Dataset setting
    channels = 3
    size = 256
    frames_dir = 'datasets/train'
    time_steps = 5

where time_steps denotes each of size using the sliding window technique.

  • Download a pretrained FlowNet model from Google Drive and write its location as follows
class args():
    # optical flow setting
    flownet_pretrained = 'pretrained/FlowNet2-SD.pth'
  • Run the command below
python train.py

How to get anomalies

  • Just run the command below
python demo.py
  • Then, you can get GIF files(results/heatmap.gif) for anomalies.

To-do list

  • Add evaluation codes

Notes

About

PyTorch implementation of Future Frame Prediction for Anomaly Detection – A New Baseline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages