Giter Club home page Giter Club logo

tensorflow-coviar's Introduction

tensorflow-CoViAR

This repository reimplement CoViAI on TensorFlow, modifying some architectural design from their original pyTorch version. The model can be trained on both UCF101 and HMDB-51 as the original implementation in their paper.

Prerequisites

The model is implemented in the following environment:

  • python3.5+
  • CUDA 9.0
  • cuDNN 7.2+
  • TensorFlow 1.11
  • FFmpeg (Please follow this description from the author to install FFmpeg for using the data loader)

Datasets

As mentioned in the paper, original .avi input videos need to be encoded into the .mpeg4 format with the GOP structure described in this paper. For convenience, we provide converted training data in the following links.

Data Loader

The author provides an excellent data loader to extract the compressed represnetation (i.e., I-frames, motion vectors, and residuals as described in their paper) from .mpeg4 videos. Based on their implementation, we integrate this loader with the TensorFlow dataset API to train our model more efficiently.

To use the data loader, please follow this instruction from the author. Before running our code, make sure you have built the data loader in the folder without any error message.

Pretrained Weights

Loading existing pretrained models and training their weights in TensorFlow could be an arduous and tedious task. We provide the weights of ResNet152 and ResNet50 for initializing our model.

Train the Model

After prepaing the above data, it is now ready to train the CoViAR model. One can simply type

python3 tf-coviar.py

to run the training scripts. On the top of the script, there are some hyperparameters and dataset directory defined by tf.app.flags. Please adjust the setting to fit your training environment.

Note that different from the original pyTorch implementation which train each model separately, we can train the three prediction models end-to-end and update the fusion parameters accordingly.

Visualization

It is also possible to visualize the classication loss via tensorboard. Here is the example and result:

tensorboard --logdir=logs/coviar

Visualization of classification loss

Visualization of validation accuracy

Note taht the i-frames model is based on ResNet 152, therefore it takes more time to converge during training.

Reference

Chao-Yuan Wu, et al., "Compressed Video Action Recognition", CVPR 2018.

"pytorch-coviar", the original implementation from the author

tensorflow-coviar's People

Contributors

azuxmioy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

wendy-up

tensorflow-coviar's Issues

Decoding video failed

Dear friend, these days I am running the code "chaoyuaw/pytorch-coviar", but I face the problems that"Could not allocate video parser context" and "Decoding video failed", I know you have run it successfully, could you give me some help? Thank you very much.
qq 20190114221301

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.