PyTorch implementation for Stochastic Fine-grained Labeling of Multi-state Sign Glosses for Continuous Sign Language Recognition.

Overview

Stochastic CSLR

This is the PyTorch implementation for the ECCV 2020 paper: Stochastic Fine-grained Labeling of Multi-state Sign Glosses for Continuous Sign Language Recognition.

Quick Start

1. Installation

pip install git+https://github.com/zheniu/stochastic-cslr

Also, you need to install sclite for evaluation. Take a look at step 2 for instructions.

2. Prepare the dataset

  • Download the RWTH-PHOENIX-2014 dataset here.
  • Unzip it and obtain the path to phoenix-2014-multisigner/ folder for later use.
  • Install sclite for evaluation. Check phoenix-2014-multisigner/evaluation/NIST-sclite_sctk-2.4.0-20091110-0958.tar.bz2 for detail.
  • After installing sclite, put it in your PATH.

3. Run a quick test

You can use the script quick_test.py for a quick test.

python3 quick_test.py --data-root your_path_to/phoenix-2014-multisigner

By specifying the model type --model sfl/dfl, the data split --split dev/test, whether to use a language model--use-lm, you can get the following results:

Model WER (dev) sub/del/ins (dev) WER (test) sub/del/ins (test)
DFL 27.1 12.7/7.4/7.0 27.7 13.8/7.3/6.6
SFL 26.2 12.7/6.9/6.7 26.6 13.7/6.5/6.4
DFL + LM 25.6 11.5/9.2/4.9 26.4 12.4/9.3/4.7
SFL + LM 24.3 11.4/8.5/4.4 25.3 12.4/8.5/4.3

Note that these results are slightly different from the paper as a different random seed is used.

You may also take a look at quick_test.py as it shows how to use the pretrained models.

4. Train your own model

The configuration files for deterministic and stochastic fine-grained labeling are put under config/. The training script is based on a PyTorch experiment runner torchzq, which automatically reads the hyperparameters in the YAML file and passes them to stochastic_cslr/runner.py.

Before running, change the data_root in the YAML configurations to phoenix-2014-multisigner/ first.

Train (for instance, dfl):

tzq config/dfl-fp16.yml train

Test the trained model

tzq config/dfl-fp16.yml test

Citation

You may cite this work by:

@inproceedings{niu2020stochastic,
  title={Stochastic Fine-Grained Labeling of Multi-state Sign Glosses for Continuous Sign Language Recognition},
  author={Niu, Zhe and Mak, Brian},
  booktitle={European Conference on Computer Vision},
  pages={172--186},
  year={2020},
  organization={Springer}
}
You might also like...
 WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose
WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose

WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose Yijun Zhou and James Gregson - BMVC2020 Abstract: We present an end-to-end head-pos

The coda and data for
The coda and data for "Measuring Fine-Grained Domain Relevance of Terms: A Hierarchical Core-Fringe Approach" (ACL '21)

We propose a hierarchical core-fringe learning framework to measure fine-grained domain relevance of terms – the degree that a term is relevant to a broad (e.g., computer science) or narrow (e.g., deep learning) domain.

Code release for The Devil is in the Channels: Mutual-Channel Loss for Fine-Grained Image Classification (TIP 2020)
Code release for The Devil is in the Channels: Mutual-Channel Loss for Fine-Grained Image Classification (TIP 2020)

The Devil is in the Channels: Mutual-Channel Loss for Fine-Grained Image Classification Code release for The Devil is in the Channels: Mutual-Channel

Code for Talk-to-Edit (ICCV2021). Paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog.
Code for Talk-to-Edit (ICCV2021). Paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog.

Talk-to-Edit (ICCV2021) This repository contains the implementation of the following paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog Yumin

[ICCV 2021] Counterfactual Attention Learning for Fine-Grained Visual Categorization and Re-identification
[ICCV 2021] Counterfactual Attention Learning for Fine-Grained Visual Categorization and Re-identification

Counterfactual Attention Learning Created by Yongming Rao*, Guangyi Chen*, Jiwen Lu, Jie Zhou This repository contains PyTorch implementation for ICCV

SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021)
SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021)

SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021) PyTorch implementation of SnapMix | paper Method Overview Cite

