All Projects → USTC-Video-Understanding → I3d_finetune

USTC-Video-Understanding / I3d_finetune

TensorFlow code for finetuning I3D model on UCF101.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to I3d finetune

DIN-Group-Activity-Recognition-Benchmark
A new codebase for Group Activity Recognition. It contains codes for ICCV 2021 paper: Spatio-Temporal Dynamic Inference Network for Group Activity Recognition and some other methods.
Stars: ✭ 26 (-79.69%)
Mutual labels:  action-recognition, video-understanding
Video Classification
Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
Stars: ✭ 543 (+324.22%)
Mutual labels:  cnn, action-recognition
DEAR
[ICCV 2021 Oral] Deep Evidential Action Recognition
Stars: ✭ 36 (-71.87%)
Mutual labels:  action-recognition, video-understanding
Paddlevideo
Comprehensive, latest, and deployable video deep learning algorithm, including video recognition, action localization, and temporal action detection tasks. It's a high-performance, light-weight codebase provides practical models for video understanding research and application
Stars: ✭ 218 (+70.31%)
Mutual labels:  action-recognition, video-understanding
Action Recognition Using 3d Resnet
Use 3D ResNet to extract features of UCF101 and HMDB51 and then classify them.
Stars: ✭ 32 (-75%)
Mutual labels:  cnn, action-recognition
Hidden Two Stream
Caffe implementation for "Hidden Two-Stream Convolutional Networks for Action Recognition"
Stars: ✭ 179 (+39.84%)
Mutual labels:  cnn, action-recognition
Video Understanding Dataset
A collection of recent video understanding datasets, under construction!
Stars: ✭ 387 (+202.34%)
Mutual labels:  action-recognition, video-understanding
Mmaction
An open-source toolbox for action understanding based on PyTorch
Stars: ✭ 1,711 (+1236.72%)
Mutual labels:  action-recognition, video-understanding
Tsn Pytorch
Temporal Segment Networks (TSN) in PyTorch
Stars: ✭ 895 (+599.22%)
Mutual labels:  action-recognition, video-understanding
Mmaction2
OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
Stars: ✭ 684 (+434.38%)
Mutual labels:  action-recognition, video-understanding
Actionvlad
ActionVLAD for video action classification (CVPR 2017)
Stars: ✭ 217 (+69.53%)
Mutual labels:  action-recognition, video-understanding
Temporal Segment Networks
Code & Models for Temporal Segment Networks (TSN) in ECCV 2016
Stars: ✭ 1,287 (+905.47%)
Mutual labels:  action-recognition, video-understanding
Step
STEP: Spatio-Temporal Progressive Learning for Video Action Detection. CVPR'19 (Oral)
Stars: ✭ 196 (+53.13%)
Mutual labels:  action-recognition, video-understanding
MTL-AQA
What and How Well You Performed? A Multitask Learning Approach to Action Quality Assessment [CVPR 2019]
Stars: ✭ 38 (-70.31%)
Mutual labels:  action-recognition, video-understanding
Awesome Activity Prediction
Paper list of activity prediction and related area
Stars: ✭ 147 (+14.84%)
Mutual labels:  action-recognition, video-understanding
Awesome Action Recognition
A curated list of action recognition and related area resources
Stars: ✭ 3,202 (+2401.56%)
Mutual labels:  action-recognition, video-understanding
Action Detection
temporal action detection with SSN
Stars: ✭ 597 (+366.41%)
Mutual labels:  action-recognition, video-understanding
Tdn
[CVPR 2021] TDN: Temporal Difference Networks for Efficient Action Recognition
Stars: ✭ 72 (-43.75%)
Mutual labels:  action-recognition, video-understanding
Movienet Tools
Tools for movie and video research
Stars: ✭ 113 (-11.72%)
Mutual labels:  action-recognition, video-understanding
Keras transfer cifar10
Object classification with CIFAR-10 using transfer learning
Stars: ✭ 120 (-6.25%)
Mutual labels:  cnn

