• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Timeception for Complex Action Recognition, CVPR 2019 (Oral Presentation)

Timeception for Complex Action Recognition

Keras Keras Keras

This code repository is the implementation for the paper Timeception for Complex Action Recognition. We provide the implementation for 3 different libraries: keras, tensorflow and pytorch.

Timeception for Complex Action Recognition

Citation

Please consider citing this work using this BibTeX entry

@inproceedings{hussein2018timeception,
  title     = {Timeception for Complex Action Recognition},
  author    = {Hussein, Noureldien and Gavves, Efstratios and Smeulders, Arnold WM},
  booktitle = {CVPR},
  year      = {2019}
}

How to Use?

Keras

Using keras, we can define timeception as a sub-model. Then we use it along with another model definition. For example, here we define 4 timeception layers followed by a dense layer for classification.

from keras import Model
from keras.layers import Input, Dense
from nets.layers_keras import MaxLayer
from nets.timeception import Timeception

# define the timeception layers
timeception = Timeception(1024, n_layers=4)

# define network for classification
input = Input(shape=(128, 7, 7, 1024))
tensor = timeception(input)
tensor = MaxLayer(axis=(1, 2, 3))(tensor)
output = Dense(100, activation='softmax')(tensor)
model = Model(inputs=input, outputs=output)
model.summary()

This results in the model defined as:

Layer (type)  Output Shape              Param #   
================================================
(InputLayer)  (None, 128, 7, 7, 1024)   0         
(Timeception) (None, 8, 7, 7, 2480)     1494304   
(MaxLayer)    (None, 2480)              0         
(Dense)       (None, 100)               248100    
================================================
Total params: 1,742,404
Tensorflow

Using tensorflow, we can define timeception as a list of nodes in the computational graph. Then we use it along with another model definition. For example, here a functions defines 4 timeception layers. It takes the input tensor, feedforward it to the timeception layers and return the output tensor output.

import tensorflow as tf
from nets import timeception

# define input tensor
input = tf.placeholder(tf.float32, shape=(None, 128, 7, 7, 1024))

# feedforward the input to the timeception layers
tensor = timeception.timeception_layers(input, n_layers=4)

# the output is (?, 8, 7, 7, 2480)
print (tensor.get_shape())
PyTorch

Using pytorch, we can define timeception as a module. Then we use it along with another model definition. For example, here we define 4 timeception layers followed by a dense layer for classification..

import numpy as np
import torch as T
from nets import timeception_pytorch

# define input tensor
input = T.tensor(np.zeros((32, 1024, 128, 7, 7)), dtype=T.float32)

# define 4 layers of timeception
module = timeception_pytorch.Timeception(input.size(), n_layers=4)

# feedforward the input to the timeception layers 
tensor = module(input)

# the output is (32, 2480, 8, 7, 7)
print (tensor.size())

Installation

We use python 2.7.15, provided by Anaconda 4.6.2, and we depend on the following python packages.

  • Keras 2.2.4
  • Tensorflow 1.10.1
  • PyTorch 1.0.1

Training

Testing

Fine-tuning

Pretrained Models

Charades

We will add all pretrained models for Charades by the end of April. For testing, start with the script ./scripts/test_charades_timeception.sh. In order to change which baseline is uses for testing, set the -- config-file using on of the following options.

2D-ResNet-152

Timeception on top of 2D-ResNet-152 as backnone.

Config File Backbone TC Layers Frames mAP (%) Model
charades_r2d_tc3_f32.yaml R2D 3 32 30.37 Link
charades_r2d_tc3_f64.yaml R2D 3 64 31.25 Link
charades_r2d_tc4_f128.yaml R2D 4 128 31.82 Link
I3D

Timeception on top of ResNet-152 as backnone.

Config File Backbone TC Layers Frames mAP (%) Model
charades_i3d_tc3_f256.yaml I3D 3 256 33.89 Link
charades_i3d_tc3_f512.yaml I3D 3 512 35.46 Link
charades_i3d_tc4_f1024.yaml I3D 4 1024 37.20 Link
3D-ResNet-100

Timeception on top of 3D-ResNet-100 as backnone.

Config File Backbone TC Layers Frames mAP (%) Model
charades_r3d_tc4_f1024.yaml R3D 4 1024 41.1 Link

Kinetics 400

We will add all pretrained models for Kinetics 400 by the end of June.

License

The code and the models in this repo are released under the GNU 3.0 LICENSE.

More Repositories

1

FingerprintRecognition

Fingerprint Recognition in runtime using images captured from mobile. Built using Android and OpenCV. Also built in MATLAB.
MATLAB
66
star
2

SceneRecognition

Scene recognition using multiple feature extractors (tiny-images, D-SIFT, BoVW, PHoW) and different classifiers (KNN, SVM).
MATLAB
21
star
3

vivit_pytorch

Implementation of ViViT: A Video Vision Transformer - Zipping Coding Challenge
Python
21
star
4

ImageEvolution

Generating an image using simple genetic algorithm
C#
10
star
5

TimeSeriesAnalysis

Analysis of financial time series using Kalman filter.
MATLAB
10
star
6

PortfolioOptimization

Portfolio Optimization and efficient frontier using MATLAB. This project is a part of assignment for COMP6212 Computational Finance course, 2nd semester, MSc AI, University of Southampton.
MATLAB
9
star
7

TrafficSignRecognition

Python
7
star
8

RecommenderSystem

Recommender system to predict the ratings of the users for 'Jokes'.
MATLAB
5
star
9

FeatureMatching

Extracting features from image using SIFT, Dense SIFT and SURF. Applying these features to stereo-vision matching.
C#
5
star
10

DerivativesPricingNN

Discussing pricing the options using non-parametric models. RBF (Radial Basis Function), MLP (Multi Layer Perceptron), PPR (Projection Pursuit Regression) and SVR (Support Vector Regression).
Java
4
star
11

UvA-AMR-2018

Repository to host the assignments and material of the practical sessions for Autonomous Mobile Robots (AMR) conducted at the University of Amsterdam for the academic year 2017/2018
MATLAB
3
star
12

Pen

Educational desktop app that allows school students to use one computer with several mice to interact and collaborate with each others.
C#
3
star
13

ShapeFromShading

Constructing 3D image (shape) for an object(s) using several images with different light source for the same object.
C#
2
star
14

phd_thesis_template

This is a template for PhD thesis for the labs: ISIS, VIS, CV, Quva @ IvI, UvA
TeX
2
star
15

DerivativesPricing

Discussing different strategies for pricing the derivatives using MATLAB.
MATLAB
2
star
16

HybridImage

Desktop application to view the result of implementation of the paper: Hybrid Images - Aude Oliva.
C#
1
star
17

ForceFieldTransform

Implemetation of Force Field Transform on image using OpenCVSharp and desktop application to read from the camera. Also, implemented for MATLAB.
C#
1
star
18

pic

Code for paper: PIC: Permutation Invariant Convolution for Recognizing Long-range Activities
1
star
19

timegate

Code for paper: TimeGate: Conditional Gating of Segments in Long-range Activities
1
star