Giter VIP home page Giter VIP logo

vcp's Introduction

Unofficial PyTorch implement of Video cloze procedure for self-supervised spatio-temporal learning [AAAI'20]

Codes are mainly based on VCOP [CVPR'19]

Requirements

This is my experimental environment

PyTorch 1.3.0
python 3.7.4

Supported features

  • Dataset: UCF101
  • Tasks: Spatial rotation, temporal shuffling, spatial permutation, temporal remote shuffling, tempoal ajacent shuffling
  • Modality: RGB, Res

Scripts

Dataset preparation

You can follow VCOP [CVPR'19] to prepare dataset.

If you have decoded frames from videos, you can edit framefolder = os.path.join('/path/to/your/frame/folders', videoname[:-4]) in ucf101.py and directly use our provided list.

Train self-supervised part

python train_vcp.py

Retrieve video clips

python retrieve_clips.py --ckpt=/path/to/self-supervised_model

Fine-tune models for video recognition

python ft_classify --ckpt=/path/to/self-supervised_model

If you want to train models from scratch, use

python train_classify mode=train

Test models for video recognition

python train_classify --ckpt=/path/to/fine-tuned_model

Results

Retrieval results

Tag Modality top1 top5 top10 top20 top50
R3D (VCP, paper) RGB 18.6 33.6 42.5 53.5 68.1
R3D (VCP, reimplemented) RGB 24.2 41.2 50.3 60.2 74.8
R3D (VCP, reimplemented) Res 26.3 44.8 55.0 65.4 78.7

Recognition results

The R3D here used 3D Convolution and ResNet blocks. However, the architecture is not ResNet-18-3D.

Dataset Tag Modality Acc
UCF101 R3D (scratch) RGB 57.2
UCF101 R3D (scartch) Res 63.0
UCF101 R3D (VCP, paper) RGB 68.1
UCF101 R3D (VCP, reimplemented) RGB 67.4
UCF101 R3D (VCP, reimplemented) Res 71.3

Residual clips + 3D CNN The residual clips with 3D CNNs are effective. More information about this part can be found in Rethinking Motion Representation: Residual Frames with 3D ConvNets for Better Action Recognition (previous but more detailed version) and Motion Representation Using Residual Frames with 3D CNN (short version with better results).

The key code for this part is

shift_x = torch.roll(x,1,2)
x = ((shift_x -x) + 1)/2

Which is slightly different from that in papers.

Citation

VCP

@article{luo2020video,
  title={Video cloze procedure for self-supervised spatio-temporal learning},
  author={Luo, Dezhao and Liu, Chang and Zhou, Yu and Yang, Dongbao and Ma, Can and Ye, Qixiang and Wang, Weiping},
  journal={arXiv preprint arXiv:2001.00294},
  year={2020}
}

Residual clips + 3D CNN

@article{tao2020rethinking,
  title={Rethinking Motion Representation: Residual Frames with 3D ConvNets for Better Action Recognition},
  author={Tao, Li and Wang, Xueting and Yamasaki, Toshihiko},
  journal={arXiv preprint arXiv:2001.05661},
  year={2020}
}

@article{tao2020motion,
  title={Motion Representation Using Residual Frames with 3D CNN},
  author={Tao, Li and Wang, Xueting and Yamasaki, Toshihiko},
  journal={arXiv preprint arXiv:2006.13017},
  year={2020}
}

vcp's People

Contributors

bestjuly avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.