Skip to content
Snippets Groups Projects
Commit 7e2f4c78 authored by Solene Tarride's avatar Solene Tarride
Browse files

Support batch_size>1

parent 44114755
No related branches found
No related tags found
No related merge requests found
......@@ -527,7 +527,7 @@ class CTCLanguageDecoder:
ctc_probs = ctc_probs.log()
# Insert CTC tensor between frames
for fn in range(batch_frames[0] - 1):
for fn in range(batch_frames.max() - 1):
batch_features = torch.cat(
[
batch_features[:, : 2 * fn + 1, :],
......
......@@ -508,7 +508,6 @@ def run(
dan_model.load(
model, parameters, charset, mode="eval", use_language_model=use_language_model
)
batch_size = 1 if use_language_model else batch_size
images = image_dir.rglob(f"*{image_extension}") if not image else [image]
for image_batch in list_to_batches(images, n=batch_size):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment