Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 6.93 KB

README.md

File metadata and controls

80 lines (54 loc) · 6.93 KB

SlowFast

SlowFast Networks for Video Recognition

Abstract

We present SlowFast networks for video recognition. Our model involves (i) a Slow pathway, operating at low frame rate, to capture spatial semantics, and (ii) a Fast pathway, operating at high frame rate, to capture motion at fine temporal resolution. The Fast pathway can be made very lightweight by reducing its channel capacity, yet can learn useful temporal information for video recognition. Our models achieve strong performance for both action classification and detection in video, and large improvements are pin-pointed as contributions by our SlowFast concept. We report state-of-the-art accuracy on major video recognition benchmarks, Kinetics, Charades and AVA.

Results and Models

Kinetics-400

frame sampling strategy scheduler resolution gpus backbone pretrain top1 acc top5 acc testing protocol FLOPs params config ckpt log
4x16x1 Linear+Cosine 224x224 8 ResNet50 None 75.55 92.35 10 clips x 3 crop 36.3G 34.5M config ckpt log
8x8x1 Linear+Cosine 224x224 8 ResNet50 None 76.80 92.99 10 clips x 3 crop 66.1G 34.6M config ckpt log
8x8x1 Linear+MultiStep 224x224 8 ResNet50 None 76.65 92.86 10 clips x 3 crop 66.1G 34.6M config ckpt log
8x8x1 Linear+Cosine 224x224 8 ResNet101 None 78.65 93.88 10 clips x 3 crop 126G 62.9M config ckpt log
4x16x1 Linear+Cosine 224x224 32 ResNet101 + ResNet50 None 77.03 92.99 10 clips x 3 crop 64.9G 62.4M config ckpt log
  1. The gpus indicates the number of gpus we used to get the checkpoint. If you want to use a different number of gpus or videos per gpu, the best way is to set --auto-scale-lr when calling tools/train.py, this parameter will auto-scale the learning rate according to the actual batch size and the original batch size.
  2. The validation set of Kinetics400 we used consists of 19796 videos. These videos are available at Kinetics400-Validation. The corresponding data list (each line is of the format 'video_id, num_frames, label_index') and the label map are also available.

For more details on data preparation, you can refer to Kinetics400.

Train

You can use the following command to train a model.

python tools/train.py ${CONFIG_FILE} [optional arguments]

Example: train SlowFast model on Kinetics-400 dataset in a deterministic option with periodic validation.

python tools/train.py configs/recognition/slowfast/slowfast_r50_8xb8-4x16x1-256e_kinetics400-rgb.py \
    --seed=0 --deterministic

For more details, you can refer to the Training part in the Training and Test Tutorial.

Test

You can use the following command to test a model.

python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [optional arguments]

Example: test SlowFast model on Kinetics-400 dataset and dump the result to a pkl file.

python tools/test.py configs/recognition/slowfast/slowfast_r50_8xb8-4x16x1-256e_kinetics400-rgb.py \
    checkpoints/SOME_CHECKPOINT.pth --dump result.pkl

For more details, you can refer to the Test part in the Training and Test Tutorial.

Citation

@inproceedings{feichtenhofer2019slowfast,
  title={Slowfast networks for video recognition},
  author={Feichtenhofer, Christoph and Fan, Haoqi and Malik, Jitendra and He, Kaiming},
  booktitle={Proceedings of the IEEE international conference on computer vision},
  pages={6202--6211},
  year={2019}
}