Giter VIP home page Giter VIP logo

hidden-two-stream's Introduction

Hidden Two-Stream Convolutional Networks for Action Recognition

This is the Caffe implementation of the "Hidden Two-Stream Convolutional Networks for Action Recognition". You can refer to paper for more details at Arxiv.

Dependencies

OpenCV 3 (Installation can be refered here)

Tested on Ubuntu 16.04 with Titan X GPU, CUDNN 5.1

Compiling

To get started, first compile caffe, by configuring a

"Makefile.config" 

then make with

$ make -j 6 all

Training

(this assumes you compiled the code sucessfully)

Here, we take UCF101 split 1 as an example.

First, go to folder,

cd models/ucf101_split1_unsup_end

Then change the FRAME_PATH in train_rgb_split1.txt and val_rgb_split1.txt to where you store the extracted video frames,

/FRAME_PATH/WallPushups/v_WallPushups_g21_c06 111 98

This follows the format as in TSN. 111 indicates the number of frames of that video clip, and 98 represents the action label. For more details about how to construct file list for training and validation, we refer you to here.

Then you need to download the initialization models (pre-trained temporal stream CNN stacked upon pre-trained MotionNet),

UCF101 split1

Then tune the parameters in end_train_val.prototxt and end_solver.prototxt as you need, or leave as it is.

Finally, you can simply run

../../build/tools/caffe train -solver=end_solver.prototxt -weights=ucf101_split1_vgg16_init.caffemodel

NOTE: It is highly likely that you may get better performance than us if you carefully tune the hyper-params such as loss weights, learning rate etc.

Testing

(this assumes you compiled the code sucessfully)

First, download our trained models:

UCF101 split 1 UCF101 split 2 UCF101 split 3

HMDB51 split 1 HMDB51 split 2 HMDB51 split 3

Then go to this folder

cd models/ucf101_split1_unsup_end/eval_ucf101

Then run

python demo_hidden.py

But maybe you need to set paths correctly in demo_hidden.py before you run it, like model_def_file and model_file. And also change the FRAME_PATH in testlist01_with_labels.txt.

Misc

There is a chance that you may get a little bit higher or lower accuracy on UCF101 and HMDB51 than the numbers reported in our paper, even using our provided trained models. This is normal because your extracted video frames may not be the same as ours, and the quality of image has an impact on the final performance. Thus, no need to raise an issue unless the performance gap is large, e.g. larger than 1%.

TODO

  • Add details and pre-trained models for 2-frame and multi-frame MotionNet
  • Add other initialization models for the rest splits of UCF101 and HMDB51
  • Experiment on large-scale action datasets, like Sports-1M and Kinetics

License and Citation

Please cite this paper in your publications if you use this code for your research:

@article{hidden_ar_zhu_2017,
  title={{Hidden Two-Stream Convolutional Networks for Action Recognition}},
  author={Yi Zhu and Zhenzhong Lan and Shawn Newsam and Alexander G. Hauptmann},
  journal={arXiv preprint arXiv:1704.00389},
  year={2017}
}

Related Projects

GuidedNet: Guided Optical Flow Learning

Acknowledgement

The code base is borrowed from TSN, DispNet and UnsupFlownet. Thanks for open sourcing the code.

hidden-two-stream's People

Contributors

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