Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

catalyst-team/video

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catalyst logo

Accelerated DL R&D

Build Status CodeFactor Pipi version Docs PyPI Status

Twitter Telegram Slack Github contributors

PyTorch framework for Deep Learning research and development. It was developed with a focus on reproducibility, fast experimentation and code/ideas reusing. Being able to research/develop something new, rather than write another regular train loop.
Break the cycle - use the Catalyst!

Project manifest. Part of PyTorch Ecosystem. Part of Catalyst Ecosystem:

  • Alchemy - Experiments logging & visualization
  • Catalyst - Accelerated Deep Learning Research and Development
  • Reaction - Convenient Deep Learning models serving

Catalyst at AI Landscape.


Catalyst.Video

You will learn how to build video classification pipeline with transfer learning using the Catalyst framework to get reproducible results.

Preparation

You have to split your video files into classes in the following format:

video_dataset/
    action_0/
        video_abc.avi
        ...
    action_1/
        video_abcd.avi
        ...

Data preprocessing

catalyst-data tag2label \
    --in-dir=./data/video_dataset \
    --out-dataset=./data/dataset.csv \
    --out-labeling=./data/labeling.json \
    --tag-column=video
python tsn/process_data.py \
    --in-csv=./data/dataset.csv \
    --datapath=./data/video_dataset \
    --out-csv=./data/dataset_processed.csv \
    --out-dir=./data/video_dataset_processed \
    --n-cpu=4 \
    --verbose

Data splitting

PYTHONPATH=tsn python tsn/prepare_splits.py \
    --base_path=./data/video_dataset \
    --dataset_path=./data/dataset.csv \
    --out_folder=./data \
    --k_fold=5 \
    --use_folds=4

Model training

CUDA_VISIBLE_DEVICES=0 catalyst-dl run --config configs/train.yml

Tensorboard

CUDA_VISIBLE_DEVICES="" tensorboard --logdir /mnt/ssd1/logs/tsn --host=0.0.0.0 --port=6006

WIP

Model inference

Don't forget to fix data_params at infer.yaml

export LOGDIR=/mnt/ssd1/logs/tsn
CUDA_VISIBLE_DEVICES=1 PYTHONPATH=tsn catalyst-dl infer \
   --expdir=tsn \
   --resume=${LOGDIR}/checkpoint.best.pth.tar \
   --out-prefix=${LOGDIR}/dataset.predictions.npy \
   --config=${LOGDIR}/config.json,./configs/infer.yml \
   --verbose

Docker (TODO)

Build

docker build -t tsn .

Run

docker run --rm -it \
    -p 8893:8893 \
    --ipc=host \
    --runtime=nvidia \
    tsn \
    flask run -p 8893 --host=0.0.0.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages