Comments (8)
Besides, I would ask about how can I extract the log probabilies of the recognized frames in order to decode them using a decoder software.
Thanks.
from returnn.
Hi,
the [1,2] and [2,1] entries in data and sizes should better not be touched. the 79 means we have 79 characters (excluding the CTC blank), so yes, it's correct to change it to 107 if you have 107 characters.
To extract posteriors, you can use the config_fwd of the mdlstm example.
Then you can do a very simple decoding (without language model, or lexicon) using decode.py to see if it is working.
from returnn.
Hi, thank you for your response.
I have used this code to decode:
`#!/usr/bin/env python
import h5py
import numpy
with open("chars.txt") as f:
chars = [l.strip() for l in f.readlines()]
print chars
with h5py.File("mdlstm_real_test.h5", "r") as f:
x = f["inputs"][...]
x = numpy.argmax(x, axis=1)
print 'x: ', x
x = [chars[idx] for idx in x]
**print 'char:' , x**
lens = f["seqLengths"][...]
tags = f["seqTags"][...]
start = 0
for tag, len_ in zip(tags, lens):
y = []
last_char = None
for c in x[start:start+len_]:
if last_char != c:
y.append(c)
last_char = c
y = [" " if c == "|" else c for c in y]
output = "".join(y).strip()
print tag, output
start += len_`
the char list : ['', '', 'aaA', 'aaE', 'aeA', 'aeE'.....]
But, x contains: char: ['|', '|', '|', '|', '|', '|', '|', '|', '|', '|',................
and no result in the decoding, no output
from returnn.
Hi,
please first make sure that the demo including decoding (using the original set of characters) works for you. Is this the case?
from returnn.
I did not test it, I will verify, thanks
from returnn.
I have just a question, when we train the MDLSTM for line images which are written from right to left,
is there some parameters to change in the code or config??
such the case of Arabic text,
Thanks
from returnn.
We don't have such an option unfortunately. One possibility would be to explicitly flip the images and overwrite them with the flipped versions, or do the flipping when converting the raw images to hdf5.
from returnn.
I have done this when I convert to hdf5:
img = imread(img_name)
rimg = cv2.flip(img, 1)
....................
from returnn.
Related Issues (20)
- PyTorch/RF (?): choosing on which epochs to save optimizer state
- Datasets: blocklist in addition to allowlist for segment list file
- Make batch_size configurable for cross validation HOT 1
- Ignore a single broken gradient HOT 2
- DistributeFilesDataset: _distribute_evenly_by_size suboptimal for multi-gpu sharding HOT 8
- multiprocessing: OSError: AF_UNIX path too long HOT 11
- ConcatSeqsDataset with extended functionality HOT 3
- Torch: print model at log verbosity 3 HOT 1
- RuntimeError: CUDA error: an illegal memory access was encountered HOT 1
- Torch gradient_checkpoint_scope _unregister_custom_saved_tensors_hooks error HOT 4
- RF parametrization breaks Conv
- Torch gradient_checkpoint_scope could trigger segmentation fault? HOT 16
- Torch gradient_checkpoint_scope potential memory leak
- Torch multiple simultaneous gradient_checkpoint_scope
- `rf.pack_padded` with PyTorch takes a lot of memory HOT 1
- `rf.RelPosCausalSelfAttention` fails with `single_step_dim` HOT 9
- Torch `report_profile` `check_events` based tests maybe unstable HOT 1
- Torch: gradient_clip wrong when grad_scaler is used
- Torch print step info on crash
- Make `FileCache` able to detect updated remote files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from returnn.