Introduction

We release the entire code (both training phase & testing phase) for finetuning I3D model on UCF101.
I3D paper:Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset. Please also refer to kinetics-i3d for models and details about I3D.

Prerequisites

Software

  • Ubuntu 16.04.3 LTS
  • Python 2.7
  • CUDA8
  • CuDNN v6
  • Tensorflow 1.4.1
  • Sonnet

Hardware

GTX 1080 Ti

How to run

1. Clone this repo

git clone https://github.com/USTC-Video-Understanding/I3D_Finetune

2. Download kinetics pretrained I3D models

In order to finetune I3D network on UCF101, you have to download Kinetics pretrained I3D models provided by DeepMind at here. Specifically, download the repo kinetics-i3d and put the data/checkpoints folder into data subdir of our I3D_Finetune repo:

git clone https://github.com/deepmind/kinetics-i3d
cp -r kinetics-i3d/data/checkpoints I3D_Finetune/data

3. Create list files

We use list files in data/ucf101/ subdir to make the code find RGB images and flow data saved on disk. You have to adapt the list files to make sure the list files contain the right path to your data. Specifically, for RGB data, you have to update data/ucf101/rgb.txt. Each line in in this file should be in the format:

dir_name_of_imgs_of_a_video /path/to/img_dir num_imgs label

For example, if your RGB data of UCF101 is saved in '/data/user/ucf101/rgb', and there are 13320 subdirs in this folder, each subdir contains images from a video. If in subdir v_BalanceBeam_g14_c02, there are 96 images, and the ground truth of this video is 4, then the line for this subdir is:

v_BalanceBeam_g14_c02 /data/user/ucf101/rgb/v_BalanceBeam_g14_c02 96 4

Similarly, update data/ucf101/flow.txt for flow data. Note: we use one file to include x and y part of flow data, so we use {:s} in each line to placehold x or y in the data path. For example, if your flow data are placed like this:

|---tvl1_flow
|   |---x
|   |--- y

then you can write each line in flow.txt like this:

v_Archery_g01_c06 /data4/zhouhao/dataset/ucf101/tvl1_flow/{:s}/v_Archery_g01_c06 107 2

i.e, use {:s} replace x or y in path. If you are confused, please refer our code to see data loading details.

4. Train on UCF101 on RGB data and flow data

# Finetune on split1 of RGB data of UCF101
CUDA_VISIBLE_DEVICES=0 python finetune.py ucf101 rgb 1
# Finetune on split2 of flow data of UCF101
CUDA_VISIBLE_DEVICES=0 python finetune.py ucf101 flow 2 

We share our trained models on UCF101(RGB & FLOW) in GoogleDrive and BaiduDisk (password:ddar). You can download these models and put them in model folder of this repo. In this way you can skip the train commands above and directly run test in the next step.

5. test on UCF101 on RGB data and flow data

After you have trained the model, you can run the test procedure. First, please update _DATA_ROOT and _CHECKPOINT_PATHS in test.py by setting the value to right location of your dataset and your trained model generated in the previous step, respectively.
Then you can run testing using below commands:

# run testing on the split1 of RGB data of UCF101 
CUDA_VISIBLE_DEVICES=0 python test.py ucf101 rgb 1
# run testing on the split1 of flow data of UCF101
CUDA_VISIBLE_DEVICES=0 python test.py ucf101 flow 1
# run testing both on RGB and flow data of split1 of UCF101
CUDA_VISIBLE_DEVICES=0 python test.py ucf101 mixed 1

Results

Our training results on UCF-101 Split-1 are:

Training Split RGB Flow Fusion
  Split1         94.7%       96.3% 97.6%

Thanks to tf.Dataset API, we can achieve training speed at 1s/batch(64 frames)!

Contact

This work is mainly done by Hao Zhou (Rhythmblue) and Hezhen Hu (AlexHu123). If you have any questions, please create an issue in this repo. We are very happy to hear from you!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].