Giter VIP home page Giter VIP logo

ms-tcn's Introduction

MS-TCN

this is the re-implementation of Mult-Stage TCN (MS-TCN) with pytorch.

Dataset

GTEA, 50Salads, Breakfast

Maximum number of frames in a video GTEA: 2009 50salads: 9072 (downsampled from 30fps to 15fps) breakfast: 9741

You can download features and G.T. of these datasets from this repository

Requirements

* Python 3.x
* pytorch => 1.0
* torchvision
* pandas
* numpy
* tqdm
* PyYAML
* addict

You can download packages using requirements.txt.
pip install -r requirements.txt

directory structure

basestation_rust_detection ── csv/
                           ├─ libs/
                           ├─ result/
                           ├─ utils/
                           ├─ dataset ─── 50salads/...
                           │           ├─ breakfast/...
                           │           └─ gtea ─── features/
                           │                    ├─ groundTruth/
                           │                    ├─ splits/
                           │                    └─ mapping.txt
                           ├.gitignore
                           ├ README.md
                           ├ requirements.txt
                           ├ train.py
                           └ eval.py

How to use

Setting

First, convert ground truth files into numpy array. Please run python utils/generate_gt_array.py ./dataset Then, please run the below script to generate csv files for data laoder'. python utils/builda_dataset.py ./dataset

Training

Just run python train.py ./result/xxx/xxx/config.yaml --resume

You can train a model in your own setting. Follow the below example of a configuration file.

stages: ['dilated', 'dilated', 'dilated', 'dilated']
n_features: 64
dilated_n_layers: 10
kernel_size: 15

# loss function
ce: True    # cross entropy
tmse: True    # temporal mse
tmse_weight: 0.15

class_weight: True    # if you use class weight to calculate cross entropy or not

batch_size: 1

# the number of input feature channels
in_channel: 2048

# thresholds for calcualting F1 Score
thresholds: [0.1, 0.25, 0.5]

num_workers: 4
max_epoch: 50

optimizer: Adam
scheduler: None

learning_rate: 0.0005
lr_patience: 10       # Patience of LR scheduler
momentum: 0.9         # momentum of SGD
dampening: 0.0        # dampening for momentum of SGD
weight_decay: 0.0001  # weight decay
nesterov: True        # enables Nesterov momentum
final_lr: 0.1         # final learning rate for AdaBound
poly_power: 0.9       # for polunomial learning scheduler

param_search: False

dataset: 50salads
dataset_dir: ./dataset
csv_dir: ./csv
split: 1

result_path: ./result/50salads/ms-tcn/split1

Test

Run python eval.py ./result/xxx/xxx/config.yaml test

average cross validation results

Run python utils/average_cv_results.py [result_dir]

References

  • Colin Lea et al., "Temporal Convolutional Networks for Action Segmentation and Detection", in CVPR2017 paper
  • Yazan Abu Farha et al., "MS-TCN: Multi-Stage Temporal Convolutional Network for Action Segmentation", in CVPR2019 paper code

ms-tcn's People

Contributors

dependabot[bot] avatar yiskw713 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sigmalethe

ms-tcn's Issues

Code problem

split1 2 3 4May I ask how exactly it is divided

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.