Code Monkey home page Code Monkey logo

i3d-pytorch's Introduction

I3D-PyTorch

This is a simple and crude implementation of Inflated 3D ConvNet Models (I3D) in PyTorch. Different from models reported in "Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset" by Joao Carreira and Andrew Zisserman, this implementation uses ResNet as backbone.

This implementation is based on OpenMMLab's MMAction2.

Data Preparation

For optical flow extraction and video list generation, please refer to TSN for details.

Training

To train a new model, use the main.py script.

For example, command to train models with RGB modality on UCF101 can be

python main.py ucf101 RGB <root_path> \
    <ucf101_rgb_train_list> <ucf101_rgb_val_list> \
    --arch i3d_resnet50 --clip_length 64 \
    --lr 0.001 --lr_steps 30 60 --epochs 80 \
    -b 32 -j 8 --dropout 0.8 \
    --snapshot_pref ucf101_i3d_resnet50

For flow models:

python main.py ucf101 Flow <root_path> \
    <ucf101_flow_train_list> <ucf101_flow_val_list> \
    --arch i3d_resnet50 --clip_length 64 \
    --lr 0.001 --lr_steps 15 30 --epochs 40 \
    -b 64 -j 8 --dropout 0.8 \
    --snapshot_pref ucf101_i3d_resnet50

Please refer to main.py for more details.

Testing

After training, there will checkpoints saved by pytorch, for example ucf101_i3d_resnet50_rgb_model_best.pth.tar.

Use the following command to test its performance:

python test_models.py ucf101 RGB <root_path> \
    <ucf101_rgb_val_list> ucf101_i3d_resnet50_rgb_model_best.pth.tar \
    --arch i3d_resnet50 --save_scores <score_file_name>

Or for flow models:

python test_models.py ucf101 Flow <root_path> \
    <ucf101_flow_val_list> ucf101_i3d_resnet50_flow_model_best.pth.tar \
    --arch i3d_resnet50 --save_scores <score_file_name>

Please refer to test_models.py for more details.

i3d-pytorch's People

Contributors

ppprior 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.