SeanNaren / Warp Ctc
Licence: apache-2.0
Pytorch Bindings for warp-ctc
Stars: ✭ 684
Labels
Projects that are alternatives of or similar to Warp Ctc
Stdgpu
stdgpu: Efficient STL-like Data Structures on the GPU
Stars: ✭ 531 (-22.37%)
Mutual labels: cuda
Taskflow
A General-purpose Parallel and Heterogeneous Task Programming System
Stars: ✭ 6,128 (+795.91%)
Mutual labels: cuda
Kmcuda
Large scale K-means and K-nn implementation on NVIDIA GPU / CUDA
Stars: ✭ 627 (-8.33%)
Mutual labels: cuda
Lighthouse2
Lighthouse 2 framework for real-time ray tracing
Stars: ✭ 542 (-20.76%)
Mutual labels: cuda
Depthwiseconvolution
A personal depthwise convolution layer implementation on caffe by liuhao.(only GPU)
Stars: ✭ 512 (-25.15%)
Mutual labels: cuda
Chainer
A flexible framework of neural networks for deep learning
Stars: ✭ 5,656 (+726.9%)
Mutual labels: cuda
Trtorch
PyTorch/TorchScript compiler for NVIDIA GPUs using TensorRT
Stars: ✭ 583 (-14.77%)
Mutual labels: cuda
Vexcl
VexCL is a C++ vector expression template library for OpenCL/CUDA/OpenMP
Stars: ✭ 626 (-8.48%)
Mutual labels: cuda
Cudasift
A CUDA implementation of SIFT for NVidia GPUs (1.2 ms on a GTX 1060)
Stars: ✭ 555 (-18.86%)
Mutual labels: cuda
Speedtorch
Library for faster pinned CPU <-> GPU transfer in Pytorch
Stars: ✭ 615 (-10.09%)
Mutual labels: cuda
Thundergbm
ThunderGBM: Fast GBDTs and Random Forests on GPUs
Stars: ✭ 586 (-14.33%)
Mutual labels: cuda
Nv Wavenet
Reference implementation of real-time autoregressive wavenet inference
Stars: ✭ 681 (-0.44%)
Mutual labels: cuda
Mc Cnn
Stereo Matching by Training a Convolutional Neural Network to Compare Image Patches
Stars: ✭ 638 (-6.73%)
Mutual labels: cuda
Twostreamfusion
Code release for "Convolutional Two-Stream Network Fusion for Video Action Recognition", CVPR 2016.
Stars: ✭ 618 (-9.65%)
Mutual labels: cuda
PyTorch bindings for Warp-ctc
This is an extension onto the original repo found here.
Installation
Install PyTorch v0.4.
WARP_CTC_PATH
should be set to the location of a built WarpCTC
(i.e. libwarpctc.so
). This defaults to ../build
, so from within a
new warp-ctc clone you could build WarpCTC like this:
git clone https://github.com/SeanNaren/warp-ctc.git
cd warp-ctc
mkdir build; cd build
cmake ..
make
Now install the bindings:
cd pytorch_binding
python setup.py install
If you try the above and get a dlopen error on OSX with anaconda3 (as recommended by pytorch):
cd ../pytorch_binding
python setup.py install
cd ../build
cp libwarpctc.dylib /Users/$WHOAMI/anaconda3/lib
This will resolve the library not loaded error. This can be easily modified to work with other python installs if needed.
Example to use the bindings below.
import torch
from warpctc_pytorch import CTCLoss
ctc_loss = CTCLoss()
# expected shape of seqLength x batchSize x alphabet_size
probs = torch.FloatTensor([[[0.1, 0.6, 0.1, 0.1, 0.1], [0.1, 0.1, 0.6, 0.1, 0.1]]]).transpose(0, 1).contiguous()
labels = torch.IntTensor([1, 2])
label_sizes = torch.IntTensor([2])
probs_sizes = torch.IntTensor([2])
probs.requires_grad_(True) # tells autograd to compute gradients for probs
cost = ctc_loss(probs, labels, probs_sizes, label_sizes)
cost.backward()
Documentation
CTCLoss(size_average=False, length_average=False)
# size_average (bool): normalize the loss by the batch size (default: False)
# length_average (bool): normalize the loss by the total number of frames in the batch. If True, supersedes size_average (default: False)
forward(acts, labels, act_lens, label_lens)
# acts: Tensor of (seqLength x batch x outputDim) containing output activations from network (before softmax)
# labels: 1 dimensional Tensor containing all the targets of the batch in one large sequence
# act_lens: Tensor of size (batch) containing size of each output sequence from the network
# label_lens: Tensor of (batch) containing label length of each example
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].