Fine-grained Control of Image Caption Generation with Abstract Scene Graphs
Fine-grained Control of Image Caption Generation with Abstract Scene Graphs

Faster R-CNN pretrained on VisualGenome This repository modifies maskrcnn-benchmark for object detection and attribute prediction on VisualGenome data

TransFGU: A Top-down Approach to Fine-Grained Unsupervised Semantic Segmentation

TransFGU: A Top-down Approach to Fine-Grained Unsupervised Semantic Segmentation Zhaoyun Yin, Pichao Wang, Fan Wang, Xianzhe Xu, Hanling Zhang, Hao Li

Weakly Supervised Posture Mining with Reverse Cross-entropy for Fine-grained Classification

Fine-grainedImageClassification Weakly Supervised Posture Mining with Reverse Cross-entropy for Fine-grained Classification We trained model here: lin

Comments
  • _pickle.UnpicklingError: invalid load key, 'v'.

    _pickle.UnpicklingError: invalid load key, 'v'.

    When I run quick_test.py,It just stuck like that. I don't know how to fix it. I've already downloaded all the model files.

    Traceback (most recent call last): File "/tmp/pycharm_project_338/quick_test.py", line 43, in model = stochastic_cslr.load_model(args.model == "sfl") File "/tmp/pycharm_project_338/stochastic_cslr/init.py", line 19, in load_model model.load_state_dict(load_url(model_urls["sfl" if use_sfl else "dfl"])) File "/home/ysy/disk/ysy/miniconda3/envs/stochastic/lib/python3.7/site-packages/torch/hub.py", line 559, in load_state_dict_from_url return torch.load(cached_file, map_location=map_location) File "/home/ysy/disk/ysy/miniconda3/envs/stochastic/lib/python3.7/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/ysy/disk/ysy/miniconda3/envs/stochastic/lib/python3.7/site-packages/torch/serialization.py", line 764, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

    Process finished with exit code 1

    I don't know how to deal with it. Any idea, please?

    bug 
    opened by angel-yan 3
  • Can you please check this error?

    Can you please check this error?

    ==> Vocab: {'A': 0, 'AACHEN': 1, 'AB': 2, 'AB-JETZT': 3, 'AB-PLUSPLUS': 4, 'ABEND': 5, 'ABER': 6, 'ABFALLEN': 7, 'ABSCHIED': 8, 'ABSCHNITT': 9, 'ABSINKEN': 10, 'ABWECHSELN': 11, 'ACH': 12, 'ACHT': 13, 'ACHTE': 14, 'ACHTHUNDERT': 15, 'ACHTUNG': 16, 'ACHTZEHN': 17, 'ACHTZIG': 18, 'AEHNLCH': 19, [...] ==> Vocab size: 1232 ==> Dataset size: 5672 ==> #params: 20991366 Train: 1/30: 0%| | 0/709 [00:00<?, ?it/s]/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /opt/conda/conda-bld/pytorch_1623448272031/work/c10/core/TensorImpl.h:1156.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) /home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchzq/runners/legacy.py:68: FutureWarning: Non-finite norm encountered in torch.nn.utils.clip_grad_norm_; continuing anyway. Note that the default behavior will change in a future release to error out if a non-finite total norm is encountered. At that point, setting error_if_nonfinite=false will be required to retain the old behavior. args.grad_clip_thres, Train: 1/30: 16%|█████████████████████████████▍ | 112/709 [03:25<18:14, 1.83s/it] ╰, iteration: 112 ╰, ctc_loss: 6.686 ╰, rif_loss: -10.14 ╰, ent_loss: -0.01603 ╰, bsl_loss: 40.41 ╰, grad_norm: 19.87 ╰, lr: 0.0001 Traceback (most recent call last): File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jygim/Workspace/stochastic-cslr/stochastic_cslr/runner.py", line 183, in torchzq.start(Runner) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/zouqi/core.py", line 206, in start for key, value in vars(command_args).items() File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchzq/runners/legacy.py", line 80, in train super().train(**kwargs) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchzq/runners/base.py", line 326, in train for batch in pbar: File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/tqdm/std.py", line 1185, in iter for obj in iterable: File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 521, in next data = self._next_data() File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 561, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/phoenix_datasets/datasets.py", line 96, in getitem frames = np.stack(list(frames)) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 60, in call img = t(img) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 297, in forward return F.resize(img, self.size, self.interpolation, self.max_size, self.antialias) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 401, in resize return F_pil.resize(img, size=size, interpolation=pil_interpolation, max_size=max_size) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/torchvision/transforms/functional_pil.py", line 241, in resize return img.resize(size[::-1], interpolation) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/PIL/Image.py", line 1982, in resize self.load() File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/PIL/ImageFile.py", line 274, in load raise_oserror(err_code) File "/home/jygim/miniconda3/envs/scslr/lib/python3.6/site-packages/PIL/ImageFile.py", line 67, in raise_oserror raise OSError(message + " when reading image file") OSError: broken data stream when reading image file

    Thank you. Regards

    opened by jjayun 2
  • About running the model on a different dataset

    About running the model on a different dataset

    Hello, I was wondering if I can run this model on a different dataset in order to produce glosses and if so what would be the set up?

    Sorry if the question is kinda dumb, I'm still a beginner.

    opened by chrismcruiz 0
Owner
Zhe Niu
PhD Candidate @ CSE, HKUST
Zhe Niu
Official PyTorch implementation of N-ImageNet: Towards Robust, Fine-Grained Object Recognition with Event Cameras (ICCV 2021)

N-ImageNet: Towards Robust, Fine-Grained Object Recognition with Event Cameras Official PyTorch implementation of N-ImageNet: Towards Robust, Fine-Gra

null 32 Dec 26, 2022
Code and data of the Fine-Grained R2R Dataset proposed in paper Sub-Instruction Aware Vision-and-Language Navigation

Fine-Grained R2R Code and data of the Fine-Grained R2R Dataset proposed in the EMNLP2020 paper Sub-Instruction Aware Vision-and-Language Navigation. C

YicongHong 34 Nov 15, 2022
official Pytorch implementation of ICCV 2021 paper FuseFormer: Fusing Fine-Grained Information in Transformers for Video Inpainting.

FuseFormer: Fusing Fine-Grained Information in Transformers for Video Inpainting By Rui Liu, Hanming Deng, Yangyi Huang, Xiaoyu Shi, Lewei Lu, Wenxiu

null 77 Dec 27, 2022
PyTorch implementation of Weak-shot Fine-grained Classification via Similarity Transfer

SimTrans-Weak-Shot-Classification This repository contains the official PyTorch implementation of the following paper: Weak-shot Fine-grained Classifi

BCMI 60 Dec 2, 2022
Official pytorch code for SSC-GAN: Semi-Supervised Single-Stage Controllable GANs for Conditional Fine-Grained Image Generation(ICCV 2021)

SSC-GAN_repo Pytorch implementation for 'Semi-Supervised Single-Stage Controllable GANs for Conditional Fine-Grained Image Generation'.PDF SSC-GAN:Sem

tyty 4 Aug 28, 2022
The implementation of CVPR2021 paper Temporal Query Networks for Fine-grained Video Understanding, by Chuhan Zhang, Ankush Gupta and Andrew Zisserman.

Temporal Query Networks for Fine-grained Video Understanding ?? This repository contains the implementation of CVPR2021 paper Temporal_Query_Networks

null 55 Dec 21, 2022
On the model-based stochastic value gradient for continuous reinforcement learning

On the model-based stochastic value gradient for continuous reinforcement learning This repository is by Brandon Amos, Samuel Stanton, Denis Yarats, a

Facebook Research 46 Dec 15, 2022
Saeed Lotfi 28 Dec 12, 2022
PyTorch code for the paper "Complementarity is the King: Multi-modal and Multi-grained Hierarchical Semantic Enhancement Network for Cross-modal Retrieval".

Complementarity is the King: Multi-modal and Multi-grained Hierarchical Semantic Enhancement Network for Cross-modal Retrieval (M2HSE) PyTorch code fo

Xinlei-Pei 6 Dec 23, 2022
MLOps will help you to understand how to build a Continuous Integration and Continuous Delivery pipeline for an ML/AI project.

page_type languages products description sample python azure azure-machine-learning-service azure-devops Code which demonstrates how to set up and ope

null 1 Nov 1, 2021